QSizeGrip not painted when I set styleSheet for QStatusBar



  • Hi! I want to paint standard size grip (with little squares in corner) on status bar, but when i set stylesheet for status bar, size grip not painted. Fact is that when set stylesheet for status bar, sizegrip's style assigned to QStyleSheetStyle instead of QWindowsVistaStyle (for example). And QStyleSheet draws image instead of little squares in corner. How to set back QWindowsVistaStyle??


  • Moderators

    how does your stylesheet look like?



  • I solved this problem! Decision:
    [code]
    QSizeGrip* grip = statusBar.findChild<QSizeGrip*>();
    if(grip)
    {
    delete grip->style();
    grip->setStyle(QApplication::style());
    }
    [/code]



  • QStatusBar { background-color: red; }
    [quote author="raven-worx" date="1381212853"]how does your stylesheet look like?[/quote]


  • Moderators

    There must be something in your stylesheet which gets applied to the QSizeGrip widget.
    If your design your stylesheet to be more precise and there are no rules which apply to the QSizeGrip it should be painted with the default style.


Log in to reply
 

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