qtstylesheets

Manipulating SVG Data in PyQt QMainWindow setStyleSheet- function

Manipulating SVG Data in PyQt QMainWindow setStyleSheet- function Question: I’m working on a UI in PyQt and I want to add a background-image to the MainWindow. Adding the Picture is not the problem, but if I run my code the image is shown multiple times… Here is a short codesnipped: import sys from PyQt5.QtCore import …

Total answers: 1

Button hover transition duration

Button hover transition duration Question: I’ve been working on a small project in PyQt5 for a little while and I wanted to try and make it look a little better using the style sheet. For testing I copied an example from W3Schools into a new project just to see if it would work. The example …

Total answers: 1

How to change QPushButton text and background color

How to change QPushButton text and background color Question: I am using following code to connect QMenu to QPushButton. When button is clicked a pull-down menu with multiple sub-menu’s items is shown. button=QPushButton() button.setText(“Press Me”) font=QtGui.QFont() button.setFont(font) button.setSizePolicy(ToolButtonSizePolicy) button.setPopupMode(QtGui.QToolButton.InstantPopup) menu=QtGui.QMenu() button.setMenu(menu) menuItem1=menu.addAction(‘Menu Item1’) menuItem2=menu.addAction(‘Menu Item2’) Now depending on a condition I would like to customize …

Total answers: 4