Results 1 to 5 of 5

Thread: GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded

    Sounds like a bug. Could you provide a minimal compilable example?
    J-P Nurmi

  2. #2
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanked 1 Time in 1 Post

    Default Re: GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded

    It can easily be demonstrated using the following code:

    Qt Code:
    1. ...
    2. QGraphicsScene* myscene = new QGraphicsScene();
    3. myscene->addText("My very very long text line 1");
    4. myscene->addText("My very very long text line 2")->setPos(QPointF(0,25));
    5. QGraphicsView* myview = new QGraphicsView(myscene);
    6. myview->show();
    7. ...
    To copy to clipboard, switch view to plain text mode 

    Now reduce the window width until the horizontal scrollbar. The entire text is reachable through the scrollbar.
    Now reduce the window height until also the vertical scrollbar appears.
    Two things can be noticed now:
    • The vertical scrollbar appears too late (as if the horizontal scrollbar was not visible).
    • The horizontal scrollbar is not adapted to make the content covered by the vertical scrollbar reachable (you can no longer scroll to the "2").


    In short: using Qt::ScrollBarAsNeeded, a scrollbar does not take into account the area covered by the other scrollbar when it is visible.

    Using Qt::ScrollBarAlwaysOn, the behavior is correct.

    [This behavior shows in Qt 4.2.0 and 4.2.1.]

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded

    Although that's not compilable, the example is clear and even I can now see the problem. I couldn't find anything relevant on the Task Tracker so I suggest you send a bug report to TT. Ship the example reproducing the problem in together with the textual bug report (just makes their life easier)..
    J-P Nurmi

  4. #4
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanked 1 Time in 1 Post

    Default Re: GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded

    I have rapported the bug to TrollTech and they have fixed it in 4.3.

Similar Threads

  1. QTreeWidget + ScrollBar
    By raphaelf in forum Qt Tools
    Replies: 12
    Last Post: 1st June 2006, 21:53
  2. how to scroll tablewidget from outside placed scrollbar
    By chemstar in forum Qt Programming
    Replies: 5
    Last Post: 1st June 2006, 15:42
  3. QTableView number of rows and scrollbar issue
    By jnk5y in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2006, 07:55

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.