QAbstractScrollArea: scroll bar style



  • Hi all

    Have anybody noticed that subclasses of QAbstractScrollArea (e.g. QTextEdit, QGraphicsView, etc) incorrectly styling their scrollbars? If you just place a QPlainTextEdit and set its scrollbar polices to ScrollBarAlwaysVisible, and then place a QScrollBar near it, they will be painted with different styles on a real device (the QPlainTextEdit would paint its scrollbars with standard Windows style, but the ordinal scrollbars would be painted with a most likely QMacStyle). Does anybody know how to solve this problem.

    Also it seems that QAbstractScrollArea implemented assuming a fixed constant scrollbar height and width, and does not take into account the user defined size. When I set the width of vertical scrollbar to a lesser value, the scrollbar remains at the same X coordinate (an unoccupied space left between the right border of scrollbar and the right border of widget). And even move(dx, 0) can't solve this problem.

    Thanks ahead



  • [quote author="vlad2048" date="1292745900"]Hi all

    Have anybody noticed that subclasses of QAbstractScrollArea (e.g. QTextEdit, QGraphicsView, etc) incorrectly styling their scrollbars? If you just place a QPlainTextEdit and set its scrollbar polices to ScrollBarAlwaysVisible, and then place a QScrollBar near it, they will be painted with different styles on a real device (the QPlainTextEdit would paint its scrollbars with standard Windows style, but the ordinal scrollbars would be painted with a most likely QMacStyle). Does anybody know how to solve this problem.

    [/quote]

    Why are you posting this on the mobile forum? It could have made sense if you used a "mobile" style, but you say you're using a Windows style...

    Anyway, a simple test "works for me". Can you produce a testcase of the problem?

    [quote]

    Also it seems that QAbstractScrollArea implemented assuming a fixed constant scrollbar height and width, and does not take into account the user defined size. When I set the width of vertical scrollbar to a lesser value, the scrollbar remains at the same X coordinate (an unoccupied space left between the right border of scrollbar and the right border of widget). And even move(dx, 0) can't solve this problem.

    [/quote]

    This is likely to be a bug.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.