Code refactoring - change code style to the new clang-format rules

This commit is contained in:
Yuriy Puchkov
2020-09-23 15:24:16 +03:00
parent 5a62cd3b13
commit b88a5fbce8
175 changed files with 6200 additions and 5356 deletions

View File

@@ -1,11 +1,12 @@
#include "setshortcutwidget.h"
#include <QKeyEvent>
#include <QLayout>
#include <QLabel>
#include <QIcon>
#include <QKeyEvent>
#include <QLabel>
#include <QLayout>
#include <QPixmap>
SetShortcutDialog::SetShortcutDialog(QDialog *parent) : QDialog(parent)
SetShortcutDialog::SetShortcutDialog(QDialog* parent)
: QDialog(parent)
{
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowIcon(QIcon(":img/app/flameshot.svg"));
@@ -15,29 +16,32 @@ SetShortcutDialog::SetShortcutDialog(QDialog *parent) : QDialog(parent)
m_layout = new QVBoxLayout(this);
m_layout->setAlignment(Qt::AlignHCenter);
QLabel *infoTop = new QLabel(tr("Enter new shortcut to change "));
QLabel* infoTop = new QLabel(tr("Enter new shortcut to change "));
infoTop->setMargin(10);
infoTop->setAlignment(Qt::AlignCenter);
m_layout->addWidget(infoTop);
QLabel *infoIcon = new QLabel();
QLabel* infoIcon = new QLabel();
infoIcon->setAlignment(Qt::AlignCenter);
infoIcon->setPixmap(QPixmap(":/img/app/keyboard.svg"));
m_layout->addWidget(infoIcon);
m_layout->addWidget(infoIcon);
QLabel *infoBottom = new QLabel(tr("Press Esc to cancel or Backspace to disable the keyboard shortcut."));
QLabel* infoBottom = new QLabel(
tr("Press Esc to cancel or Backspace to disable the keyboard shortcut."));
infoBottom->setMargin(10);
infoBottom->setAlignment(Qt::AlignCenter);
m_layout->addWidget(infoBottom);
}
const QKeySequence& SetShortcutDialog::shortcut() {
const QKeySequence& SetShortcutDialog::shortcut()
{
return m_ks;
}
void SetShortcutDialog::keyPressEvent(QKeyEvent *ke) {
void SetShortcutDialog::keyPressEvent(QKeyEvent* ke)
{
if (ke->modifiers() & Qt::ShiftModifier)
m_modifier += "Shift+";
if (ke->modifiers() & Qt::ControlModifier)
@@ -51,7 +55,8 @@ void SetShortcutDialog::keyPressEvent(QKeyEvent *ke) {
m_ks = QKeySequence(m_modifier + key);
}
void SetShortcutDialog::keyReleaseEvent(QKeyEvent *event) {
void SetShortcutDialog::keyReleaseEvent(QKeyEvent* event)
{
if (m_ks == QKeySequence(Qt::Key_Escape)) {
reject();
}