Skip to content

Instantly share code, notes, and snippets.

@tpoveda
Last active June 19, 2018 09:00
Show Gist options
  • Save tpoveda/6e567393153d6a6a30f6f4e495f9179a to your computer and use it in GitHub Desktop.
Save tpoveda/6e567393153d6a6a30f6f4e495f9179a to your computer and use it in GitHub Desktop.
Get handle size of QScrollBar
opt = QStyleOptionSlider()
self.view.horizontalScrollBar().initStyleOption(opt)
style = self.view.horizontalScrollBar().style()
handle = style.subControlRect(style.CC_ScrollBar, opt, style.SC_ScrollBarSlider)
sliderPos = handle.center()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment