Results 1 to 3 of 3

Thread: Hidden QPushButton on top of graphics scene (Maemo)

  1. #1
    Join Date
    Mar 2009
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Hidden QPushButton on top of graphics scene (Maemo)

    This probably belongs to maemo community but I guess it's worth a shot...

    There is a QPushButton derived button drawn on top of graphics scene. It's rendered as expected and works as expected. The problem is that when I hide the button with setVisible(false) the button is hidden but a white rectangle remains in the button position. This seems to happen only if the button is drawn on top of graphics scene. If it's drawn on main window the hiding works ok.

    I tried to set Qt::WA_TranslucentBackground attribute to button yet similar problem remains after hiding it. In this case the remaining rectangle is transparent instead of white but it's not transparent relative to scene. Instead it shows the main window that is underneath the scene (the scene is drawn on a separate dialog that is drawn on top of main window).

    See the attached screenshot for clarification. There are three buttons, one visible and two hidden. The lower image shows the situation with Qt::WA_TranslucentBackground attribute set.

    Hiding the button works fine on Windows and on Ubuntu but the problem exists on Qt 4.5.2 running on Maemo 4.1.2.
    Attached Images Attached Images

  2. #2
    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: Hidden QPushButton on top of graphics scene (Maemo)

    You may try calling QGraphicsScene::invalidate() with the geometry of your button after hiding it. Alternatively make your button embedded into the scene through QGraphicsProxyWidget.
    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.


  3. #3
    Join Date
    Mar 2009
    Posts
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Hidden QPushButton on top of graphics scene (Maemo)

    Nope, neither didn't help. However, I noticed that background is drawn badly only if the button is hidden before drawing takes place. If I show and hide the button again it is drawn correctly.

Similar Threads

  1. Replies: 6
    Last Post: 8th June 2009, 21:44
  2. graphics scene
    By dognzhe in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2009, 08:55
  3. Graphics View - Scene & Item hierarchy
    By mooreaa in forum Qt Programming
    Replies: 0
    Last Post: 29th June 2008, 23:49
  4. Buttons in Graphics Scene
    By aamer4yu in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2007, 19:24
  5. QTreeWidget and Graphics scene
    By aamer4yu in forum Qt Programming
    Replies: 7
    Last Post: 21st December 2006, 17:24

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.