AngryDuck
AngryDuck

Reputation: 4607

How to style a QWizard's button area?

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

Upvotes: 17

Views: 992

Answers (1)

Andrei Shikalev
Andrei Shikalev

Reputation: 732

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

Upvotes: 4

Related Questions