Results 1 to 3 of 3

Thread: Qt QML MenuBar and Menus not showing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Location
    Krakow, Poland
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt QML MenuBar and Menus not showing

    Try like this:
    Qt Code:
    1. import QtQuick 2.1
    2. import QtQuick.Controls 1.0
    3. import QtQuick.Window 2.0
    4.  
    5. ApplicationWindow {
    6. title: qsTr("Hello World")
    7. width: 640
    8. height: 480
    9.  
    10. menuBar: MenuBar {
    11. Menu {
    12. title: qsTr("File")
    13. MenuItem {
    14. text: qsTr("Exit")
    15. onTriggered: Qt.quit();
    16. }
    17. }
    18. }
    19.  
    20. Button {
    21. text: qsTr("Hello World")
    22. anchors.horizontalCenter: parent.horizontalCenter
    23. anchors.verticalCenter: parent.verticalCenter
    24. }
    25. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt QML MenuBar and Menus not showing

    Thank You.It worked very well.

Similar Threads

  1. Customize the menubar and menus
    By tonnot in forum Newbie
    Replies: 4
    Last Post: 16th February 2011, 14:09
  2. Context Menus
    By rodlbr in forum Qt Programming
    Replies: 4
    Last Post: 7th September 2009, 16:30
  3. Accessible menus
    By NickPoole in forum Qt Programming
    Replies: 3
    Last Post: 17th August 2009, 09:30
  4. Showing and hiding menubar
    By borges in forum Newbie
    Replies: 1
    Last Post: 23rd September 2007, 10:56
  5. Showing QMainWindow without showing a child QWidget
    By discostu in forum Qt Programming
    Replies: 3
    Last Post: 4th March 2007, 09:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.