Qt下QWizard改变next,back等默认按钮的大小及背景

默认的按钮又小又丑,想改大点漂亮点。

百度没百出来,最后用google

在这里:

http://stackoverflow.com/questions/16425575/change-qwizard-buttons-size

Better is to customize user interface using QSS (Qt Style Sheet). You can read your qss file and setup stylesheet for the whole application using QApplication::setStyleSheet().

Also you can setup qss programmatically (not the best practics).

setStyleSheet("QAbstractButton { height: 50px }");

What sets height for all buttons on the widget.

In the worst case you can try this:

button(QWizard::CancelButton)->setStyleSheet("height: 50px");

我的代码:

button(QWizard::CancelButton)->setStyleSheet("QPushButton{height:40px;80;background-image: url(:/img/smbtd.png);border-style:flat;background-attachment:fixed;}"
"QPushButton:pressed{background-image: url(:/img/smbto.png);border-style:flat;background-attachment:fixed;}");

 
原文地址:https://www.cnblogs.com/sankye/p/3445239.html