qstyle

How to modify style hint without QProxyStyle?

给你一囗甜甜゛ 提交于 2019-12-20 04:26:13
问题 I use Python bindings of Qt (PySide or PyQt4). They don't have QProxyStyle . I want to change the value of a style hint. For example change the SH_Menu_SubMenuPopupDelay popup delay time of a submenu. In native C++ Qt I would use a QProxyStyle and override styleHint and filter for the style hint of interest and return the value I like. It's done here for example. But in the Python bindings I use QProxyStyle is not available. So how can a style hint of an existing style be modified there? 回答1:

How to draw control with QStyle and with specified QSS?

不问归期 提交于 2019-12-18 09:42:44
问题 I'm trying to draw a checkbox in QStyledItemDelegate . I want checkbox to be drawng not with native look, but with style that specified with qApp->setStyleSheet() . I don't know why, but when I draw control with QStyle::drawPrimitive - it doesn't pick up global qss. Are there any solutions, how to manually draw check box with application style? Following code and screenshot demonstrate my problem: First check box is draw with QStyle::drawPrimitive , second check box is widget. #include

How do I use QStyle::SH_ToolTip_WakeUpDelay to set tooltip wake-up time?

南楼画角 提交于 2019-12-13 18:09:36
问题 It seems QStyle::SH_ToolTip_WakeUpDelay can be used to set tooltip wake-up time. How do I do it in C++ code? 回答1: You can use a QProxyStyle to override the default hints provided by whatever style you're using. Like: class ProxyStyle : public QProxyStyle { Q_OBJECT public: int styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE { if (hint == QStyle::SH_ToolTip_WakeUpDelay) return 123; // or whatever you want return

QTreeWidget (Applying Styles for items)

大兔子大兔子 提交于 2019-12-08 09:08:39
问题 I have a tree widget and there are three levels in the tree as follows Example Tree ============================ LEVEL1 LEVEL2 LEVEL2 LEVEL3 LEVEL3 LEVEL2 LEVEL2 LEVEL1 I want to apply different styles for items, depending their levels so that I can style, LEVEL1, LEVEL2 & LEVEL3 differently. I can do this with a two level tree. Please help. I want to achieve this at CSS level (without touching the code) I went through following documenation. I guess distinguishing between LEVEL1 & LEVEL2 is

Change icon on state change using Qt stylesheet

╄→尐↘猪︶ㄣ 提交于 2019-12-02 12:22:49
问题 I'm trying to support theming for my application, and I'm coming across a problem where I have to change icons based on the state of the QPushButton (default, hover, pressed, etc.). Here is what I use to set the icon for a QPushButton: QPushButton#playButton { qproperty-icon: url(":/light/icons/play_light.png"); } Because the hover state uses a background that requires an icon from my dark theme, I tried to change it to the other using this: QPushButton#playButton:hover { qproperty-icon: url(

How to modify style hint without QProxyStyle?

元气小坏坏 提交于 2019-12-02 06:48:58
I use Python bindings of Qt (PySide or PyQt4). They don't have QProxyStyle . I want to change the value of a style hint. For example change the SH_Menu_SubMenuPopupDelay popup delay time of a submenu. In native C++ Qt I would use a QProxyStyle and override styleHint and filter for the style hint of interest and return the value I like. It's done here for example. But in the Python bindings I use QProxyStyle is not available. So how can a style hint of an existing style be modified there? The menu popup delay is not a fixed value, as it will depend on the current style. There is no way to set

Change icon on state change using Qt stylesheet

纵饮孤独 提交于 2019-12-02 04:14:11
I'm trying to support theming for my application, and I'm coming across a problem where I have to change icons based on the state of the QPushButton (default, hover, pressed, etc.). Here is what I use to set the icon for a QPushButton: QPushButton#playButton { qproperty-icon: url(":/light/icons/play_light.png"); } Because the hover state uses a background that requires an icon from my dark theme, I tried to change it to the other using this: QPushButton#playButton:hover { qproperty-icon: url(":/dark/icons/play_dark.png"); } When I do this, the play_light.png displays as it should, but it doesn

Dark theme for in Qt widgets?

China☆狼群 提交于 2019-11-30 00:48:30
Background I'm building a PyQt5 application, that I'd like to have a dark theme for. Previously I've worked with Android development where there was a dark theme that I could set for an whole application Question Is there a dark theme built into Qt (that applies to all widgets in an application, and that is cross-platform)? No, but you may use my fairly comprehensive stylesheets that should look excellent on most platforms (it's inspired by KDE's Breeze Theme, which is a dark theme that is quite elegant). This was (hard) forked from the excellent QDarkStylesheet , which I felt had theme issues

Dark theme for in Qt widgets?

两盒软妹~` 提交于 2019-11-28 21:31:45
问题 Background I'm building a PyQt5 application, that I'd like to have a dark theme for. Previously I've worked with Android development where there was a dark theme that I could set for an whole application Question Is there a dark theme built into Qt (that applies to all widgets in an application, and that is cross-platform)? 回答1: No, but you may use my fairly comprehensive stylesheets that should look excellent on most platforms (it's inspired by KDE's Breeze Theme, which is a dark theme that