Results 1 to 8 of 8

Thread: QGraphicsView doesn't paints child widgets

  1. #1
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QGraphicsView doesn't paints child widgets

    I have "complex" widget added to scene via QGRaphicsProxyWidget. This widget consists of two other widgets layed in layout. My problem that child widgets are not shown. According to event filter, they don't receive PaintEvent (but they receive show/hide and move events).
    Any ideas? Thanks.

  2. #2
    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: QGraphicsView doesn't paints child widgets

    Are these child widgets custom widgets?
    ==========================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.

  3. #3
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView doesn't paints child widgets

    one is custom, other is usual QSilder. None is shown.
    In fact, this proxy is child of own class which inherits QGItem and implements paint event. When widget is added on scene without any parents, everything ok

  4. #4
    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: QGraphicsView doesn't paints child widgets

    What happens if you put the two children in a normal QWidget? do they show then?
    ==========================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.

  5. #5
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView doesn't paints child widgets

    of course.
    by the way, bug still not reproduces on empty scene, with same parameters, and with my custom parent.
    i really hate to modify alien code

  6. #6
    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: QGraphicsView doesn't paints child widgets

    ha? of course? you mean it shows?
    Does you parent re implement paintEvent()?
    If so, can you post the code?
    ==========================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.

  7. #7
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView doesn't paints child widgets

    Well, in fact it seems that problem is that architecture of items is too complex (a lot of subchildren and all this hierarchy is laid on item with opengl wigdet). Some parts of this structure used alone seems working
    My parent item just draws background and being used alone it shows my proxy and my complex widget with it's children.

  8. #8
    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: QGraphicsView doesn't paints child widgets

    Well, you are providing too little information to allow helping you in any efficient way.
    Using QGLWidget is an important piece of information, which only now you mentioned in parenthesis.
    That alone could explain the problem you are talking about.
    It seems you are reluctant to explain in more detail...
    That is ok, but makes it very hard to help you.
    ==========================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. Child widgets
    By poporacer in forum Newbie
    Replies: 6
    Last Post: 12th August 2010, 03:04
  2. Replies: 5
    Last Post: 18th April 2010, 23:31
  3. [QtEmbedded] Translucent QGraphicsView with animated child widgets
    By zuck in forum Qt for Embedded and Mobile
    Replies: 13
    Last Post: 8th January 2010, 12:09
  4. QPainter paints only what is seen in QGraphicsView
    By tsd-charlie in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2010, 11:59
  5. Replies: 1
    Last Post: 3rd October 2009, 04:20

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.