Qt Quick controls styling
-
Anyone have any example of how to style a qt quick controls application similar to this:
http://blog.qt.digia.com/wp-content/uploads/2013/06/Screen-Shot-2013-06-21-at-2.51.45-PM3.png
http://blog.qt.digia.com/blog/2013/06/21/overview-of-the-new-features-in-qt-quick/I've tried to change the background of the toolbar by doing this:
toolBar: ToolBar {
Rectangle
{
width: parent.width
height: 40
color: "red"
}}
It works but there must be some better way of doing it right?
The margins also gets wrong and has to be adjusted./Zeiko
-
Actually you can remove the ToolBar definition as it does not add anything to the code above. Any item can be a tool bar or status bar but as you pointed out you are responsible for applying the inner margins yourself.
toolBar: Rectangle { width: parent.width height: 40 color: “red” }
-
Thanks it works good, however I'm having some difficulties styling the menubar.
I've tried
menuBar: MenuBar {
style: Rectangle {} }
with the following error: Unable to assign QQuickRectangle to Style_QMLTYPE_0
Any ideas? :)
-
No as you can imagine a MenuBar takes a lot more to style than just a rectangle and it cannot yet be styled through the public API.