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. Reduce painting area of qwidget.
Qt 6.11 is out! See what's new in the release blog

Reduce painting area of qwidget.

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwidgetqtableviewqscrollbarqscrollarea
2 Posts 2 Posters 1.4k 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.
  • T Offline
    T Offline
    tokafr
    wrote on last edited by
    #1

    Hello All!
    I have a qtableview object and set my custom horizontal scroll bar(inherits QScrollBar)
    with

    setHorizontalScrollBar(new MyScrollBar(this));
    

    But I have problem, when scroll changes the range it gets repainted by the table So scrollbar is not visible. I want to reduce the painting area of qtableview to avoid scroll repainting. How is that possible?
    thank you.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      I have never tried this myself so might be silly question,
      If you set the qtableview to always show horz scrollbar (Qt::ScrollBarPolicy)
      and then replace it with your own. the size should fit?

      Or is because your new scrollbar is bigger? (than the std one)

      the docs says
      "When a scroll bar becomes visible again, the viewport shrinks in order to make room for the scroll bar."

      so it should just work by auto. So I wonder if the custom bar dont give correct size info?

      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