Tool bar in Qt Design Studio
Unsolved
QML and Qt Quick
-
Hi
I am evaluating the latest Qt Design Studio and wanted to add a tool bar to my newly created project
When the project is first created Design Studio creates 2 files
Test.qmlimport QtQuick 2.10 import Test 1.0 Item { width: Constants.width height: Constants.height Screen01 { } }
and Screen0.ui.qml
import QtQuick 2.10 import Test 1.0 Rectangle { width: Constants.width height: Constants.height color: Constants.backgroundColor Text { text: qsTr("Hello Test") anchors.centerIn: parent font: Constants.font } }
When I try to add a toolbar I did this
import QtQuick 2.10 import Test 1.0 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 Item { width: Constants.width height: Constants.height ToolBar { RowLayout { anchors.fill: parent ToolButton { text: "xx" } } } Screen01 { } }
The code compiles and executes but when it runs the tool bar is not displayed
What am I missing?
-
So i'm not entirely sure what you are trying to do, however i can confirm that Toolbar itself works.
I used the code you provided here, just removed the instance of Screen01 so i could test the Toolbar item by itself, as you can see it loads in the live preview fine.
You can also check the Application Output (seen here at the bottom of the screen) to look for any errors in your file.
Best,
Brook.