summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-06-24 12:36:50 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2023-06-28 01:32:10 +0200
commit9e87c3e958a6cdd73ce22127dbc3b8aec217582f (patch)
treeb99b392ce4795030c36b288b6a2c7fb9b25ef2df /src/widgets/dialogs
parentdf735d794fd2e545c18b9e345e833422bcd64329 (diff)
QtWidgets: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I4e518dd4a9733cc0a42b02639cce9c6136ad5afc Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index a3b6fe935d..93da30aef1 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -1755,7 +1755,7 @@ void QColorDialogPrivate::initWidgets()
q->connect(custom, SIGNAL(selected(int,int)), SLOT(_q_newCustom(int,int)));
q->connect(custom, SIGNAL(currentChanged(int,int)), SLOT(_q_nextCustom(int,int)));
- q->connect(custom, &QWellArray::colorChanged, [this] (int index, QRgb color) {
+ q->connect(custom, &QWellArray::colorChanged, q, [this] (int index, QRgb color) {
QColorDialogOptions::setCustomColor(index, color);
if (custom)
custom->update();
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index a4b797e5a9..a07cc33711 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -2325,7 +2325,7 @@ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::funct
fileOpenCompleted(fileName, fileContent);
};
- connect(dialog, &QFileDialog::fileSelected, fileSelected);
+ connect(dialog, &QFileDialog::fileSelected, dialog, fileSelected);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
#endif
@@ -2365,7 +2365,7 @@ void QFileDialog::saveFileContent(const QByteArray &fileContent, const QString &
}
};
- connect(dialog, &QFileDialog::fileSelected, fileSelected);
+ connect(dialog, &QFileDialog::fileSelected, dialog, fileSelected);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
#endif