qstylesheet

Change QPushButton Icon on hover and pressed

一世执手 提交于 2020-06-24 09:36:12
问题 I'm trying to change the Icon of a QpushButton on hover and pressed, I'm using QtDesigner with stylesheets. I tried this QpushButton{ qproperty-icon:url(:/images/start.png); } QPushButton:hover { qproperty-icon:url(:/images/start_hov.png); } But it doesn't work. I tried setting it from QtDesigner Menu but it didn't work as well. 回答1: Unfortunately, it is a bug of Qt which is still not fixed. There's a workaround suggestion within the comments to that bug, basically you could use empty

QToolButton with icon + text: How to center both?

陌路散爱 提交于 2020-01-15 18:48:14
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to

QToolButton with icon + text: How to center both?

青春壹個敷衍的年華 提交于 2020-01-15 18:47:23
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to

QToolButton with icon + text: How to center both?

大城市里の小女人 提交于 2020-01-15 18:47:13
问题 I am using multiple QToolButtons in a custom QGridLayout widget. The buttons are set to display icon + text based on an assigned default QAction. The only issue is that the content (icon + text) is always left-aligned. The content (icon + text, marked as a red box in the screenshot), should be center in the button (indicated by the blue box). For most cases this is just fine, given that Qt automatically tries to render that button with the minimal size. However I am stretching the button to

tick marks disappear on styled QSlider

爱⌒轻易说出口 提交于 2020-01-01 18:14:11
问题 I'm using Qt 5.3 and trying to style a QSlider . However, when I apply my style-sheet, the tick marks disappear. Does anyone know how to keep the styling without affecting the tick marks? Here is the style sheet: QSlider::groove:horizontal { border: 1px inset #B0B0B0; background-color: #EAEAEA; height: 2px; } QSlider::Handle { border: 1px solid black; background: #B0B0B0; background-image: url(:/metal_background_small); width: 12px; margin: -8px 0; } QSlider::Handle:Hover { border: 1px solid

How to obtain entire Qt StyleSheet for QMacStyle

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:11:10
问题 Is it possible to obtain a text file of the entire Qt5 StyleSheet for QMacStyle (or its equivalent QProxyStyle that's apparently used in Qt5)? I'm hoping to get a list of all the property:value pairs ('background-color', 'border-radius', 'margin-top', 'padding', etc.), along with their default settings, that are used for each of the common widgets (QPushButton, QTabBar, etc.). Qt5 on Mac OSX looks great due to all of the native-looking widgets (see e.g. Macintosh Style Widget Gallery). I'd