Commit 2ad7b7bf authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Fix glitch in Add TabBar

With Qt 5.9 we have to first anchor the TabBar.
Otherwise the tab buttons are not layouted properly.

Change-Id: Ia20f2f6bbe8659f3b0be36ae3b56e8ce07b2dca1
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 5784a965
......@@ -987,6 +987,12 @@ void addTabBarToStackedContainer(const SelectionContext &selectionContext)
const int maxValue = container.directSubModelNodes().count();
QmlItemNode tabBarItem(tabBarNode);
tabBarItem.anchors().setAnchor(AnchorLineLeft, containerItemNode, AnchorLineLeft);
tabBarItem.anchors().setAnchor(AnchorLineRight, containerItemNode, AnchorLineRight);
tabBarItem.anchors().setAnchor(AnchorLineBottom, containerItemNode, AnchorLineTop);
for (int i = 0; i < maxValue; ++i) {
ModelNode tabButtonNode =
view->createModelNode("QtQuick.Controls.TabButton",
......@@ -997,12 +1003,6 @@ void addTabBarToStackedContainer(const SelectionContext &selectionContext)
tabBarNode.defaultNodeListProperty().reparentHere(tabButtonNode);
}
QmlItemNode tabBarItem(tabBarNode);
tabBarItem.anchors().setAnchor(AnchorLineLeft, containerItemNode, AnchorLineLeft);
tabBarItem.anchors().setAnchor(AnchorLineRight, containerItemNode, AnchorLineRight);
tabBarItem.anchors().setAnchor(AnchorLineBottom, containerItemNode, AnchorLineTop);
const QString id = tabBarNode.validId();
container.removeProperty(indexPropertyName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment