Results 1 to 8 of 8

Thread: ScrollBar position for QScrollArea

  1. #1
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default ScrollBar position for QScrollArea

    Can somebody tell me how to move scroll bars for the QScrollArea? I want vertical scroll bar to be attached to the left, not right.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: ScrollBar position for QScrollArea


  3. #3
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ScrollBar position for QScrollArea

    Scroll area layout managed internally, looks like I need to read sources to understand how to replace default behavior. Just want to know if anybody did the same.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: ScrollBar position for QScrollArea

    Quote Originally Posted by Dendy View Post
    Scroll area layout managed internally, looks like I need to read sources to understand how to replace default behavior. Just want to know if anybody did the same.
    Ah, I have misunderstood your first post. Isn't the position of the scroolbars changed if you set the layout direction from right to left? Nor sure...

  5. #5
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ScrollBar position for QScrollArea

    This could be a trick, will try now and tell is it works.

  6. #6
    Join Date
    Jan 2006
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: ScrollBar position for QScrollArea

    Unfortunately, Qt says: "Children added after the call to setLayoutDirection() will not inherit the parent's layout direction." This means we can do nothing with QAbstractScrollArea after instance has been created. Will read source more to understand better.

  7. #7
    Join Date
    Mar 2011
    Posts
    4
    Qt products
    Qt4

    Default Re: ScrollBar position for QScrollArea

    Did anyone solve this problem?

  8. #8
    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: ScrollBar position for QScrollArea

    Reimplement resizeEvent() for the scroll area and position the scrollbars manually. Also use QAbstractScrollArea::setViewportMargins() to set the margin on the left side instead of the right size of the viewport.
    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.


Similar Threads

  1. Problem with the scrollbar
    By mani_cbz in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 14th July 2009, 09:24
  2. Replies: 2
    Last Post: 12th June 2009, 10:55
  3. GraphicsView/GraphicsScene: scrollbar policy Qt::ScrollBarAsNeeded
    By Pieter from Belgium in forum Qt Programming
    Replies: 4
    Last Post: 21st March 2007, 13:15
  4. about scrollbar style
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 13: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.