Results 1 to 2 of 2

Thread: Menu Bar disappears when the app is restarted

  1. #1
    Join Date
    Feb 2014
    Posts
    94
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Menu Bar disappears when the app is restarted

    Hello all!

    I have an app with a menu bar and a restart process.

    When the app is restarted by the process the menu bar disappears.

    I am using OSX 10.9

    main.cpp
    Qt Code:
    1. #include "mainwindow.h"
    2. #include <QApplication>
    3.  
    4. #define CODIGO_RESTART 1000
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. int codigoSaida = 0;
    9.  
    10. do{
    11. QApplication a(argc, argv);
    12. MainWindow w;
    13. w.show();
    14.  
    15. codigoSaida = a.exec();
    16.  
    17. }while(codigoSaida == CODIGO_RESTART);
    18.  
    19. return codigoSaida;
    20. }
    To copy to clipboard, switch view to plain text mode 

    restart process
    Qt Code:
    1. void MainWindow::reiniciar()
    2. {
    3. qApp->exit(1000);
    4. }
    To copy to clipboard, switch view to plain text mode 

    When I call reiniciar function, the app restarts but the menu bar do not appears
    Last edited by guidupas; 1st September 2014 at 23:15.

  2. #2
    Join Date
    Feb 2014
    Posts
    94
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Menu Bar disappears when the app is restarted

    SOLVED

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. int codigoSaida = 0;
    4.  
    5. QApplication a(argc, argv);
    6.  
    7. do{
    8. a.exit();
    9.  
    10. MainWindow w;
    11. w.show();
    12.  
    13. codigoSaida = a.exec();
    14.  
    15. }while(codigoSaida == CODIGO_RESTART);
    16.  
    17. return codigoSaida;
    18. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. drawPixmap - image disappears
    By gab74 in forum Qt Programming
    Replies: 3
    Last Post: 11th March 2013, 06:13
  2. Replies: 11
    Last Post: 18th September 2012, 10:15
  3. Bug disappears when debugging
    By Yes in forum Qt Programming
    Replies: 9
    Last Post: 8th May 2012, 23:53
  4. Date disappears in tableview
    By rdjenner in forum Qt Programming
    Replies: 3
    Last Post: 18th July 2011, 23:55
  5. Qt Creator sidebar disappears
    By szisziszilvi in forum Qt Tools
    Replies: 3
    Last Post: 9th January 2011, 19:23

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.