From 9f479b8f76238a03bce5d13aee14efd34e659c6e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 30 Oct 2022 20:34:23 +0100 Subject: Clean up and modernize code - static "new-style" signal->slot connections - Fix a lot of things Clang-Tidy complained about - Move includes to .cpp files and use forward decls in .h - Don't use and , but specific includes instead --- src/server/helpwindow/helpwindow.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server/helpwindow') diff --git a/src/server/helpwindow/helpwindow.cpp b/src/server/helpwindow/helpwindow.cpp index 152cf0d..f6f1f10 100644 --- a/src/server/helpwindow/helpwindow.cpp +++ b/src/server/helpwindow/helpwindow.cpp @@ -22,7 +22,7 @@ HelpWindow::HelpWindow(const QList &actions, QWidget *parent) : break; } } - QGridLayout *layout = new QGridLayout(this); + auto *layout = new QGridLayout(this); layout->setSpacing(2); QSizePolicy sizePol(QSizePolicy::Minimum, QSizePolicy::Preferred); QList wrapLabels; @@ -31,24 +31,24 @@ HelpWindow::HelpWindow(const QList &actions, QWidget *parent) : for (QAction *action : actions) { if (action->icon().isNull() || action->text().isEmpty()) continue; - QLabel *icon = new QLabel(this); + auto *icon = new QLabel(this); icon->setPixmap(action->icon().pixmap(iconSize, iconSize, QIcon::Normal, QIcon::Off)); icon->setMinimumSize(iconSize + 5, iconSize + 2); layout->addWidget(icon, row, 0, 3, 1, Qt::AlignTop | Qt::AlignLeft); - QLabel *headline = new QLabel(action->toolTip(), this); + auto *headline = new QLabel(action->toolTip(), this); QFont boldFont = headline->font(); boldFont.setBold(true); headline->setFont(boldFont); headline->setAlignment(Qt::AlignTop | Qt::AlignLeft); layout->addWidget(headline, row, 1, Qt::AlignTop); - QLabel *description = new QLabel(action->text(), this); + auto *description = new QLabel(action->text(), this); description->setWordWrap(true); description->setAlignment(Qt::AlignTop | Qt::AlignLeft); description->setSizePolicy(sizePol); wrapLabels.append(description); layout->addWidget(description, row + 1, 1, Qt::AlignTop); layout->setRowStretch(row + 2, 1); - QFrame *line = new QFrame(); + auto *line = new QFrame(); line->setFrameShape(QFrame::HLine); line->setFrameShadow(QFrame::Sunken); layout->addWidget(line, row + 3, 0, 1, 2); @@ -57,12 +57,12 @@ HelpWindow::HelpWindow(const QList &actions, QWidget *parent) : layout->setColumnStretch(1, 1); // Add close button layout->setRowStretch(row++, 1000); - QPushButton *close = new QPushButton(tr("Close"), this); + auto *close = new QPushButton(tr("Close"), this); QFont bigFont = close->font(); bigFont.setPointSize(20); close->setFont(bigFont); close->setDefault(true); - connect(close, SIGNAL(clicked()), this, SLOT(hide())); + connect(close, &QPushButton::clicked, this, &HelpWindow::hide); layout->addWidget(close, row++, 0, 1, 2); this->setFixedWidth(600); this->setSizePolicy(sizePol); -- cgit v1.2.3-55-g7522