Results 1 to 8 of 8

Thread: Bug in QGraphicsView? ScrollBar problems

  1. #1
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Bug in QGraphicsView? ScrollBar problems

    Good Day, Masters of QT!

    Look at the image attached below is a bug QT? The scrollbar does not have the scroll buttons, only the central bar. I am using the theme plastik, QT 4.3.4
    Attached Images Attached Images

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

    Default Re: Bug in QGraphicsView? ScrollBar problems

    I'd suspect that to be a layouting problem. Did you install a layout on the frame? Did you add the graphics view to that layout?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in QGraphicsView? ScrollBar problems

    Layou is ok.

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

    Default Re: Bug in QGraphicsView? ScrollBar problems

    Ok, can you attach a small test application which reproduces the problem?
    J-P Nurmi

  5. #5
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in QGraphicsView? ScrollBar problems

    Ok, please change include header ui_Report.h in Report.h and create the basic main.cpp.

    Thanks,

    Marcelo E. Geyer
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in QGraphicsView? ScrollBar problems

    The problem is caused when using stylesheets in QGraphicsView. I found that now

  7. #7
    Join Date
    Jan 2008
    Location
    Brasil
    Posts
    131
    Thanks
    18
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in QGraphicsView? ScrollBar problems

    Thank you, I decided the problem using setBackgroundBrush() in QGraphicsScene that gave me the same result. But this can be considered a bug?

    Thanks,

    Marcelo E. Geyer.

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

    Default Re: Bug in QGraphicsView? ScrollBar problems

    You must use selectors to avoid applying the style sheet to every child (including scroll bars). So instead of
    Qt Code:
    1. background-color: #CFCFCF;
    To copy to clipboard, switch view to plain text mode 
    use for example
    Qt Code:
    1. QGraphicsView { background-color: #CFCFCF; }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 14:15
  2. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 14:34

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.