qpalette

Qt - render QFrame with image as background without using WA_TranslucentBackground

依然范特西╮ 提交于 2019-12-24 16:19:15
问题 I need to set a QFrame with a background image: http://imgur.com/RnSghvV. This is what I tried: setAutoFillBackground(true); setWindowFlags(Qt::FramelessWindowHint); setStyleSheet("background: transparent;"); QPalette p = this->palette(); p.setBrush(QPalette::Base, QPixmap("ipad.png")); this->setPalette(p); This is what I am getting: As you can see, there is an annoying black frame along the edges, which I want to remove, and view just the image. How do I do that? P.S, it is possible to make

PyQt4 QPalette not working

自古美人都是妖i 提交于 2019-12-14 01:25:25
问题 {btn = QtGui.QPushButton('Button', self) palettes = btn.palette() palettes.setColor(btn.backgroundRole(),QtCore.Qt.green) btn.setPalette(palettes) btn.setAutoFillBackground(True)} Using btn.backgroundRole() only provides green border to the button. Using btn.foregroundRole() changes the text color of the button Using btn.windowRole() gives me error TypeError: arguments did not match any overloaded call: QPalette.setColor(QPalette.ColorGroup, QPalette.ColorRole, QColor): argument 1 has

How to change (remove) selection/active color of QListWidget

时间秒杀一切 提交于 2019-12-10 11:33:32
问题 In my QListWidget , there are some items that have non-default background color, I set them like so inside the custom QListWidget class: item->setBackgroundColor(qcolor); // item is of type QListWidgetItem* Those non-default colors that I set are distorted by the QListWidget 's selection color. See an example: Items three and four are supposed to be the same color, but they are not since the item four is selected, and thus the result color is a summation of original color and QListWidget 's

How to change (remove) selection/active color of QListWidget

倖福魔咒の 提交于 2019-12-06 07:16:40
In my QListWidget , there are some items that have non-default background color, I set them like so inside the custom QListWidget class: item->setBackgroundColor(qcolor); // item is of type QListWidgetItem* Those non-default colors that I set are distorted by the QListWidget 's selection color. See an example: Items three and four are supposed to be the same color, but they are not since the item four is selected, and thus the result color is a summation of original color and QListWidget 's selection (active item?) color. My question is how to edit or remove that selection color? I tried