Results 1 to 3 of 3

Thread: Menu Problem

  1. #1
    Join Date
    May 2011
    Posts
    21
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Menu Problem

    hello friends

    Actually i am not able to contruct a menu in my App..the code i have written is like that…


    Qt Code:
    1. #include "menumainwindow.h"
    2.  
    3. menumainwindow::menumainwindow(QWidget *parent)
    4. : QMainWindow(parent)
    5. {
    6.  
    7.  
    8. showAct = new QAction(("&Show"), this);
    9. connect(showAct, SIGNAL(triggered()),label1, SLOT(show()));
    10. hideAct = new QAction(("&Hide"), this);
    11. connect(hideAct, SIGNAL(triggered()),label1, SLOT(hide()));
    12. exitAct = new QAction(("&Exit"), this);
    13. connect(exitAct, SIGNAL(triggered()),qApp, SLOT(quit()));
    14. bar = menuBar()->addMenu("&File");
    15. bar->addAction(showAct);
    16. bar->addAction(hideAct);
    17. bar->addSeparator();
    18. bar->addAction(exitAct);
    19. setCentralWidget(bar);
    20.  
    21. }
    To copy to clipboard, switch view to plain text mode 
    here it will display show,hide,exit menu but i want it to show when i click the “file”..so anything wrong in the code..please suggest
    regards
    Rahul
    Last edited by high_flyer; 26th May 2011 at 15:10. Reason: code tags

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Menu Problem

    Qt Code:
    1. setCentralWidget(bar);//?
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    May 2011
    Posts
    21
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60

    Default Re: Menu Problem

    otherwise it not visible in simulator..and in desktop app it works i know..but i want to know how it works for mobile devices

Similar Threads

  1. Window menu problem, C# & Qt
    By linuxoid in forum Newbie
    Replies: 5
    Last Post: 29th April 2016, 22:03
  2. problem with Context Menu in QTableWidget
    By andreime in forum Newbie
    Replies: 6
    Last Post: 7th September 2015, 08:44
  3. menu problem
    By addu in forum Qt Programming
    Replies: 9
    Last Post: 9th May 2009, 17:00
  4. context menu problem
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2008, 13:18
  5. Menu problem using Designer
    By JimBrown in forum Qt Tools
    Replies: 1
    Last Post: 19th February 2007, 21:47

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.