Results 1 to 3 of 3

Thread: QWidget displaying the previous screen

  1. #1
    Join Date
    Dec 2010
    Posts
    6
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default QWidget displaying the previous screen

    Hello,

    I built an application using Qt 4.6. Designed the app such that it would create the controls required, add it to a main widget and display the widget. when i click on any button in it, the same process would continue. I have arround 20 screens like this.

    I am displaying the widget using
    setCentralWidget(mainWidget);
    This works fine in simulator. But when i test this app on a Nokia handset, after few minutes of testing i have faced a strange issue. Observed that previous screen is not getting cleared. I am able to view the previous screens in the background. Though application is not hanging, screen gets overlapped with all the screens i am navigating.

    its a simple app, with a background image, few transparent images , thumbinals and pushbuttons.

    Can any one please guide me what the problem is?

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: QWidget displaying the previous screen

    If you just create new controls and and transparent elements to the widget, I don't see how the old ones would _not_ show through...

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWidget displaying the previous screen

    when i click on any button in it, the same process would continue. I have arround 20 screens like this.
    But when i test this app on a Nokia handset, after few minutes of testing i have faced a strange issue.
    It sounds like you are just allocating many controls, never free them, and probably the system is getting low on resources, which *could* lead to some undefined behavior if the system fails to deal with the lack of resources.
    Having 20 screens sounds like a very bad UI design.
    Maybe if you explain what you want to achieve, we might help you find a better way of doing it.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Finding a QWidget from a screen XY
    By andyp in forum Qt Programming
    Replies: 5
    Last Post: 26th August 2012, 09:15
  2. Displaying a QImage on the screen
    By nuser in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2010, 20:51
  3. Displaying Text on Black and White Screen
    By Stobie in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 8th December 2009, 01:03
  4. Displaying QWidget from a function.
    By raghvendramisra in forum Qt Programming
    Replies: 2
    Last Post: 23rd January 2008, 04:02
  5. Help displaying frames from a webcam to the screen
    By stealth86 in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2007, 18:48

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.