Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to move scroll bar in scroll area - HELP!

Unable to move scroll bar in scroll area - HELP!

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 469 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gmahan
    wrote on last edited by
    #1

    Hi,

    I am trying to use a custom scroll bar in the QScrollArea class by using the setVerticalScrollBar() member function. The custom scroll bar is getting update correctly, but it's clipped off!!! Since the custom scroll bar has a width that is larger than the original scroll bar, it getting clipped and not shown fully. I have tried setting the setViewportMargins(), but that didn't help. I have been searching for two days, but haven't found how to do this.

    I want to avoid creating scrollbar that is linked to the scroll area with slots etc.

    @ScrollArea::ScrollArea(QWidget *parent, QScrollBar *scrollbar) :
    QScrollArea(parent)
    {
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setVerticalScrollBar(scrollbar);
    setViewportMargins(50, 50, 50, 50);
    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved