Results 1 to 8 of 8

Thread: My Qgraphicsview widget is not resized by the vertical splitter which has control.

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default My Qgraphicsview widget is not resized by the vertical splitter which has control.

    I have a verticalsplitter with to elements. One has the Vstrech to 1 and the lower to 3.
    Initially I have a standar widget promoted to a 'my_drawer' widget. This had the paint event overloaded, nothing more. All worked fine. The verticalsplitter assigned the correct heigths'
    Ok, now this 'my_drawer' widget is qgraphicsview based. I have deleted the paintevent and write a drawbackground, nothing more.

    Ok, I dont know why is the reason because now the vertical splitter does nothing. My qgraphicswidget has 30 pixels of height.....
    Any idea ?

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

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    Please provide a minimal compilable example reproducing the problem.
    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
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    Here you are.
    The Vsplitter has 2 widgets , top widget has svtrech = 1, bottom widget has vstrecht = 3.
    The bottom widget is promoted to a agraph ( a simple widget with Qgraphicsview inheritate)
    As you can see when run, something is wrong. There is no 1/3 relation .
    You only need to denote the widget_2 and you see the splitter working fine.
    Any idea ?
    Attached Files Attached Files
    Last edited by tonnot; 6th September 2011 at 07:47.

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

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    What sense does it make to use QSplitter with relative widget sizing? If you just want initial sizes to be set, use QSplitter::setSizes(). Indeed splitters misbehave a bit when layout facilities are applied to them.
    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.


  5. #5
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    mmm
    I dont understand what you want to tell me....
    I thought that it was sufficient to set the strech values.
    I only want to have 25 and 75 % for each widget....
    Then, Is it a bug ?

    Thanks for your time.

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

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    Quote Originally Posted by tonnot View Post
    I only want to have 25 and 75 % for each widget....
    So remove the splitter and use a normal vertical layout.
    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.


  7. #7
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    Excuse me.... I also want the user can change the size if he wants.
    So, finally, as you said,
    Indeed splitters misbehave a bit when layout facilities are applied to them.
    it can be a bug ?

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

    Default Re: My Qgraphicsview widget is not resized by the vertical splitter which has contro

    So you don't want to have 25% and 75%. You want initial sizes to be that, so use QSplitter::setSizes() as advised. Yes, it's a bug if you ask me but it has been there since ever, so I guess it is either not fixable or they don't consider it a bug.
    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:

    tonnot (6th September 2011)

Similar Threads

  1. Replies: 1
    Last Post: 24th July 2011, 01:46
  2. arranging objects in splitter widget
    By bigbill in forum Newbie
    Replies: 2
    Last Post: 13th December 2010, 12:33
  3. Control over QGraphicsScene placement in QGraphicsView
    By emmanuel in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2010, 20:46
  4. widget not resized within QDockWidget
    By pospiech in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2008, 18:19
  5. Fix size widget + Splitter
    By weepdoo in forum Qt Tools
    Replies: 0
    Last Post: 20th November 2008, 08:47

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
  •  
Qt is a trademark of The Qt Company.