QmlDesigner: Add toolbar back to ConnectionView

Setting the fusion style only on the stack widget to keep the toolbar style.

Change-Id: I33b8256f894fa417a8729b8cdebb19a3128f1fde
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2020-03-09 19:09:13 +01:00
parent 97112f3e4d
commit 4ce49bbfde
2 changed files with 14 additions and 5 deletions

View File

@@ -85,7 +85,7 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
QStyle *style = QStyleFactory::create("fusion"); QStyle *style = QStyleFactory::create("fusion");
setStyle(style); ui->stackedWidget->setStyle(style);
//ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); //ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
@@ -96,6 +96,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->tabBar->addTab(tr("Bindings", "Title of connection view")); ui->tabBar->addTab(tr("Bindings", "Title of connection view"));
ui->tabBar->addTab(tr("Properties", "Title of dynamic properties view")); ui->tabBar->addTab(tr("Properties", "Title of dynamic properties view"));
const QList<QToolButton*> buttons = createToolBarWidgets();
for (auto toolButton : buttons)
ui->toolBar->addWidget(toolButton);
auto settings = QmlDesignerPlugin::instance()->settings(); auto settings = QmlDesignerPlugin::instance()->settings();
if (!settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool()) if (!settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool())

View File

@@ -29,6 +29,9 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0">
<widget class="QTabBar" name="tabBar" native="true"/>
</item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QWidget" name="widgetSpacer" native="true"> <widget class="QWidget" name="widgetSpacer" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
@@ -51,10 +54,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="3" column="0">
<widget class="QTabBar" name="tabBar" native="true"/>
</item>
<item row="2" column="0">
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>3</number> <number>3</number>
@@ -255,10 +255,14 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="2" column="0">
<widget class="QToolBar" name="toolBar" native="true"/>
</item>
</layout> </layout>
<zorder>stackedWidget</zorder> <zorder>stackedWidget</zorder>
<zorder>tabBar</zorder> <zorder>tabBar</zorder>
<zorder>widgetSpacer</zorder> <zorder>widgetSpacer</zorder>
<zorder>toolBar</zorder>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>