Results 1 to 5 of 5

Thread: Application running but doesn't show up!!!

  1. #1
    Join Date
    Mar 2010
    Location
    Valencia (Spain)
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Application running but doesn't show up!!!

    Hi
    I finally managed to compile and link my first GUI application in Qt (which is almost a miracle ), but it doesn't show up. My application is just an OpenGl render context (like the one in the hellogl example) with the menu bar. It's quite strange because I open the task manager and the process is running.

    Any idea?

    THANK YOU
    The day will dawn of sanity.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Application running but doesn't show up!!!

    did you call show() or exec()? please provide some code because without it is hard to help. How does your main function look like?

  3. The following user says thank you to Lykurg for this useful post:

    joandelason (20th March 2010)

  4. #3
    Join Date
    Mar 2010
    Location
    Valencia (Spain)
    Posts
    7
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application running but doesn't show up!!!

    This is the main function. I run my app on a Mac and it works (although when closing it it crashes). But on Windows it does'n show up.

    Qt Code:
    1. #include <QApplication>
    2. #include <QDesktopWidget>
    3.  
    4. #include "SDIWindow.h"
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication app(argc, argv);
    9. SdiWindow window;
    10. window.resize(window.sizeHint());
    11.  
    12. window.showMaximized();
    13. return app.exec();
    14. }
    To copy to clipboard, switch view to plain text mode 


    The code is copy-pasted from the hellogl example with a small change done to make the render context occupy the whole window.

    Here is the code of the hellogl main function.

    Qt Code:
    1. #include <QApplication>
    2. #include <QDesktopWidget>
    3.  
    4. #include "window.h"
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. QApplication app(argc, argv);
    9. Window window;
    10. window.resize(window.sizeHint());
    11. int desktopArea = QApplication::desktop()->width() *
    12. QApplication::desktop()->height();
    13. int widgetArea = window.width() * window.height();
    14. if (((float)widgetArea / (float)desktopArea) < 0.75f)
    15. window.show();
    16. else
    17. window.showMaximized();
    18. return app.exec();
    19. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 21st March 2010 at 09:36.
    The day will dawn of sanity.

  5. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Application running but doesn't show up!!!

    I can't see any error. Try to debug your application. See where it crashes on mac and use breakpoints to see where it might "hang up" on windows.

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Application running but doesn't show up!!!

    Could you paste the code for the window class if it is not too complicated?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. running qt application on MAC
    By aj2903 in forum Qt Programming
    Replies: 1
    Last Post: 8th March 2010, 01:23
  2. running first application on s60
    By addu in forum Qt for Embedded and Mobile
    Replies: 14
    Last Post: 20th August 2009, 11:30
  3. Knowing if application is running
    By mourad in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2008, 10:47
  4. Running the application
    By Afflicted.d2 in forum Installation and Deployment
    Replies: 9
    Last Post: 21st October 2006, 22:04
  5. Running application on Mac OS X
    By munna in forum General Discussion
    Replies: 1
    Last Post: 19th April 2006, 20:10

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.