qtstylesheets

Style QComboBox's sub-control down-arrow when mouse is hovering over the QComboBox via QSS

旧街凉风 提交于 2019-12-04 06:21:11
问题 I know how to style QComboBox when mouse is hovering by doing: pComboBox->setStyleSheet(pComboBox->styleSheet()+QString(" QComboBox:hover{css style here}")) And I also know to style QComboBox 's sub-control down-arrow's style via: pComboBox->setStyleSheet(pComboBox->styleSheet()+QString(" QComboBox::down-arrow{css style here}")) But I don't know how to style QComboBox 's sub-control down-arrow when the mouse is hovering over the QComboBox via QSS . Does anybody have an idea? 回答1: I don't know

Determining Qt stylesheet options programmatically?

孤街醉人 提交于 2019-12-04 03:05:46
问题 Is it possible to look up stylesheet values at runtime in Qt? I'm working on a custom button derived from QPushButton that has some stylesheet properties set. I'd like to be able to look up some stylesheet settings like border width, margin , padding-top , padding-left , padding-right , etc. Is this at all possible to do without calling widget->getStyleSheet() and parsing out the values myself? 回答1: Don't think so, you might be able to find something by stepping through the drawing code. But

Set QGroupBox title font size with style sheets

。_饼干妹妹 提交于 2019-12-04 00:17:06
I would like to be able to set the font size of the title of a QGroupBox using style sheets. I can't seem to figure it out. Based on what I've read here , I've come up with the following code. Unfortunately, it doesn't quite work. groupbox->setStyleSheet(style) Where style is: QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; padding: 5 5px; font-size: 18px; font-weight: bold; } All of those style elements seem to be honored except font-size and font-weight . According to the Qt Style Sheets Reference , the font "property is supported by all widgets that respect the

How to use Non-Standard Custom Font with Stylesheets?

可紊 提交于 2019-12-03 13:27:23
问题 I have a PyQt4 application that is being styled by an external .qss file by using the following code: ... app = QtGui.QApplication(sys.argv) stylesheet = open('mystylesheet.qss').read() app.setStyleSheet(stylesheet) ... Normally, I would specify the type of font that I like in the .qss file to use like this: QMainWindow { font-family:arial; font-size:14px; } But, now I am wondering if it is possible for me to assign a custom font that I downloaded from internet (example, DroidSansMono (True

Qt Border, transparency, and padding. How to create this effect?

依然范特西╮ 提交于 2019-12-03 09:12:27
I want to add a top right button for closing a widget that floats over others. I can´t make it float out of the contents of the panel. I tried several ways. Having the background normally doesn´t work. I cant make a widget float outside the box inside that background. It was done this way: border-style: solid; border-width: 12px 24px 37px 25px; border-image: url(:/resources/images/panel_border_corner_btn.png) 12 24 37 25 fill repeat; margin: 0px; padding: 0px; So i tried to make a background with 10 px on the top and right sides transparents, like this (you won´t see the transparent zones, but

Stylesheets, widgets hidden and sizes in Qt

ε祈祈猫儿з 提交于 2019-12-03 08:36:53
There is a big problem with stylesheets. If you set the sizes through the style sheet by setting max and min values the same (fixed size) or whatever, and then you try to fetch them using size() on the widget, if the widget has never been shown the sizes you get are weird. But you can't fetch them from the stylesheet neither, so you have to show all widgets before resizing or fetching the positions. In my case, i start with a window. But the widgets under this window will appear later, and they have to be positioned in the correct positions before appearing . i have floating widgets, they are

How to use Non-Standard Custom Font with Stylesheets?

∥☆過路亽.° 提交于 2019-12-03 03:33:08
I have a PyQt4 application that is being styled by an external .qss file by using the following code: ... app = QtGui.QApplication(sys.argv) stylesheet = open('mystylesheet.qss').read() app.setStyleSheet(stylesheet) ... Normally, I would specify the type of font that I like in the .qss file to use like this: QMainWindow { font-family:arial; font-size:14px; } But, now I am wondering if it is possible for me to assign a custom font that I downloaded from internet (example, DroidSansMono (True Type Font) ) instead of windows standard font? NOTE: I am using Windows XP SP3 32 bits, with Python 2.7

Qt - Unknown property transform

非 Y 不嫁゛ 提交于 2019-12-02 18:19:09
问题 Right, I am doing a small project of mine on Qt and while using the style sheets for my MainWindow.ui it dropped me the error of Unknown property transform . I have used CSS before and I am somewhat familiar with it but I have not had any problem with doing simple translations, transformations etc. I am well aware that transform is not a standard, yet, used in CSS but I should use -moz-transform , -o-transform , -etc-transform for different browsers. This is the bit where I am using the

Style QComboBox's sub-control down-arrow when mouse is hovering over the QComboBox via QSS

南楼画角 提交于 2019-12-02 10:31:08
I know how to style QComboBox when mouse is hovering by doing: pComboBox->setStyleSheet(pComboBox->styleSheet()+QString(" QComboBox:hover{css style here}")) And I also know to style QComboBox 's sub-control down-arrow's style via: pComboBox->setStyleSheet(pComboBox->styleSheet()+QString(" QComboBox::down-arrow{css style here}")) But I don't know how to style QComboBox 's sub-control down-arrow when the mouse is hovering over the QComboBox via QSS . Does anybody have an idea? I don't know is QSS powerful enough to do this(I think no), but with eventfilter you can do this very easy: bool

How to set QTableWidget upper left corner using a background image?

[亡魂溺海] 提交于 2019-12-02 02:05:58
问题 How to set QTableWidget upper left corner using a background image? Now it is white. (Pointed in the image below) This is my style sheet code: QWidget { background-image: url(src/bg.jpg); color: #fffff8; } QHeaderView::section { background-image: url(src/bg.jpg); padding: 4px; border: 1px solid #fffff8; } QTableWidget { gridline-color: #fffff8; } QTableWidget QTableCornerButton::section { background-image: url(src/bg.jpg); border: 1px solid #fffff8; } 回答1: You will have to use a custom row