Results 1 to 3 of 3

Thread: addMenu problem on Mac

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    14
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default addMenu problem on Mac

    I have a problem about menu.
    I can not see menu items when I use some words.
    What happen ?

    1.png
    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include <QMenuBar>
    4. #include <QAction>
    5.  
    6. int main(int argc, char *argv[]) {
    7. QApplication app(argc, argv);
    8.  
    9. QMainWindow *mainWindow = new QMainWindow;
    10. mainWindow->setWindowTitle("QMainWindow");
    11.  
    12. QMenu *fileMenu = new QMenu("File");
    13. fileMenu->addAction("Quit", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
    14. mainWindow->menuBar()->addMenu(fileMenu);
    15.  
    16. mainWindow->show();
    17.  
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 

    File menu is not showing when I use "Quit".
    If change to "Close" , it will show File menu.
    My SDK verson is qt-sdk-mac-opensource-2009.01
    2.png
    Qt Code:
    1. #include <QApplication>
    2. #include <QMainWindow>
    3. #include <QMenuBar>
    4. #include <QAction>
    5.  
    6. int main(int argc, char *argv[]) {
    7. QApplication app(argc, argv);
    8.  
    9. QMainWindow *mainWindow = new QMainWindow;
    10. mainWindow->setWindowTitle("QMainWindow");
    11.  
    12. QMenu *fileMenu = new QMenu("File");
    13. fileMenu->addAction("Close", &app, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
    14. mainWindow->menuBar()->addMenu(fileMenu);
    15.  
    16. mainWindow->show();
    17.  
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by yycking; 31st March 2009 at 06:46.

Similar Threads

  1. addMenu problem
    By nicolas1 in forum Qt Programming
    Replies: 4
    Last Post: 17th March 2009, 09:48
  2. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  3. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  4. problem with paint and erase in frame
    By M.A.M in forum Qt Programming
    Replies: 9
    Last Post: 4th May 2008, 20:17
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.