Layouting: Introduce a 'bindTo' LayoutItem

... to 'export' the widget being operated on.

The 'Tab' related changes are related, as they affect the order
of execution.

Change-Id: I7aa079f12e49a1dab7c6a49acfae9dc684cfb479
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-04-25 17:21:39 +02:00
parent c192536b64
commit 1c2b29b31a
4 changed files with 72 additions and 53 deletions

View File

@@ -162,11 +162,8 @@ public:
, m_bindStarToLeftSpecifier(createCheckBox(Tr::tr("Left const/volatile")))
, m_bindStarToRightSpecifier(createCheckBox(Tr::tr("Right const/volatile"),
Tr::tr("This does not apply to references.")))
, m_categoryTab(new QTabWidget)
, m_tabSettingsWidget(new TabSettingsWidget)
{
m_categoryTab->setProperty("_q_custom_style_disabled", true);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -234,7 +231,8 @@ public:
};
Row {
TabWidget { m_categoryTab, {
TabWidget {
bindTo(&m_categoryTab),
Tab { Tr::tr("General"),
Row { Column { m_tabSettingsWidget, st }, createPreview(0) }
},
@@ -243,9 +241,11 @@ public:
Tab { Tr::tr("\"switch\""), Row { switchGroup, createPreview(3) } },
Tab { Tr::tr("Alignment"), Row { alignmentGroup, createPreview(4) } },
Tab { Tr::tr("Pointers and References"), Row { typesGroup, createPreview(5) } }
} }
}
}.attachTo(q);
m_categoryTab->setProperty("_q_custom_style_disabled", true);
m_controllers.append(m_tabSettingsWidget);
m_controllers.append(contentGroup.widget);
m_controllers.append(bracesGroup.widget);