Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: GUI application problems

  1. #1
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default GUI application problems

    I'm creating a beautifull Multi-page GUI application with QT 4.6.3.
    The GUI application has many pages and each one has a lot of custom widget.
    At the beginning I have only created the 3 pages normally used but when I've started (launched) the application it takes 8-9 seconds to start.
    I check the memory use it is about 60 MB (I have not finished the GUI application yet so in the future it will take more memory)
    My questions are:
    Is it normal that it takes 8-9 seconds to start/launch the application?
    Does it become faster when I launch the application directly and not from Qt Creator?
    What can I do to design and create a beautifull GUI application that take less time to start?

    If someone has an idea or tell me where I made a mistake please tell me

    Thank you

    Mek82

  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: GUI application problems

    I guess you are lunching it in debug mode. If you start it in release mode it should be faster. Or do you do heavy calculations on start up?

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

    Mek82 (10th December 2010)

  4. #3
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: GUI application problems

    Quote Originally Posted by Mek82 View Post
    Is it normal that it takes 8-9 seconds to start/launch the application?
    It depends. Not knowing your program it is either true or false. Like a Schrödinger paradox.

    For a normal, standard application, like a calculator, no this is not normal.

    Does it become faster when I launch the application directly and not from Qt Creator?
    It depends again. Do you run the application with a debugger attached inside Qt Creator?

    Try building a release version too to see if the memory footprint can be lowered.

    Otherwise, Qt Creator doesn't add a penalty to the speed of the program, at least not noticeable by a human being.

    What can I do to design and create a beautifull GUI application that take less time to start?
    Less is in reference to something. So, to answer your question, your first need to explain how you create your current application.

  5. The following user says thank you to tbscope for this useful post:

    Mek82 (10th December 2010)

  6. #4
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: GUI application problems

    also, it could be related to this thread regarding the time it takes to load.
    I don't know for the 60MB of memory usage though

    edit : see the corresponding bug report

  7. The following user says thank you to totem for this useful post:

    Mek82 (10th December 2010)

  8. #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: GUI application problems

    Quote Originally Posted by tbscope View Post
    Like a Schrödinger paradox.
    It's not a paradox, it's quantum mechanics
    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.


  9. The following user says thank you to wysota for this useful post:

    Mek82 (10th December 2010)

  10. #6
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    I try to do a multipage GUI application on a small pc board with Intel Atom N450 and 2GB of Ram.
    That PC board comunicates by RS-232 with a Microcontroller board that deals analog and digital input/output.
    The Qt GUI application when necessary comunicates with the microcontroller board by RS-232.
    The GUI application is made of one QStackedWidget, in each pages I put one object.
    The object X of class X inherit from UI::XForm, so I could create the graphic of the page inside the designer.
    Sometimes the object is a single form with custom widget (.dll) like background, pushbutton, scrolltext, ecc... ; sometimes the object is made of another QStackedWidget.
    At the beginning I only load the three mainly used pages.
    I work in realese mode, and I have the same result also with Qt 4.6.0
    Now I work in Windows Xp, but in the nearly future I have to make test with WinCe and Embedded Linux, so for me it is very important to understand why it takes so much times to load the program.

    If someone has an idea or tell me where I made a mistake please tell me

    Thank you

    Mek82

  11. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: GUI application problems

    Do you load some large (graphics) files at start up?

  12. #8
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: GUI application problems

    I had a similar problem, I tracked down the problem using the debugger - I could see the program start up quickly and as I stepped through the creation of the classes, I noticed a 5 second delay on one of the classes. That class was searching for a configuration file and every time it attempted to open the file, Windows blocked execution for 5 seconds before returning with the error code.

    For your case, I'd make use of the qDebug() statement, you may find that your program is starting quickly, but doing some time intensive work before showing the main window, which makes it look like its slow to startup.

  13. #9
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    The custom widgets... background and pushButton was made using vectorial image... so yes I load large graphics, but not so large... vectorial image is a good compromize between quality and weight of graphics... I think that I could reduce something and improving something... but the program takes 8-9 seconds to load not 2 seconds... is too much.
    I try to delete one custom object each time to understand if one of this have some bug or if one of this is the cause of the big load time.
    Now the GUI application is at the beginning so I have to understand the correct way.
    What do you thinking about using QML for GUI? and C++ for serial comunication and controls?
    I don't know QML so I want to use if there is a big advantage

  14. #10
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: GUI application problems

    Quote Originally Posted by Mek82 View Post
    I try to delete one custom object each time to understand if one of this have some bug or if one of this is the cause of the big load time.
    If I understand you right, that's a good strategy. Start with a bare application, without any controls. Then, one by one try to add some things and see what consumes the memory and time.

    and C++ for serial comunication and controls?
    There's a Qt serial communcation class. Ideal if you use a microcontroller board that uses USB/serial communcation.

    I don't know QML so I want to use if there is a big advantage
    I don't think QML is the right answer here. You're doing something inefficient at some point in the application startup. It's hard to tell without code or a demonstration.

    The problems I see from your information is that your program consumes a rather large amount of memory (60MB) That of course depends on how you measure it.
    And it takes a long time to load. That to me sounds like a classic loading bottleneck.

  15. #11
    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: GUI application problems

    There was an issue on Windows when Qt was trying to open some device (something related to multi-touch?) that caused the application to be stalled for about 10 seconds while initializing. I don't know if you're running on Windows now but if so then it might be happening to you too.
    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.


  16. #12
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    I've probably understood one part of the problem. Two custom widgets are not perfectly built and they load other files. Now I have resolved that problem and the GUI application starts in 3 seconds. It is better, but is not perfect.
    The GUI application creates three pages:
    -) Page 1 has one background picture and 6 custom push button
    -) Page 2 has one background picture and 2 custom push button
    -) Page 3 has one background picture and 2 custom push button and other custom widgets

    All the graphics is vectorial file (for example the backgroud graphics is around 100 kB - 200 kB).
    I think that every single file is not heavy but I have to load about 30 files...
    I don't know if 3 seconds is good or not good, I would like that the GUI application starts immidiatly.
    What I can do?

    If someone has an idea or tell me where I made a mistake please tell me

    Thank you

    Mek82

  17. #13
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: GUI application problems

    I think that every single file is not heavy but I have to load about 30 files...
    Are you using Qt resource system ? http://doc.qt.nokia.com/4.0/resources.html
    Or you just load every image from disk at startup ?

  18. #14
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    Before I used Resource Systeme directly in the custom widget. The .dll file were quite heavy. Now I load the file at the beginning.

  19. #15
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    I've done a lot of test. I used also Resource Systeme but the GUI application starts in 3 seconds. All the graphics to be loaded are about 1.4 MB. Is it normal that the GUI application starts in 3 seconds because it has to load 1.4MB of graphics?

    If someone has an idea or tell me where I made a mistake please tell me

    Thank you

    Mek82

  20. #16
    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: GUI application problems

    Does your GUI really load the graphics at startup? What types of graphics do you have? Is it compressed or not?
    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.


  21. #17
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    Yes the GUI loads this graphics at the startup and lose time... 3 seconds....
    Now I use the resource systeme inside each custom widget so the .dll is little more heavy but the graphics files are inside each .dll.
    I use SVG graphics... all the graphics are 1.4 MB

    Tell me what are you thinking

    Thanks

  22. #18
    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: GUI application problems

    SVG takes a bit of time to render. Considering it's text, 1.3MB must be quite a lot of things to draw. I don't know how much it should take but I doubt it will be snappy.
    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.


  23. #19
    Join Date
    Feb 2008
    Posts
    10
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: GUI application problems

    One of the things that you learn when you study performance analysis is that you can't be sure about where your program is slowing down until you actually measure it. There are a number of things that could be causing problems in this environment - and there are several good suggestions here. However, to be absolutely sure, you should find a performance analysis tool that runs on your system and measure what your program is actually doing. There may be several contributing factors that people could continue to guess about. Be sure. Measure.

  24. #20
    Join Date
    Oct 2010
    Posts
    13
    Thanks
    8
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: GUI application problems

    I've understood that the problem is the custom widget with SVG graphics... if I remove the custom widget the GUI application starts immidiatly.
    If I put more graphics in the resource system the GUI application starts after more seconds.
    In this way I've understood that the problem is in the loading of the SVG graphics.
    Are 22 different graphics each one from 10 to 150kB and the total 22 graphics are 1.4 MB.
    I don't know tool to check and monitor the performance if you could advise one I will be very happy...

    Thanks

Similar Threads

  1. Replies: 5
    Last Post: 19th March 2011, 05:09
  2. problems resizing an application
    By franco.amato in forum Newbie
    Replies: 6
    Last Post: 17th November 2010, 21:33
  3. problems to deploy qt application
    By radeberger in forum Installation and Deployment
    Replies: 8
    Last Post: 31st May 2010, 11:52
  4. problems on running an example application
    By hungr in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 21st August 2007, 13:12
  5. problems with deploying a Qt application
    By nongentesimus in forum Installation and Deployment
    Replies: 2
    Last Post: 7th June 2006, 13:45

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.