summaryrefslogtreecommitdiff
path: root/ui/qt5/pkgsimple.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-07-04 19:29:56 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2022-07-04 19:29:56 -0500
commit02e8b7d320d1c954ec93f784b6a3197a9a6fee2d (patch)
tree731f7d580fbf841f097cbc32f4edc3029274aaee /ui/qt5/pkgsimple.cc
parent526acc1b2d98523d247d772781c85140d5a29b63 (diff)
downloadhorizon-02e8b7d320d1c954ec93f784b6a3197a9a6fee2d.tar.gz
horizon-02e8b7d320d1c954ec93f784b6a3197a9a6fee2d.tar.bz2
horizon-02e8b7d320d1c954ec93f784b6a3197a9a6fee2d.tar.xz
horizon-02e8b7d320d1c954ec93f784b6a3197a9a6fee2d.zip
Qt UI: Port to using heavier buttonClicked signal
Once again, Qt has taken our simple API away and left us only with the more complex one. At least this one isn't too hard to work around. Move to using QOverload instead of static_cast for all of them as well.
Diffstat (limited to 'ui/qt5/pkgsimple.cc')
-rw-r--r--ui/qt5/pkgsimple.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt5/pkgsimple.cc b/ui/qt5/pkgsimple.cc
index b784bc6..2cd61b9 100644
--- a/ui/qt5/pkgsimple.cc
+++ b/ui/qt5/pkgsimple.cc
@@ -3,7 +3,7 @@
* horizon-qt5, the Qt 5 user interface for
* Project Horizon
*
- * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved.
+ * Copyright (c) 2019-2022 Adélie Linux and contributors. All rights reserved.
* This code is licensed under the AGPL 3.0 license, as noted in the
* LICENSE-code file in the root directory of this repository.
*
@@ -76,9 +76,9 @@ PkgSimplePage::PkgSimplePage(QWidget *parent) : HorizonWizardPage(parent) {
group->addButton(compactButton, HorizonWizard::Compact);
group->addButton(textButton, HorizonWizard::TextOnly);
group->addButton(customButton, HorizonWizard::Custom);
- connect(group, static_cast<void (QButtonGroup:: *)(int)>(&QButtonGroup::buttonClicked),
- [=](int id) {
- horizonWizard()->pkgtype = static_cast<HorizonWizard::PackageType>(id);
+ connect(group, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked),
+ [=](QAbstractButton *choice) {
+ horizonWizard()->pkgtype = static_cast<HorizonWizard::PackageType>(group->id(choice));
});
QGridLayout *buttonLayout = new QGridLayout;