* [PATCH 0/1] kconfig: port qconf to work with Qt6 in addition to Qt5 @ 2023-07-24 7:46 Boris Kolpackov 2023-07-24 7:46 ` [PATCH 1/1] " Boris Kolpackov 0 siblings, 1 reply; 5+ messages in thread From: Boris Kolpackov @ 2023-07-24 7:46 UTC (permalink / raw) To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel, Boris Kolpackov This patch ports qconf to work with Qt6 in addition to latest Qt5. Tested with Qt5 5.15 and Qt6 6.4. Note that earlier versions of Qt5 are no longer guaranteed to work. Signed-off-by: Boris Kolpackov <boris@codesynthesis.com> Boris Kolpackov (1): kconfig: port qconf to work with Qt6 in addition to Qt5 scripts/kconfig/qconf.cc | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) -- 2.40.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/1] kconfig: port qconf to work with Qt6 in addition to Qt5 2023-07-24 7:46 [PATCH 0/1] kconfig: port qconf to work with Qt6 in addition to Qt5 Boris Kolpackov @ 2023-07-24 7:46 ` Boris Kolpackov 2023-07-25 3:10 ` Randy Dunlap 0 siblings, 1 reply; 5+ messages in thread From: Boris Kolpackov @ 2023-07-24 7:46 UTC (permalink / raw) To: Masahiro Yamada, linux-kbuild; +Cc: linux-kernel, Boris Kolpackov Tested with Qt5 5.15 and Qt6 6.4. Note that earlier versions of Qt5 are no longer guaranteed to work. Signed-off-by: Boris Kolpackov <boris@codesynthesis.com> --- scripts/kconfig/qconf.cc | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc index 78087b2..3a4d7a1 100644 --- a/scripts/kconfig/qconf.cc +++ b/scripts/kconfig/qconf.cc @@ -5,10 +5,11 @@ */ #include <QAction> +#include <QActionGroup> #include <QApplication> #include <QCloseEvent> #include <QDebug> -#include <QDesktopWidget> +#include <QScreen> #include <QFileDialog> #include <QLabel> #include <QLayout> @@ -17,6 +18,7 @@ #include <QMenuBar> #include <QMessageBox> #include <QToolBar> +#include <QRegularExpression> #include <stdlib.h> @@ -1126,7 +1128,7 @@ QString ConfigInfoView::debug_info(struct symbol *sym) QString ConfigInfoView::print_filter(const QString &str) { - QRegExp re("[<>&\"\\n]"); + QRegularExpression re("[<>&\"\\n]"); QString res = str; for (int i = 0; (i = res.indexOf(re, i)) >= 0;) { switch (res[i].toLatin1()) { @@ -1322,15 +1324,15 @@ ConfigMainWindow::ConfigMainWindow(void) int width, height; char title[256]; - QDesktopWidget *d = configApp->desktop(); snprintf(title, sizeof(title), "%s%s", rootmenu.prompt->text, "" ); setWindowTitle(title); - width = configSettings->value("/window width", d->width() - 64).toInt(); - height = configSettings->value("/window height", d->height() - 64).toInt(); + QRect g = configApp->primaryScreen()->geometry(); + width = configSettings->value("/window width", g.width() - 64).toInt(); + height = configSettings->value("/window height", g.height() - 64).toInt(); resize(width, height); x = configSettings->value("/window x"); y = configSettings->value("/window y"); @@ -1379,17 +1381,17 @@ ConfigMainWindow::ConfigMainWindow(void) this, &ConfigMainWindow::goBack); QAction *quitAction = new QAction("&Quit", this); - quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); + quitAction->setShortcut(Qt::CTRL | Qt::Key_Q); connect(quitAction, &QAction::triggered, this, &ConfigMainWindow::close); QAction *loadAction = new QAction(QPixmap(xpm_load), "&Load", this); - loadAction->setShortcut(Qt::CTRL + Qt::Key_L); + loadAction->setShortcut(Qt::CTRL | Qt::Key_L); connect(loadAction, &QAction::triggered, this, &ConfigMainWindow::loadConfig); saveAction = new QAction(QPixmap(xpm_save), "&Save", this); - saveAction->setShortcut(Qt::CTRL + Qt::Key_S); + saveAction->setShortcut(Qt::CTRL | Qt::Key_S); connect(saveAction, &QAction::triggered, this, &ConfigMainWindow::saveConfig); @@ -1403,7 +1405,7 @@ ConfigMainWindow::ConfigMainWindow(void) connect(saveAsAction, &QAction::triggered, this, &ConfigMainWindow::saveConfigAs); QAction *searchAction = new QAction("&Find", this); - searchAction->setShortcut(Qt::CTRL + Qt::Key_F); + searchAction->setShortcut(Qt::CTRL | Qt::Key_F); connect(searchAction, &QAction::triggered, this, &ConfigMainWindow::searchConfig); singleViewAction = new QAction(QPixmap(xpm_single_view), "Single View", this); @@ -1750,11 +1752,21 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) e->accept(); return; } - QMessageBox mb("qconf", "Save configuration?", QMessageBox::Warning, - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape); - mb.setButtonText(QMessageBox::Yes, "&Save Changes"); - mb.setButtonText(QMessageBox::No, "&Discard Changes"); - mb.setButtonText(QMessageBox::Cancel, "Cancel Exit"); + + QMessageBox mb(QMessageBox::Icon::Warning, "qconf", + "Save configuration?"); + + QPushButton *yb = mb.addButton(QMessageBox::Yes); + QPushButton *db = mb.addButton(QMessageBox::No); + QPushButton *cb = mb.addButton(QMessageBox::Cancel); + + yb->setText("&Save Changes"); + db->setText("&Discard Changes"); + cb->setText("Cancel Exit"); + + mb.setDefaultButton(yb); + mb.setEscapeButton(cb); + switch (mb.exec()) { case QMessageBox::Yes: if (saveConfig()) -- 2.40.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kconfig: port qconf to work with Qt6 in addition to Qt5 2023-07-24 7:46 ` [PATCH 1/1] " Boris Kolpackov @ 2023-07-25 3:10 ` Randy Dunlap 2023-07-25 13:58 ` Boris Kolpackov 0 siblings, 1 reply; 5+ messages in thread From: Randy Dunlap @ 2023-07-25 3:10 UTC (permalink / raw) To: Boris Kolpackov, Masahiro Yamada, linux-kbuild; +Cc: linux-kernel On 7/24/23 00:46, Boris Kolpackov wrote: > Tested with Qt5 5.15 and Qt6 6.4. Note that earlier versions of Qt5 > are no longer guaranteed to work. Was there such a guarantee somewhere? > > Signed-off-by: Boris Kolpackov <boris@codesynthesis.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> > --- > scripts/kconfig/qconf.cc | 40 ++++++++++++++++++++++++++-------------- > 1 file changed, 26 insertions(+), 14 deletions(-) Thanks. -- ~Randy ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kconfig: port qconf to work with Qt6 in addition to Qt5 2023-07-25 3:10 ` Randy Dunlap @ 2023-07-25 13:58 ` Boris Kolpackov 2023-07-29 9:54 ` Masahiro Yamada 0 siblings, 1 reply; 5+ messages in thread From: Boris Kolpackov @ 2023-07-25 13:58 UTC (permalink / raw) To: Randy Dunlap; +Cc: Masahiro Yamada, linux-kbuild, linux-kernel Randy Dunlap <rdunlap@infradead.org> writes: > On 7/24/23 00:46, Boris Kolpackov wrote: > > > Tested with Qt5 5.15 and Qt6 6.4. Note that earlier versions of Qt5 > > are no longer guaranteed to work. > > Was there such a guarantee somewhere? I don't believe there was anything explicit, but seeing that the qconf source code hardly changed in the past couple of years, it could have worked with earlier versions of Qt5 and some people could have relied on that. > Acked-by: Randy Dunlap <rdunlap@infradead.org> > Tested-by: Randy Dunlap <rdunlap@infradead.org> Thanks! ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] kconfig: port qconf to work with Qt6 in addition to Qt5 2023-07-25 13:58 ` Boris Kolpackov @ 2023-07-29 9:54 ` Masahiro Yamada 0 siblings, 0 replies; 5+ messages in thread From: Masahiro Yamada @ 2023-07-29 9:54 UTC (permalink / raw) To: Boris Kolpackov; +Cc: Randy Dunlap, linux-kbuild, linux-kernel On Tue, Jul 25, 2023 at 10:58 PM Boris Kolpackov <boris@codesynthesis.com> wrote: > > Randy Dunlap <rdunlap@infradead.org> writes: > > > On 7/24/23 00:46, Boris Kolpackov wrote: > > > > > Tested with Qt5 5.15 and Qt6 6.4. Note that earlier versions of Qt5 > > > are no longer guaranteed to work. This patch did not change scripts/kconfig/qconf-cfg.sh at all. Hence, Qt5 is always linked. Please change scripts/kconfig/qconf-cfg.sh so that: 1. If Qt6 is installed, please link Qt6. 2. If Qt6 is not installed but Qt5 is installed, please link Qt5 > > > > Was there such a guarantee somewhere? > > I don't believe there was anything explicit, but seeing that the > qconf source code hardly changed in the past couple of years, it > could have worked with earlier versions of Qt5 and some people > could have relied on that. > > > > Acked-by: Randy Dunlap <rdunlap@infradead.org> > > Tested-by: Randy Dunlap <rdunlap@infradead.org> > > Thanks! A request to reviewers/testers: Please make sure you tested this with both Qt5 and Qt6. To check the Qt version you are running: 1. 'make xconfig' 2. See Help -> About -- Best Regards Masahiro Yamada ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-29 9:55 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-07-24 7:46 [PATCH 0/1] kconfig: port qconf to work with Qt6 in addition to Qt5 Boris Kolpackov 2023-07-24 7:46 ` [PATCH 1/1] " Boris Kolpackov 2023-07-25 3:10 ` Randy Dunlap 2023-07-25 13:58 ` Boris Kolpackov 2023-07-29 9:54 ` Masahiro Yamada
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).