Results 1 to 4 of 4

Thread: QScrollArea border rendering problem

  1. #1
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QScrollArea border rendering problem

    I'm rendering a border for a qscrollarea using stylesheets

    Qt Code:
    1. QScrollArea#previews { border: 4px solid red; }
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. previewScrollArea->setObjectName("previews");
    To copy to clipboard, switch view to plain text mode 

    It works well until a scrollbar appears. When I click a scrollbar arrow to scroll content, the qscrollarea border does not render near scrollbar
    2012-03-27_2131.png
    If I maximize an application window and resize it back then QScrollArea (probably) updates and border renders properly, but if I click a scrollbar arrow then I have the same problem again.

    Thanks

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QScrollArea border rendering problem

    This is because of the corner piece which is there if both scrollbars are present (border should be drawn correctly with both scrollbars visible or not).
    Not sure how to fix that though.

    Edit:
    set background of the preview scroll area to the same color as border and that will fix this specific case, but when both scroll bars are visible then you'll get red (or whatever color you set) corner piece.
    Last edited by Spitfire; 28th March 2012 at 16:52.

  3. #3
    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: QScrollArea border rendering problem

    A possible solution would be apply the border only to the viewport of the scroll area. It wouldn't contain the scrollbars then nevertheless it seems a reasonable option.
    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.


  4. #4
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QScrollArea border rendering problem

    It could be that my explanation is a bit wrong.
    I have this issue with a border not after two scrollbars appear, but after I click on the arrow of the horizontal scrollbar.
    Anyway I decided to use
    Qt Code:
    1. setFrameStyle(QFrame::StyledPanel);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 8
    Last Post: 7th November 2012, 19:20
  2. Replies: 2
    Last Post: 21st March 2012, 14:30
  3. Css - problem with border in QTextEdit
    By Trok in forum Qt Programming
    Replies: 3
    Last Post: 28th March 2009, 22:53
  4. QPrinter on QGraphicsScene Border Problem
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 15:49
  5. Rendering problem
    By boss_bhat in forum Qt Programming
    Replies: 1
    Last Post: 20th June 2006, 08:48

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.