I am using a style sheet to customize a QScrollBar for QTextEdit. It is almost looking how I want, but I have run into an odd bug: two different instances of the textedit have different widths on the scrollbar's handle. This doesn't make sense to me because the two textedits have the exact same stylesheet for the scrollbar. Here's an image:
qscrollbarbug.png
As you can see, the handle is thinner in one, fatter in another. I've tried setting a width for the handle in the stylesheet, but it didn't have an effect.
Does anyone know what could be changing the handle width?
Here's my stylesheet code, for reference:
pCustomScroll->setStyleSheet(
"QScrollBar:vertical {"
"background: rgb(63, 63, 63);"
"width: 22px;"
"margin: 22px 0 22px 0;"
"}"
"QScrollBar::handle:vertical {"
"border: 1px rgb(63, 63, 63);"
"border-radius: 3px;"
"background: rgb( 63, 63, 63 );"
"}"
"QScrollBar::add-line:vertical {"
"background: white;"
"height: 22px;"
"subcontrol-position: bottom;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::sub-line:vertical {"
"background: white;"
"height: 22px;"
"subcontrol-position: top;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::up-arrow:vertical {"
"border-image: url(:/Icons/Resources/Icons/LargeUpArrow.png);"
"}"
"QScrollBar::down-arrow:vertical {"
"border-image: url(:/Icons/Resources/Icons/LargeDnArrow.png);"
"}"
"QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {"
"background: white;"
"}" );
pCustomScroll->setStyleSheet(
"QScrollBar:vertical {"
"background: rgb(63, 63, 63);"
"width: 22px;"
"margin: 22px 0 22px 0;"
"}"
"QScrollBar::handle:vertical {"
"border: 1px rgb(63, 63, 63);"
"border-radius: 3px;"
"background: rgb( 63, 63, 63 );"
"}"
"QScrollBar::add-line:vertical {"
"background: white;"
"height: 22px;"
"subcontrol-position: bottom;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::sub-line:vertical {"
"background: white;"
"height: 22px;"
"subcontrol-position: top;"
"subcontrol-origin: margin;"
"}"
"QScrollBar::up-arrow:vertical {"
"border-image: url(:/Icons/Resources/Icons/LargeUpArrow.png);"
"}"
"QScrollBar::down-arrow:vertical {"
"border-image: url(:/Icons/Resources/Icons/LargeDnArrow.png);"
"}"
"QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {"
"background: white;"
"}" );
To copy to clipboard, switch view to plain text mode
Bookmarks