public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] kconfig: qconf: set QSplitter orientation in the constructor
@ 2024-10-08 18:00 Masahiro Yamada
  2024-10-08 18:00 ` [PATCH 2/3] kconfig: qconf: reorder code in ConfigMainWindow() constructor Masahiro Yamada
  2024-10-08 18:00 ` [PATCH 3/3] kconfig: qconf: set parent in the widget constructor Masahiro Yamada
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-10-08 18:00 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The orientation of the QSplitter can be specified directly in its
constructor.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index e260cab1c2af..202823aad393 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1240,8 +1240,7 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow *parent)
 	layout2->addWidget(searchButton);
 	layout1->addLayout(layout2);
 
-	split = new QSplitter(this);
-	split->setOrientation(Qt::Vertical);
+	split = new QSplitter(Qt::Vertical, this);
 	list = new ConfigList(split, "search");
 	list->mode = listMode;
 	info = new ConfigInfoView(split, "search");
@@ -1344,15 +1343,13 @@ ConfigMainWindow::ConfigMainWindow(void)
 	QVBoxLayout *layout = new QVBoxLayout(widget);
 	setCentralWidget(widget);
 
-	split1 = new QSplitter(widget);
-	split1->setOrientation(Qt::Horizontal);
+	split1 = new QSplitter(Qt::Horizontal, widget);
 	split1->setChildrenCollapsible(false);
 
 	menuList = new ConfigList(widget, "menu");
 
-	split2 = new QSplitter(widget);
+	split2 = new QSplitter(Qt::Vertical, widget);
 	split2->setChildrenCollapsible(false);
-	split2->setOrientation(Qt::Vertical);
 
 	// create config tree
 	configList = new ConfigList(widget, "config");
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] kconfig: qconf: reorder code in ConfigMainWindow() constructor
  2024-10-08 18:00 [PATCH 1/3] kconfig: qconf: set QSplitter orientation in the constructor Masahiro Yamada
@ 2024-10-08 18:00 ` Masahiro Yamada
  2024-10-08 18:00 ` [PATCH 3/3] kconfig: qconf: set parent in the widget constructor Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-10-08 18:00 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

Rearrange the code to make the upcoming refactoring easier to understand.

No functional changes intended.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 202823aad393..2c80e3e1a91a 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1340,29 +1340,28 @@ ConfigMainWindow::ConfigMainWindow(void)
 	ConfigItem::menubackIcon = QIcon(QPixmap(xpm_menuback));
 
 	QWidget *widget = new QWidget(this);
-	QVBoxLayout *layout = new QVBoxLayout(widget);
 	setCentralWidget(widget);
 
-	split1 = new QSplitter(Qt::Horizontal, widget);
-	split1->setChildrenCollapsible(false);
-
-	menuList = new ConfigList(widget, "menu");
+	QVBoxLayout *layout = new QVBoxLayout(widget);
 
 	split2 = new QSplitter(Qt::Vertical, widget);
+	layout->addWidget(split2);
 	split2->setChildrenCollapsible(false);
 
-	// create config tree
+	split1 = new QSplitter(Qt::Horizontal, widget);
+	split2->addWidget(split1);
+	split1->setChildrenCollapsible(false);
+
 	configList = new ConfigList(widget, "config");
+	split1->addWidget(configList);
+
+	menuList = new ConfigList(widget, "menu");
+	split1->addWidget(menuList);
 
 	helpText = new ConfigInfoView(widget, "help");
-
-	layout->addWidget(split2);
-	split2->addWidget(split1);
-	split1->addWidget(configList);
-	split1->addWidget(menuList);
 	split2->addWidget(helpText);
-
 	setTabOrder(configList, helpText);
+
 	configList->setFocus();
 
 	backAction = new QAction(QPixmap(xpm_back), "Back", this);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] kconfig: qconf: set parent in the widget constructor
  2024-10-08 18:00 [PATCH 1/3] kconfig: qconf: set QSplitter orientation in the constructor Masahiro Yamada
  2024-10-08 18:00 ` [PATCH 2/3] kconfig: qconf: reorder code in ConfigMainWindow() constructor Masahiro Yamada
@ 2024-10-08 18:00 ` Masahiro Yamada
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-10-08 18:00 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Masahiro Yamada, linux-kernel

The ->addWidget() method re-parents the widget. The parent QWidget can
be specified directly in the constructor.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/kconfig/qconf.cc | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 2c80e3e1a91a..7bac48ac5d21 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1348,18 +1348,14 @@ ConfigMainWindow::ConfigMainWindow(void)
 	layout->addWidget(split2);
 	split2->setChildrenCollapsible(false);
 
-	split1 = new QSplitter(Qt::Horizontal, widget);
-	split2->addWidget(split1);
+	split1 = new QSplitter(Qt::Horizontal, split2);
 	split1->setChildrenCollapsible(false);
 
-	configList = new ConfigList(widget, "config");
-	split1->addWidget(configList);
+	configList = new ConfigList(split1, "config");
 
-	menuList = new ConfigList(widget, "menu");
-	split1->addWidget(menuList);
+	menuList = new ConfigList(split1, "menu");
 
-	helpText = new ConfigInfoView(widget, "help");
-	split2->addWidget(helpText);
+	helpText = new ConfigInfoView(split2, "help");
 	setTabOrder(configList, helpText);
 
 	configList->setFocus();
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-08 18:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-08 18:00 [PATCH 1/3] kconfig: qconf: set QSplitter orientation in the constructor Masahiro Yamada
2024-10-08 18:00 ` [PATCH 2/3] kconfig: qconf: reorder code in ConfigMainWindow() constructor Masahiro Yamada
2024-10-08 18:00 ` [PATCH 3/3] kconfig: qconf: set parent in the widget constructor Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox