Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to style a QWizard's button area?

Tags:

css

qt

I have an application with styles set in a qss file. All widget backgrounds are now a darker colour and buttons have their own styles too.

This is all working throughout the software except for on QWizard which seems to have its own button area across the bottom of the wizard with the default qt widget colour still applied to it.

I have looked at the various components that i can apply styles to on the QWizard but none of them seem to be this button area across the bottom of the form, just wondering if anyone has encountered this before and found out which object i need to apply the style for to change the colour of this area.

enter image description here

like image 294
AngryDuck Avatar asked Apr 01 '15 16:04

AngryDuck


1 Answers

If you set wizard style to ClassicStyle then QWidgets are available for colorization with QSS.

wizard->setWizardStyle(QWizard::ClassicStyle);

For default VistaStyle painting hardcoded in source of QWizard like this:

if (wizardPrivate->isVistaThemeEnabled(QVistaHelper::VistaBasic)) {
    if (window()->isActiveWindow())
        painter.setPen(QPen(QBrush(QColor(169, 191, 214)), 0)); // ### hardcoded for now
    else
        painter.setPen(QPen(QBrush(QColor(182, 193, 204)), 0)); // ### hardcoded for now
    painter.drawLine(0, 0, width(), 0);
}

Code on Github

like image 84
Andrei Shikalev Avatar answered Nov 11 '22 00:11

Andrei Shikalev