Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Tool bar in Qt Design Studio

Tool bar in Qt Design Studio

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
toolbar
2 Posts 2 Posters 658 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrahamLa
    wrote on 4 Jan 2019, 09:49 last edited by
    #1

    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.qml

    import 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?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      BrookCronin
      wrote on 7 Jan 2019, 09:00 last edited by BrookCronin 1 Jul 2019, 09:02
      #2

      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.

      0_1546851760213_toolbar_small.jpg

      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.

      1 Reply Last reply
      0

      2/2

      7 Jan 2019, 09:00

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved