diff --git a/src/cli/commandlineparser.cpp b/src/cli/commandlineparser.cpp index 2834fd59..000cd74b 100644 --- a/src/cli/commandlineparser.cpp +++ b/src/cli/commandlineparser.cpp @@ -44,8 +44,9 @@ QString optionsToString(const QList& options, } // check the length of the arguments for (auto const& arg : arguments) { - if (arg.name().length() > size) + if (arg.name().length() > size) { size = arg.name().length(); + } } // generate the text QString result; @@ -172,8 +173,9 @@ bool CommandLineParser::processOptions(const QStringList& args, ok = option.checkValue(valueStr); if (!ok) { QString msg = option.errorMsg(); - if (!msg.endsWith(QLatin1String("."))) + if (!msg.endsWith(QLatin1String("."))) { msg += QLatin1String("."); + } err << msg; return ok; } @@ -338,11 +340,13 @@ void CommandLineParser::printHelp(QStringList args, const Node* node) // add command options and subarguments QList subArgs; - for (const Node& n : node->subNodes) + for (const Node& n : node->subNodes) { subArgs.append(n.argument); + } auto modifiedOptions = node->options; - if (m_withHelp) + if (m_withHelp) { modifiedOptions << helpOption; + } if (m_withVersion && node == &m_parseTree) { modifiedOptions << versionOption; } diff --git a/src/config/buttonlistview.cpp b/src/config/buttonlistview.cpp index 54d5f446..6d042f07 100644 --- a/src/config/buttonlistview.cpp +++ b/src/config/buttonlistview.cpp @@ -30,7 +30,7 @@ void ButtonListView::initButtonList() m_buttonTypeByName.insert(tool->name(), t); // init the menu option - QListWidgetItem* m_buttonItem = new QListWidgetItem(this); + auto* m_buttonItem = new QListWidgetItem(this); // when the background is lighter than gray, it uses the white icons QColor bgColor = this->palette().color(QWidget::backgroundRole()); diff --git a/src/config/colorpickereditor.cpp b/src/config/colorpickereditor.cpp index 52e7e8fe..756b7e38 100644 --- a/src/config/colorpickereditor.cpp +++ b/src/config/colorpickereditor.cpp @@ -36,7 +36,7 @@ ColorPickerEditor::ColorPickerEditor(QWidget* parent) m_colorWheel->setMinimumSize(size, size); m_gLayout->addWidget(m_colorWheel, 1, 0); - QVBoxLayout* m_vLocalLayout1 = new QVBoxLayout(); + auto* m_vLocalLayout1 = new QVBoxLayout(); m_vLocalLayout1->addStretch(); m_colorSpinboxLabel = new QLabel(tr("Select Preset:"), this); @@ -66,7 +66,7 @@ ColorPickerEditor::ColorPickerEditor(QWidget* parent) m_gLayout->addLayout(m_vLocalLayout1, 0, 1); - QVBoxLayout* m_vLocalLayout2 = new QVBoxLayout(); + auto* m_vLocalLayout2 = new QVBoxLayout(); m_vLocalLayout2->addStretch(); m_addPresetLabel = new QLabel(tr("Add Preset:"), this); @@ -103,8 +103,9 @@ void ColorPickerEditor::addPreset() ConfigHandler config; QVector colors = config.userColors(); - if (colors.contains(m_color)) + if (colors.contains(m_color)) { return; + } colors << m_color; diff --git a/src/config/configerrordetails.cpp b/src/config/configerrordetails.cpp index da68e19a..db1a07a1 100644 --- a/src/config/configerrordetails.cpp +++ b/src/config/configerrordetails.cpp @@ -21,7 +21,7 @@ ConfigErrorDetails::ConfigErrorDetails(QWidget* parent) setLayout(new QVBoxLayout(this)); // Add text display - QTextEdit* textDisplay = new QTextEdit(this); + auto* textDisplay = new QTextEdit(this); textDisplay->setPlainText(str); textDisplay->setReadOnly(true); layout()->addWidget(textDisplay); diff --git a/src/config/configresolver.cpp b/src/config/configresolver.cpp index 49e27b06..07a9bf30 100644 --- a/src/config/configresolver.cpp +++ b/src/config/configresolver.cpp @@ -97,7 +97,7 @@ void ConfigResolver::populate() ++row; } - QFrame* separator = new QFrame(this); + auto* separator = new QFrame(this); separator->setFrameShape(QFrame::HLine); separator->setFrameShadow(QFrame::Sunken); layout()->addWidget(separator, row, 0, 1, 2); @@ -109,18 +109,20 @@ void ConfigResolver::populate() auto* buttons = new BBox(this); layout()->addWidget(buttons, row, 0, 1, 2, Qt::AlignCenter); if (anyErrors) { - QPushButton* resolveAll = new QPushButton(tr("Resolve all")); + auto* resolveAll = new QPushButton(tr("Resolve all")); resolveAll->setToolTip(tr("Resolve all listed errors.")); buttons->addButton(resolveAll, BBox::ResetRole); connect(resolveAll, &QPushButton::clicked, this, [=]() { - for (const auto& key : semanticallyWrong) + for (const auto& key : semanticallyWrong) { ConfigHandler().resetValue(key); - for (const auto& key : unrecognized) + } + for (const auto& key : unrecognized) { ConfigHandler().remove(key); + } }); } - QPushButton* details = new QPushButton(tr("Details")); + auto* details = new QPushButton(tr("Details")); buttons->addButton(details, BBox::HelpRole); connect(details, &QPushButton::clicked, this, [this]() { (new ConfigErrorDetails(this))->exec(); diff --git a/src/config/configwindow.cpp b/src/config/configwindow.cpp index 3659123d..1408415b 100644 --- a/src/config/configwindow.cpp +++ b/src/config/configwindow.cpp @@ -32,7 +32,7 @@ ConfigWindow::ConfigWindow(QWidget* parent) : QWidget(parent) { // We wrap QTabWidget in a QWidget because of a Qt bug - auto layout = new QVBoxLayout(this); + auto* layout = new QVBoxLayout(this); m_tabWidget = new QTabWidget(this); m_tabWidget->tabBar()->setUsesScrollButtons(false); layout->addWidget(m_tabWidget); @@ -54,7 +54,7 @@ ConfigWindow::ConfigWindow(QWidget* parent) // visuals m_visuals = new VisualsEditor(); m_visualsTab = new QWidget(); - QVBoxLayout* visualsLayout = new QVBoxLayout(m_visualsTab); + auto* visualsLayout = new QVBoxLayout(m_visualsTab); m_visualsTab->setLayout(visualsLayout); visualsLayout->addWidget(m_visuals); m_tabWidget->addTab( @@ -63,7 +63,7 @@ ConfigWindow::ConfigWindow(QWidget* parent) // filename m_filenameEditor = new FileNameEditor(); m_filenameEditorTab = new QWidget(); - QVBoxLayout* filenameEditorLayout = new QVBoxLayout(m_filenameEditorTab); + auto* filenameEditorLayout = new QVBoxLayout(m_filenameEditorTab); m_filenameEditorTab->setLayout(filenameEditorLayout); filenameEditorLayout->addWidget(m_filenameEditor); m_tabWidget->addTab(m_filenameEditorTab, @@ -73,7 +73,7 @@ ConfigWindow::ConfigWindow(QWidget* parent) // general m_generalConfig = new GeneralConf(); m_generalConfigTab = new QWidget(); - QVBoxLayout* generalConfigLayout = new QVBoxLayout(m_generalConfigTab); + auto* generalConfigLayout = new QVBoxLayout(m_generalConfigTab); m_generalConfigTab->setLayout(generalConfigLayout); generalConfigLayout->addWidget(m_generalConfig); m_tabWidget->addTab( @@ -82,7 +82,7 @@ ConfigWindow::ConfigWindow(QWidget* parent) // shortcuts m_shortcuts = new ShortcutsWidget(); m_shortcutsTab = new QWidget(); - QVBoxLayout* shortcutsLayout = new QVBoxLayout(m_shortcutsTab); + auto* shortcutsLayout = new QVBoxLayout(m_shortcutsTab); m_shortcutsTab->setLayout(shortcutsLayout); shortcutsLayout->addWidget(m_shortcuts); m_tabWidget->addTab( @@ -118,9 +118,9 @@ void ConfigWindow::keyPressEvent(QKeyEvent* e) void ConfigWindow::initErrorIndicator(QWidget* tab, QWidget* widget) { - QLabel* label = new QLabel(tab); - QPushButton* btnResolve = new QPushButton(tr("Resolve"), tab); - QHBoxLayout* btnLayout = new QHBoxLayout(); + auto* label = new QLabel(tab); + auto* btnResolve = new QPushButton(tr("Resolve"), tab); + auto* btnLayout = new QHBoxLayout(); // Set up label label->setText(tr( @@ -137,7 +137,7 @@ void ConfigWindow::initErrorIndicator(QWidget* tab, QWidget* widget) widget->setEnabled(!ConfigHandler().hasError()); // Add label and button to the parent widget's layout - QBoxLayout* layout = static_cast(tab->layout()); + auto* layout = static_cast(tab->layout()); if (layout != nullptr) { layout->insertWidget(0, label); layout->insertLayout(1, btnLayout); diff --git a/src/config/filenameeditor.cpp b/src/config/filenameeditor.cpp index 62f3c435..3f0f62d6 100644 --- a/src/config/filenameeditor.cpp +++ b/src/config/filenameeditor.cpp @@ -21,7 +21,7 @@ FileNameEditor::FileNameEditor(QWidget* parent) void FileNameEditor::initLayout() { m_layout = new QVBoxLayout(this); - auto infoLabel = new QLabel(tr("Edit the name of your captures:"), this); + auto* infoLabel = new QLabel(tr("Edit the name of your captures:"), this); infoLabel->setFixedHeight(20); m_layout->addWidget(infoLabel); m_layout->addWidget(m_helperButtons); @@ -30,7 +30,7 @@ void FileNameEditor::initLayout() m_layout->addWidget(new QLabel(tr("Preview:"))); m_layout->addWidget(m_outputLabel); - QHBoxLayout* horizLayout = new QHBoxLayout(); + auto* horizLayout = new QHBoxLayout(); horizLayout->addWidget(m_saveButton); horizLayout->addWidget(m_resetButton); horizLayout->addWidget(m_clearButton); diff --git a/src/config/generalconf.cpp b/src/config/generalconf.cpp index b9c22f3b..9a4d4530 100644 --- a/src/config/generalconf.cpp +++ b/src/config/generalconf.cpp @@ -210,7 +210,7 @@ void GeneralConf::initScrollArea() m_scrollArea = new QScrollArea(this); m_layout->addWidget(m_scrollArea); - QWidget* content = new QWidget(m_scrollArea); + auto* content = new QWidget(m_scrollArea); m_scrollArea->setWidget(content); m_scrollArea->setWidgetResizable(true); m_scrollArea->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); @@ -290,8 +290,8 @@ void GeneralConf::initHistoryConfirmationToDelete() void GeneralConf::initConfigButtons() { - QHBoxLayout* buttonLayout = new QHBoxLayout(); - QGroupBox* box = new QGroupBox(tr("Configuration File")); + auto* buttonLayout = new QHBoxLayout(); + auto* box = new QGroupBox(tr("Configuration File")); box->setFlat(true); box->setLayout(buttonLayout); m_layout->addWidget(box); @@ -420,14 +420,14 @@ void GeneralConf::initSaveAfterCopy() this, &GeneralConf::saveAfterCopyChanged); - QGroupBox* box = new QGroupBox(tr("Save Path")); + auto* box = new QGroupBox(tr("Save Path")); box->setFlat(true); m_layout->addWidget(box); - QVBoxLayout* vboxLayout = new QVBoxLayout(); + auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); - QHBoxLayout* pathLayout = new QHBoxLayout(); + auto* pathLayout = new QHBoxLayout(); QString path = ConfigHandler().savePath(); m_savePath = new QLineEdit(path, this); @@ -453,7 +453,7 @@ void GeneralConf::initSaveAfterCopy() vboxLayout->addLayout(pathLayout); vboxLayout->addWidget(m_screenshotPathFixedCheck); - QHBoxLayout* extensionLayout = new QHBoxLayout(); + auto* extensionLayout = new QHBoxLayout(); extensionLayout->addWidget( new QLabel(tr("Preferred save file extension:"))); @@ -486,11 +486,11 @@ void GeneralConf::historyConfirmationToDelete(bool checked) void GeneralConf::inituploadHistoryMax() { - QGroupBox* box = new QGroupBox(tr("Latest Uploads Max Size")); + auto* box = new QGroupBox(tr("Latest Uploads Max Size")); box->setFlat(true); m_layout->addWidget(box); - QVBoxLayout* vboxLayout = new QVBoxLayout(); + auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); m_uploadHistoryMax = new QSpinBox(this); @@ -513,11 +513,11 @@ void GeneralConf::uploadHistoryMaxChanged(int max) void GeneralConf::initUndoLimit() { - QGroupBox* box = new QGroupBox(tr("Undo limit")); + auto* box = new QGroupBox(tr("Undo limit")); box->setFlat(true); m_layout->addWidget(box); - QVBoxLayout* vboxLayout = new QVBoxLayout(); + auto* vboxLayout = new QVBoxLayout(); box->setLayout(vboxLayout); m_undoLimit = new QSpinBox(this); diff --git a/src/config/setshortcutwidget.cpp b/src/config/setshortcutwidget.cpp index 51aa0baf..c2002406 100644 --- a/src/config/setshortcutwidget.cpp +++ b/src/config/setshortcutwidget.cpp @@ -20,12 +20,12 @@ SetShortcutDialog::SetShortcutDialog(QDialog* parent, QString shortcutName) m_layout = new QVBoxLayout(this); m_layout->setAlignment(Qt::AlignHCenter); - QLabel* infoTop = new QLabel(tr("Enter new shortcut to change ")); + auto* infoTop = new QLabel(tr("Enter new shortcut to change ")); infoTop->setMargin(10); infoTop->setAlignment(Qt::AlignCenter); m_layout->addWidget(infoTop); - QLabel* infoIcon = new QLabel(); + auto* infoIcon = new QLabel(); infoIcon->setAlignment(Qt::AlignCenter); infoIcon->setPixmap(QPixmap(":/img/app/keyboard.svg")); m_layout->addWidget(infoIcon); @@ -45,7 +45,7 @@ SetShortcutDialog::SetShortcutDialog(QDialog* parent, QString shortcutName) msg += "\n" + tr("Flameshot must be restarted for changes to take effect."); } - QLabel* infoBottom = new QLabel(msg); + auto* infoBottom = new QLabel(msg); infoBottom->setMargin(10); infoBottom->setAlignment(Qt::AlignCenter); m_layout->addWidget(infoBottom); @@ -58,14 +58,18 @@ const QKeySequence& SetShortcutDialog::shortcut() void SetShortcutDialog::keyPressEvent(QKeyEvent* ke) { - if (ke->modifiers() & Qt::ShiftModifier) + if (ke->modifiers() & Qt::ShiftModifier) { m_modifier += "Shift+"; - if (ke->modifiers() & Qt::ControlModifier) + } + if (ke->modifiers() & Qt::ControlModifier) { m_modifier += "Ctrl+"; - if (ke->modifiers() & Qt::AltModifier) + } + if (ke->modifiers() & Qt::AltModifier) { m_modifier += "Alt+"; - if (ke->modifiers() & Qt::MetaModifier) + } + if (ke->modifiers() & Qt::MetaModifier) { m_modifier += "Meta+"; + } QString key = QKeySequence(ke->key()).toString(); m_ks = QKeySequence(m_modifier + key); diff --git a/src/config/shortcutswidget.cpp b/src/config/shortcutswidget.cpp index 8415044c..ffe57b34 100644 --- a/src/config/shortcutswidget.cpp +++ b/src/config/shortcutswidget.cpp @@ -94,8 +94,7 @@ void ShortcutsWidget::populateInfoTable() m_table->setItem(i, 0, new QTableWidgetItem(description)); #if defined(Q_OS_MACOS) - QTableWidgetItem* item = - new QTableWidgetItem(nativeOSHotKeyText(key_sequence)); + auto* item = new QTableWidgetItem(nativeOSHotKeyText(key_sequence)); #else QTableWidgetItem* item = new QTableWidgetItem(key_sequence); #endif @@ -130,8 +129,7 @@ void ShortcutsWidget::onShortcutCellClicked(int row, int col) } QString shortcutName = m_shortcuts.at(row).at(0); - SetShortcutDialog* setShortcutDialog = - new SetShortcutDialog(nullptr, shortcutName); + auto* setShortcutDialog = new SetShortcutDialog(nullptr, shortcutName); if (0 != setShortcutDialog->exec()) { QKeySequence shortcutValue = setShortcutDialog->shortcut(); @@ -163,9 +161,10 @@ void ShortcutsWidget::loadShortcuts() CaptureTool* tool = ToolFactory().CreateTool(t); QString shortcutName = QVariant::fromValue(t).toString(); appendShortcut(shortcutName, tool->description()); - if (shortcutName == "TYPE_COPY") + if (shortcutName == "TYPE_COPY") { m_shortcuts << (QStringList() << "" << tool->description() << "Left Double-click"); + } delete tool; } diff --git a/src/config/strftimechooserwidget.cpp b/src/config/strftimechooserwidget.cpp index f377c210..d4678548 100644 --- a/src/config/strftimechooserwidget.cpp +++ b/src/config/strftimechooserwidget.cpp @@ -9,7 +9,7 @@ StrftimeChooserWidget::StrftimeChooserWidget(QWidget* parent) : QWidget(parent) { - QGridLayout* layout = new QGridLayout(this); + auto* layout = new QGridLayout(this); auto k = m_buttonData.keys(); int middle = k.length() / 2; // add the buttons in 2 columns (they need to be even) @@ -18,7 +18,7 @@ StrftimeChooserWidget::StrftimeChooserWidget(QWidget* parent) QString key = k.last(); k.pop_back(); QString variable = m_buttonData.value(key); - QPushButton* button = new QPushButton(this); + auto* button = new QPushButton(this); button->setText(tr(key.toStdString().data())); button->setToolTip(variable); button->setSizePolicy(QSizePolicy::Expanding, diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index 44a003b1..28bd871d 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -98,13 +98,13 @@ void UIcolorEditor::initButtons() m_vLayout->addWidget(new QLabel(tr("Select a Button to modify it"), this)); - QGroupBox* frame = new QGroupBox(); + auto* frame = new QGroupBox(); frame->setFixedSize(frameSize, frameSize); m_buttonMainColor = new CaptureToolButton(m_buttonIconType, frame); m_buttonMainColor->move(m_buttonMainColor->x() + extraSize / 2, m_buttonMainColor->y() + extraSize / 2); - QHBoxLayout* h1 = new QHBoxLayout(); + auto* h1 = new QHBoxLayout(); h1->addWidget(frame); m_labelMain = new ClickableLabel(tr("Main Color"), this); h1->addWidget(m_labelMain); @@ -113,12 +113,12 @@ void UIcolorEditor::initButtons() m_buttonMainColor->setToolTip(tr("Click on this button to set the edition" " mode of the main color.")); - QGroupBox* frame2 = new QGroupBox(); + auto* frame2 = new QGroupBox(); m_buttonContrast = new CaptureToolButton(m_buttonIconType, frame2); m_buttonContrast->move(m_buttonContrast->x() + extraSize / 2, m_buttonContrast->y() + extraSize / 2); - QHBoxLayout* h2 = new QHBoxLayout(); + auto* h2 = new QHBoxLayout(); h2->addWidget(frame2); frame2->setFixedSize(frameSize, frameSize); m_labelContrast = new ClickableLabel(tr("Contrast Color"), this); diff --git a/src/config/visualseditor.cpp b/src/config/visualseditor.cpp index e0719163..21da3532 100644 --- a/src/config/visualseditor.cpp +++ b/src/config/visualseditor.cpp @@ -32,12 +32,12 @@ void VisualsEditor::initOpacitySlider() m_opacitySlider->setFocusPolicy(Qt::NoFocus); m_opacitySlider->setOrientation(Qt::Horizontal); m_opacitySlider->setRange(0, 100); - QHBoxLayout* localLayout = new QHBoxLayout(); + auto* localLayout = new QHBoxLayout(); localLayout->addWidget(new QLabel(QStringLiteral("0%"))); localLayout->addWidget(m_opacitySlider); localLayout->addWidget(new QLabel(QStringLiteral("100%"))); - QLabel* label = new QLabel(); + auto* label = new QLabel(); QString labelMsg = tr("Opacity of area outside selection:") + " %1%"; ExtendedSlider* opacitySlider = m_opacitySlider; connect(m_opacitySlider, @@ -62,28 +62,27 @@ void VisualsEditor::initWidgets() m_colorEditor = new UIcolorEditor(); m_colorEditorTab = new QWidget(); - QVBoxLayout* colorEditorLayout = new QVBoxLayout(m_colorEditorTab); + auto* colorEditorLayout = new QVBoxLayout(m_colorEditorTab); m_colorEditorTab->setLayout(colorEditorLayout); colorEditorLayout->addWidget(m_colorEditor); m_tabWidget->addTab(m_colorEditorTab, tr("UI Color Editor")); m_colorpickerEditor = new ColorPickerEditor(); m_colorpickerEditorTab = new QWidget(); - QVBoxLayout* colorpickerEditorLayout = - new QVBoxLayout(m_colorpickerEditorTab); + auto* colorpickerEditorLayout = new QVBoxLayout(m_colorpickerEditorTab); colorpickerEditorLayout->addWidget(m_colorpickerEditor); m_tabWidget->addTab(m_colorpickerEditorTab, tr("Colorpicker Editor")); initOpacitySlider(); - auto boxButtons = new QGroupBox(); + auto* boxButtons = new QGroupBox(); boxButtons->setTitle(tr("Button Selection")); - auto listLayout = new QVBoxLayout(boxButtons); + auto* listLayout = new QVBoxLayout(boxButtons); m_buttonList = new ButtonListView(); m_layout->addWidget(boxButtons); listLayout->addWidget(m_buttonList); - QPushButton* setAllButtons = new QPushButton(tr("Select All")); + auto* setAllButtons = new QPushButton(tr("Select All")); connect(setAllButtons, &QPushButton::clicked, m_buttonList, diff --git a/src/core/controller.cpp b/src/core/controller.cpp index b86f5851..95fc2268 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -173,7 +173,7 @@ bool Controller::resolveAnyConfigErrors() bool resolved = true; ConfigHandler config; if (!config.checkUnrecognizedSettings() || !config.checkSemantics()) { - ConfigResolver* resolver = new ConfigResolver(); + auto* resolver = new ConfigResolver(); QObject::connect( resolver, &ConfigResolver::rejected, [resolver, &resolved]() { resolved = false; @@ -346,8 +346,9 @@ void Controller::startVisualCapture(const CaptureRequest& req) void Controller::startScreenGrab(CaptureRequest req, const int screenNumber) { - if (!resolveAnyConfigErrors()) + if (!resolveAnyConfigErrors()) { return; + } bool ok = true; QScreen* screen; diff --git a/src/core/flameshotdaemon.cpp b/src/core/flameshotdaemon.cpp index cceb01f0..9db914ff 100644 --- a/src/core/flameshotdaemon.cpp +++ b/src/core/flameshotdaemon.cpp @@ -184,7 +184,7 @@ void FlameshotDaemon::quitIfIdle() void FlameshotDaemon::attachPin(QPixmap pixmap, QRect geometry) { - PinWidget* pinWidget = new PinWidget(pixmap, geometry); + auto* pinWidget = new PinWidget(pixmap, geometry); m_widgets.append(pinWidget); connect(pinWidget, &QObject::destroyed, this, [=]() { m_widgets.removeOne(pinWidget); diff --git a/src/main.cpp b/src/main.cpp index 90a4a800..1d84be11 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) qApp->installTranslator(&qtTranslator); qApp->setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); - auto c = Controller::getInstance(); + auto* c = Controller::getInstance(); FlameshotDaemon::start(); #if !(defined(Q_OS_MACOS) || defined(Q_OS_WIN)) diff --git a/src/tools/arrow/arrowtool.cpp b/src/tools/arrow/arrowtool.cpp index 89b61d0b..e3109bd8 100644 --- a/src/tools/arrow/arrowtool.cpp +++ b/src/tools/arrow/arrowtool.cpp @@ -131,7 +131,7 @@ QRect ArrowTool::boundingRect() const CaptureTool* ArrowTool::copy(QObject* parent) { - ArrowTool* tool = new ArrowTool(parent); + auto* tool = new ArrowTool(parent); copyParams(this, tool); return tool; } diff --git a/src/tools/imgupload/storages/imguploaderbase.cpp b/src/tools/imgupload/storages/imguploaderbase.cpp index 779bc743..5bea7dac 100644 --- a/src/tools/imgupload/storages/imguploaderbase.cpp +++ b/src/tools/imgupload/storages/imguploaderbase.cpp @@ -97,11 +97,11 @@ void ImgUploaderBase::setInfoLabelText(const QString& text) void ImgUploaderBase::startDrag() { - QMimeData* mimeData = new QMimeData; + auto* mimeData = new QMimeData; mimeData->setUrls(QList{ m_imageURL }); mimeData->setImageData(m_pixmap); - QDrag* dragHandler = new QDrag(this); + auto* dragHandler = new QDrag(this); dragHandler->setMimeData(mimeData); dragHandler->setPixmap(m_pixmap.scaled( 256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); @@ -115,7 +115,7 @@ void ImgUploaderBase::showPostUploadDialog() m_notification = new NotificationWidget(); m_vLayout->addWidget(m_notification); - ImageLabel* imageLabel = new ImageLabel(); + auto* imageLabel = new ImageLabel(); imageLabel->setScreenshot(m_pixmap); imageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); connect(imageLabel, diff --git a/src/tools/launcher/applauncherwidget.cpp b/src/tools/launcher/applauncherwidget.cpp index 0569ef85..0e3a472a 100644 --- a/src/tools/launcher/applauncherwidget.cpp +++ b/src/tools/launcher/applauncherwidget.cpp @@ -167,7 +167,7 @@ void AppLauncherWidget::initListWidget() continue; } - QListWidget* itemsWidget = new QListWidget(); + auto* itemsWidget = new QListWidget(); configureListView(itemsWidget); const QVector& appList = m_appsMap[cat]; @@ -234,7 +234,7 @@ void AppLauncherWidget::addAppsToListWidget( const QVector& appList) { for (const DesktopAppData& app : appList) { - QListWidgetItem* buttonItem = new QListWidgetItem(widget); + auto* buttonItem = new QListWidgetItem(widget); buttonItem->setData(Qt::DecorationRole, app.icon); buttonItem->setData(Qt::DisplayRole, app.name); buttonItem->setData(Qt::UserRole, app.exec); diff --git a/src/tools/launcher/launcheritemdelegate.cpp b/src/tools/launcher/launcheritemdelegate.cpp index 8c340755..2a0a6f24 100644 --- a/src/tools/launcher/launcheritemdelegate.cpp +++ b/src/tools/launcher/launcheritemdelegate.cpp @@ -22,7 +22,7 @@ void LauncherItemDelegate::paint(QPainter* painter, rect.x(), rect.y(), rect.width() - 1, rect.height() - 1); painter->restore(); } - QIcon icon = index.data(Qt::DecorationRole).value(); + auto icon = index.data(Qt::DecorationRole).value(); const int iconSide = static_cast(GlobalValues::buttonBaseSize() * 1.3); const int halfIcon = iconSide / 2; diff --git a/src/tools/launcher/openwithprogram.cpp b/src/tools/launcher/openwithprogram.cpp index 0e5e00df..71f4b901 100644 --- a/src/tools/launcher/openwithprogram.cpp +++ b/src/tools/launcher/openwithprogram.cpp @@ -40,7 +40,7 @@ void showOpenWithMenu(const QPixmap& capture) info.oaifInFlags = OAIF_ALLOW_REGISTRATION | OAIF_EXEC; SHOpenWithDialog(nullptr, &info); #else - auto w = new AppLauncherWidget(capture); + auto* w = new AppLauncherWidget(capture); w->show(); #endif } diff --git a/src/tools/pixelate/pixelatetool.cpp b/src/tools/pixelate/pixelatetool.cpp index e4261ec6..18f15bdd 100644 --- a/src/tools/pixelate/pixelatetool.cpp +++ b/src/tools/pixelate/pixelatetool.cpp @@ -55,10 +55,9 @@ void PixelateTool::process(QPainter& painter, const QPixmap& pixmap) // If thickness is less than 1, use old blur process if (size() <= 1) { - QGraphicsBlurEffect* blur = new QGraphicsBlurEffect; + auto* blur = new QGraphicsBlurEffect; blur->setBlurRadius(10); - QGraphicsPixmapItem* item = - new QGraphicsPixmapItem(pixmap.copy(selectionScaled)); + auto* item = new QGraphicsPixmapItem(pixmap.copy(selectionScaled)); item->setGraphicsEffect(blur); QGraphicsScene scene; diff --git a/src/tools/selection/selectiontool.cpp b/src/tools/selection/selectiontool.cpp index 7ca38e8a..4b6a8dbd 100644 --- a/src/tools/selection/selectiontool.cpp +++ b/src/tools/selection/selectiontool.cpp @@ -37,7 +37,7 @@ QString SelectionTool::description() const CaptureTool* SelectionTool::copy(QObject* parent) { - SelectionTool* tool = new SelectionTool(parent); + auto* tool = new SelectionTool(parent); copyParams(this, tool); return tool; } diff --git a/src/tools/text/textconfig.cpp b/src/tools/text/textconfig.cpp index 0e0ba76b..847a10ad 100644 --- a/src/tools/text/textconfig.cpp +++ b/src/tools/text/textconfig.cpp @@ -72,7 +72,7 @@ TextConfig::TextConfig(QWidget* parent) this, &TextConfig::fontItalicChanged); m_italicButton->setToolTip(tr("Italic")); - QHBoxLayout* modifiersLayout = new QHBoxLayout(); + auto* modifiersLayout = new QHBoxLayout(); m_leftAlignButton = new QPushButton(QIcon(iconPrefix + "leftalign.svg"), QLatin1String("")); @@ -101,7 +101,7 @@ TextConfig::TextConfig(QWidget* parent) }); m_rightAlignButton->setToolTip(tr("Right Align")); - QHBoxLayout* alignmentLayout = new QHBoxLayout(); + auto* alignmentLayout = new QHBoxLayout(); alignmentLayout->addWidget(m_leftAlignButton); alignmentLayout->addWidget(m_centerAlignButton); alignmentLayout->addWidget(m_rightAlignButton); diff --git a/src/tools/text/texttool.cpp b/src/tools/text/texttool.cpp index 5f8ca688..1ba832fa 100644 --- a/src/tools/text/texttool.cpp +++ b/src/tools/text/texttool.cpp @@ -161,7 +161,7 @@ QWidget* TextTool::configurationWidget() CaptureTool* TextTool::copy(QObject* parent) { - TextTool* tt = new TextTool(parent); + auto* tt = new TextTool(parent); if (m_confW) { connect( m_confW, &TextConfig::fontFamilyChanged, tt, &TextTool::updateFamily); diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index b170cc8c..64fe0a21 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -545,16 +545,20 @@ bool ConfigHandler::checkUnrecognizedSettings(AbstractLogger* log, bool ok = generalKeys.isEmpty() && shortcutKeys.isEmpty(); if (log != nullptr || offenders != nullptr) { for (const QString& key : generalKeys) { - if (log) + if (log) { *log << tr("Unrecognized setting: '%1'\n").arg(key); - if (offenders) + } + if (offenders) { offenders->append(key); + } } for (const QString& key : shortcutKeys) { - if (log) + if (log) { *log << tr("Unrecognized shortcut name: '%1'.\n").arg(key); - if (offenders) + } + if (offenders) { offenders->append(CONFIG_GROUP_SHORTCUTS "/" + key); + } } } return ok; @@ -629,15 +633,17 @@ bool ConfigHandler::checkSemantics(AbstractLogger* log, if (val.isValid() && !valueHandler->check(val)) { // Key does not pass the check ok = false; - if (log == nullptr && offenders == nullptr) + if (log == nullptr && offenders == nullptr) { break; + } if (log != nullptr) { *log << tr("Bad value in '%1'. Expected: %2\n") .arg(key) .arg(valueHandler->expected()); } - if (offenders != nullptr) + if (offenders != nullptr) { offenders->append(key); + } } } return ok; diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index 8f0d4d9d..d5cc0d47 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -45,7 +45,7 @@ void ScreenshotSaver::saveToClipboardMime(const QPixmap& capture, imageType.toUpper().toUtf8()); if (isLoaded) { - auto mimeData = new QMimeData(); + auto* mimeData = new QMimeData(); #ifdef USE_WAYLAND_CLIPBOARD mimeData->setImageData(formattedPixmap.toImage()); diff --git a/src/utils/valuehandler.cpp b/src/utils/valuehandler.cpp index dad43a5a..2502c6a6 100644 --- a/src/utils/valuehandler.cpp +++ b/src/utils/valuehandler.cpp @@ -317,7 +317,7 @@ void sortButtons(BList& buttons) QVariant ButtonList::process(const QVariant& val) { - QList intButtons = val.value>(); + auto intButtons = val.value>(); auto buttons = ButtonList::fromIntList(intButtons); sortButtons(buttons); return QVariant::fromValue(buttons); @@ -348,8 +348,9 @@ QList ButtonList::fromIntList(const QList& l) { QList buttons; buttons.reserve(l.size()); - for (auto const i : l) + for (auto const i : l) { buttons << static_cast(i); + } return buttons; } @@ -357,8 +358,9 @@ QList ButtonList::toIntList(const QList& l) { QList buttons; buttons.reserve(l.size()); - for (auto const i : l) + for (auto const i : l) { buttons << static_cast(i); + } return buttons; } @@ -445,7 +447,7 @@ QString UserColors::expected() QVariant UserColors::representation(const QVariant& val) { - QVector colors = val.value>(); + auto colors = val.value>(); QStringList strColors; @@ -464,20 +466,23 @@ QVariant UserColors::representation(const QVariant& val) bool SaveFileExtension::check(const QVariant& val) { - if (!val.canConvert(QVariant::String) || val.toString().isEmpty()) + if (!val.canConvert(QVariant::String) || val.toString().isEmpty()) { return false; + } QString extension = val.toString(); - if (extension.startsWith(".")) + if (extension.startsWith(".")) { extension.remove(0, 1); + } QStringList imageFormatList; foreach (auto imageFormat, QImageWriter::supportedImageFormats()) imageFormatList.append(imageFormat); - if (!imageFormatList.contains(extension)) + if (!imageFormatList.contains(extension)) { return false; + } return true; } @@ -486,8 +491,9 @@ QVariant SaveFileExtension::process(const QVariant& val) { QString extension = val.toString(); - if (extension.startsWith(".")) + if (extension.startsWith(".")) { extension.remove(0, 1); + } return QVariant::fromValue(extension); } @@ -512,8 +518,9 @@ QVariant Region::process(const QVariant& val) // FIXME: This is temporary, just before D-Bus is removed char** argv = new char*[1]; int* argc = new int{ 0 }; - if (QGuiApplication::screens().empty()) + if (QGuiApplication::screens().empty()) { new QApplication(*argc, argv); + } QString str = val.toString(); diff --git a/src/widgets/capture/buttonhandler.cpp b/src/widgets/capture/buttonhandler.cpp index 222ef38c..afd10754 100644 --- a/src/widgets/capture/buttonhandler.cpp +++ b/src/widgets/capture/buttonhandler.cpp @@ -25,8 +25,9 @@ ButtonHandler::ButtonHandler(QObject* parent) void ButtonHandler::hide() { - for (CaptureToolButton* b : m_vectorButtons) + for (CaptureToolButton* b : m_vectorButtons) { b->hide(); + } } void ButtonHandler::show() @@ -34,8 +35,9 @@ void ButtonHandler::show() if (m_vectorButtons.isEmpty() || m_vectorButtons.first()->isVisible()) { return; } - for (CaptureToolButton* b : m_vectorButtons) + for (CaptureToolButton* b : m_vectorButtons) { b->animatedShow(); + } } bool ButtonHandler::isVisible() const @@ -335,7 +337,7 @@ void ButtonHandler::moveButtonsToPoints(const QVector& points, int& index) { for (const QPoint& p : points) { - auto button = m_vectorButtons[index]; + auto* button = m_vectorButtons[index]; button->move(p); ++index; } @@ -353,11 +355,13 @@ void ButtonHandler::adjustHorizontalCenter(QPoint& center) // setButtons redefines the buttons of the button handler void ButtonHandler::setButtons(const QVector v) { - if (v.isEmpty()) + if (v.isEmpty()) { return; + } - for (CaptureToolButton* b : m_vectorButtons) + for (CaptureToolButton* b : m_vectorButtons) { delete (b); + } m_vectorButtons = v; m_buttonBaseSize = GlobalValues::buttonBaseSize(); m_buttonExtendedSize = m_buttonBaseSize + m_separator; diff --git a/src/widgets/capture/capturebutton.cpp b/src/widgets/capture/capturebutton.cpp index e1738a35..54bdccf0 100644 --- a/src/widgets/capture/capturebutton.cpp +++ b/src/widgets/capture/capturebutton.cpp @@ -32,7 +32,7 @@ void CaptureButton::init() setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); - auto dsEffect = new QGraphicsDropShadowEffect(this); + auto* dsEffect = new QGraphicsDropShadowEffect(this); dsEffect->setBlurRadius(5); dsEffect->setOffset(0); dsEffect->setColor(QColor(Qt::black)); diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 8f79ee31..8baea3ef 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -183,9 +183,10 @@ CaptureWidget::CaptureWidget(const CaptureRequest& req, initSelection(); // button handler must be initialized before initShortcuts(); // must be called after initSelection // init magnify - if (m_config.showMagnifier()) + if (m_config.showMagnifier()) { m_magnifier = new MagnifierWidget( m_context.screenshot, m_uiColor, m_config.squareMagnifier(), this); + } // Init color picker m_colorPicker = new ColorPicker(this); @@ -289,7 +290,7 @@ void CaptureWidget::initButtons() // Add all buttons but hide those that were disabled in the Interface config // This will allow keyboard shortcuts for those buttons to work for (CaptureTool::Type t : allButtonTypes) { - CaptureToolButton* b = new CaptureToolButton(t, this); + auto* b = new CaptureToolButton(t, this); if (t == CaptureTool::TYPE_SELECTIONINDICATOR) { m_sizeIndButton = b; } @@ -1600,8 +1601,9 @@ void CaptureWidget::restoreCircleCountState() if (toolItem->type() != CaptureTool::TYPE_CIRCLECOUNT) { continue; } - if (toolItem->count() > largest) + if (toolItem->count() > largest) { largest = toolItem->count(); + } } m_context.circleCount = largest + 1; } diff --git a/src/widgets/capture/magnifierwidget.cpp b/src/widgets/capture/magnifierwidget.cpp index acf38387..7a6d876d 100644 --- a/src/widgets/capture/magnifierwidget.cpp +++ b/src/widgets/capture/magnifierwidget.cpp @@ -35,10 +35,11 @@ MagnifierWidget::MagnifierWidget(const QPixmap& p, void MagnifierWidget::paintEvent(QPaintEvent*) { QPainter p(this); - if (m_square) + if (m_square) { drawMagnifier(p); - else + } else { drawMagnifierCircle(p); + } } void MagnifierWidget::drawMagnifierCircle(QPainter& painter) @@ -89,7 +90,7 @@ void MagnifierWidget::drawMagnifierCircle(QPainter& painter) painter.drawPixmapFragments( &frag, 1, m_paddedScreenshot, QPainter::OpaqueHint); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); - for (auto& rect : + for (const auto& rect : { crossHairTop, crossHairRight, crossHairBottom, crossHairLeft }) { painter.fillRect(rect, m_color); } @@ -165,7 +166,7 @@ void MagnifierWidget::drawMagnifier(QPainter& painter) painter.fillRect(crossHairBorder, m_borderColor); painter.drawPixmapFragments(&frag, 1, m_screenshot, QPainter::OpaqueHint); painter.setCompositionMode(QPainter::CompositionMode_SourceOver); - for (auto& rect : + for (const auto& rect : { crossHairTop, crossHairRight, crossHairBottom, crossHairLeft }) { painter.fillRect(rect, m_color); } diff --git a/src/widgets/capture/selectionwidget.cpp b/src/widgets/capture/selectionwidget.cpp index a3b17a6b..dba822ab 100644 --- a/src/widgets/capture/selectionwidget.cpp +++ b/src/widgets/capture/selectionwidget.cpp @@ -218,12 +218,14 @@ void SelectionWidget::parentMouseMoveEvent(QMouseEvent* e) &newTop = newTopLeft.ry(), &newBottom = newBottomRight.ry(); switch (mouseSide) { case TOPLEFT_SIDE: - if (m_activeSide) + if (m_activeSide) { newTopLeft = pos; + } break; case BOTTOMRIGHT_SIDE: - if (m_activeSide) + if (m_activeSide) { newBottomRight = pos; + } break; case TOPRIGHT_SIDE: if (m_activeSide) { @@ -238,20 +240,24 @@ void SelectionWidget::parentMouseMoveEvent(QMouseEvent* e) } break; case LEFT_SIDE: - if (m_activeSide) + if (m_activeSide) { newLeft = pos.x(); + } break; case RIGHT_SIDE: - if (m_activeSide) + if (m_activeSide) { newRight = pos.x(); + } break; case TOP_SIDE: - if (m_activeSide) + if (m_activeSide) { newTop = pos.y(); + } break; case BOTTOM_SIDE: - if (m_activeSide) + if (m_activeSide) { newBottom = pos.y(); + } break; default: if (m_activeSide) { @@ -429,10 +435,12 @@ void SelectionWidget::setGeometryByKeyboard(const QRect& r) { static QTimer timer; QRect rect = r.intersected(parentWidget()->rect()); - if (rect.width() <= 0) + if (rect.width() <= 0) { rect.setWidth(1); - if (rect.height() <= 0) + } + if (rect.height() <= 0) { rect.setHeight(1); + } setGeometry(rect); connect( &timer, diff --git a/src/widgets/colorpickerwidget.cpp b/src/widgets/colorpickerwidget.cpp index cfa71a1b..072e884c 100644 --- a/src/widgets/colorpickerwidget.cpp +++ b/src/widgets/colorpickerwidget.cpp @@ -43,7 +43,7 @@ void ColorPickerWidget::repaint(int i, QPainter& painter) { // draw the highlight when we have to draw the selected color if (i == m_selectedIndex) { - QColor c = QColor(m_uiColor); + auto c = QColor(m_uiColor); c.setAlpha(155); painter.setBrush(c); c.setAlpha(100); diff --git a/src/widgets/draggablewidgetmaker.cpp b/src/widgets/draggablewidgetmaker.cpp index bb8eeb36..cbf9c966 100644 --- a/src/widgets/draggablewidgetmaker.cpp +++ b/src/widgets/draggablewidgetmaker.cpp @@ -15,12 +15,12 @@ void DraggableWidgetMaker::makeDraggable(QWidget* widget) bool DraggableWidgetMaker::eventFilter(QObject* obj, QEvent* event) { - auto widget = static_cast(obj); + auto* widget = static_cast(obj); // based on https://stackoverflow.com/a/12221360/964478 switch (event->type()) { case QEvent::MouseButtonPress: { - auto mouseEvent = static_cast(event); + auto* mouseEvent = static_cast(event); m_isPressing = false; m_isDragging = false; @@ -31,7 +31,7 @@ bool DraggableWidgetMaker::eventFilter(QObject* obj, QEvent* event) } } break; case QEvent::MouseMove: { - auto mouseEvent = static_cast(event); + auto* mouseEvent = static_cast(event); if (m_isPressing) { QPoint widgetPos = widget->mapToGlobal(widget->pos()); diff --git a/src/widgets/notificationwidget.cpp b/src/widgets/notificationwidget.cpp index 30405d80..ee54659a 100644 --- a/src/widgets/notificationwidget.cpp +++ b/src/widgets/notificationwidget.cpp @@ -30,7 +30,7 @@ NotificationWidget::NotificationWidget(QWidget* parent) connect( m_hideAnimation, &QPropertyAnimation::finished, m_label, &QLabel::hide); - auto mainLayout = new QVBoxLayout(); + auto* mainLayout = new QVBoxLayout(); setLayout(mainLayout); mainLayout->addWidget(m_content); diff --git a/src/widgets/panel/sidepanelwidget.cpp b/src/widgets/panel/sidepanelwidget.cpp index 0474876a..3571a5c9 100644 --- a/src/widgets/panel/sidepanelwidget.cpp +++ b/src/widgets/panel/sidepanelwidget.cpp @@ -30,10 +30,10 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent) parent->installEventFilter(this); } - QGridLayout* colorLayout = new QGridLayout(); + auto* colorLayout = new QGridLayout(); // Create Active Tool Size - QLabel* activeToolSizeText = new QLabel(tr("Active tool size: ")); + auto* activeToolSizeText = new QLabel(tr("Active tool size: ")); m_toolSizeSlider = new QSlider(Qt::Horizontal); m_toolSizeSlider->setRange(1, maxToolSize); @@ -44,8 +44,8 @@ SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent) colorLayout->addWidget(m_toolSizeSlider, 1, 0); // Create Active Color - QHBoxLayout* colorHBox = new QHBoxLayout(); - QLabel* colorText = new QLabel(tr("Active Color: ")); + auto* colorHBox = new QHBoxLayout(); + auto* colorText = new QLabel(tr("Active Color: ")); m_colorLabel = new QLabel(); m_colorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); diff --git a/src/widgets/panel/utilitypanel.cpp b/src/widgets/panel/utilitypanel.cpp index df1479f9..db412474 100644 --- a/src/widgets/panel/utilitypanel.cpp +++ b/src/widgets/panel/utilitypanel.cpp @@ -116,7 +116,7 @@ void UtilityPanel::initInternalPanel() { m_internalPanel = new QScrollArea(this); m_internalPanel->setAttribute(Qt::WA_NoMousePropagation); - QWidget* widget = new QWidget(); + auto* widget = new QWidget(); m_internalPanel->setWidget(widget); m_internalPanel->setWidgetResizable(true); @@ -141,7 +141,7 @@ void UtilityPanel::initInternalPanel() this, SLOT(onCurrentRowChanged(int))); - QHBoxLayout* layersButtons = new QHBoxLayout(); + auto* layersButtons = new QHBoxLayout(); m_layersLayout->addLayout(layersButtons); m_layersLayout->addWidget(m_captureTools); @@ -186,7 +186,7 @@ void UtilityPanel::initInternalPanel() &UtilityPanel::slotDownClicked); // Bottom - QPushButton* closeButton = new QPushButton(this); + auto* closeButton = new QPushButton(this); closeButton->setText(tr("Close")); connect(closeButton, &QPushButton::clicked, this, &UtilityPanel::toggle); m_bottomLayout->addWidget(closeButton); @@ -200,7 +200,7 @@ void UtilityPanel::fillCaptureTools( m_captureTools->addItem(tr("")); for (auto toolItem : captureToolObjects) { - QListWidgetItem* item = new QListWidgetItem( + auto* item = new QListWidgetItem( toolItem->icon(QColor(Qt::white), false), toolItem->info()); m_captureTools->addItem(item); } diff --git a/src/widgets/updatenotificationwidget.cpp b/src/widgets/updatenotificationwidget.cpp index 3a7d8e73..f19481ce 100644 --- a/src/widgets/updatenotificationwidget.cpp +++ b/src/widgets/updatenotificationwidget.cpp @@ -94,7 +94,7 @@ void UpdateNotificationWidget::initInternalPanel() { m_internalPanel = new QScrollArea(this); m_internalPanel->setAttribute(Qt::WA_NoMousePropagation); - QWidget* widget = new QWidget(); + auto* widget = new QWidget(); m_internalPanel->setWidget(widget); m_internalPanel->setWidgetResizable(true); @@ -113,13 +113,13 @@ void UpdateNotificationWidget::initInternalPanel() m_layout->addWidget(m_notification); // buttons layout - QHBoxLayout* buttonsLayout = new QHBoxLayout(); - QSpacerItem* bottonsSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding); + auto* buttonsLayout = new QHBoxLayout(); + auto* bottonsSpacer = new QSpacerItem(1, 1, QSizePolicy::Expanding); buttonsLayout->addSpacerItem(bottonsSpacer); m_layout->addLayout(buttonsLayout); // ignore - QPushButton* ignoreBtn = new QPushButton(tr("Ignore"), this); + auto* ignoreBtn = new QPushButton(tr("Ignore"), this); buttonsLayout->addWidget(ignoreBtn); connect(ignoreBtn, &QPushButton::clicked, @@ -127,7 +127,7 @@ void UpdateNotificationWidget::initInternalPanel() &UpdateNotificationWidget::ignoreButton); // later - QPushButton* laterBtn = new QPushButton(tr("Later"), this); + auto* laterBtn = new QPushButton(tr("Later"), this); buttonsLayout->addWidget(laterBtn); connect(laterBtn, &QPushButton::clicked, @@ -135,7 +135,7 @@ void UpdateNotificationWidget::initInternalPanel() &UpdateNotificationWidget::laterButton); // update - QPushButton* updateBtn = new QPushButton(tr("Update"), this); + auto* updateBtn = new QPushButton(tr("Update"), this); buttonsLayout->addWidget(updateBtn); connect(updateBtn, &QPushButton::clicked,