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. Add space after ScrollBar?

Add space after ScrollBar?

Scheduled Pinned Locked Moved Unsolved General and Desktop
scrollbar
2 Posts 2 Posters 946 Views
  • 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.
  • T Offline
    T Offline
    Thomas9059
    wrote on last edited by
    #1

    I have a QScrollArea with a QGridLayout set via setLayout(). This scroll area is then added to a QMdiSubWindow.

    I have an animation that hides this sub window on a QEvent::Leave, and the problem is that the vertical scroll bar of the QScrollArea is too close to the right edge of the QMdiSubWindow which I am filtering for leave events.

    I need to add a sort of "buffer" region between my vertical scroll bar and the end of the sub window such that the hiding function is not as sensitive.

    Not sure what the best way to do this is... any ideas?

    What I tried was increasing the width of the sub window, also trying to set margins for the grid layout to add space to the right edge, adding a spacer item etc. but unfortunately none of this worked.

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      try the following:

      QMargins m = scrollArea->getContentsMargins();
      m.setRight( m.right() + 10 );
      scrollArea->setContentsMargins( m );
      

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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