pyqt change background color

Solutions on MaxInterview for pyqt change background color by the best coders in the world

showing results for - "pyqt change background color"
Lisa
25 Jul 2016
1class Window(QMainWindow):
2    def __init__(self):
3        super().__init__()
4        self.init_me()
5
6    def init_me(self):
7        self.setGeometry(600, 250, 750, 500)
8        self.setStyleSheet("background:gray")  <----
9        # or
10        # self.setStyleSheet("background:rgb(r:int,g:int,b:int)")  <----
11
12        self.show()
13        
14# to change the color of the text:
15# self.setStyleSheet("color:rgb(...)")
16# or to change both at the same time:
17# self.setStyleSheet("color: rgb(...);background: rgb(...)")
18# you can do that with any QWidget object or class that inherits QWidget,
19# eg. QPushButton, QLabel, ...
queries leading to this page
set window background color pyqt5pyqt change window background colorpyqt set background color of layoutpyqt changing colorpyqt5 change color in the backgroundhow to change bg color pyqtset background color pyqtpyqt set backgroun colorpyqt5 background colorhow to change background color in pyqt5 designerchange background color and font color pyqtpyqt set window background colorhow to change backgroudn color pyqt5how to change frame colour in pyqt5qframe background color pythonbackground color in pyqt5how to change bg color pyqt designerpyqt5 change background colorpyqt5 set background coloradd background color pyqt5 chnage text background color pyqt5pyqt set background colorhow to chnange background color in pyqt5return background color pyqthow to change background color pqt5pyqt5 main window background colorpyqt window background colorpyqt change background colorpython pyqt5 background colorset background color in pyqt5pyqt background colorchange color of backgroun in pyqt5pyqt5 window background colorjquery change button background colorhow to change beckground color in pyqt5change bg color pyqt5how to set a background color in pytqt5add background colour pyqt5pyqt5 colorbackgroundhow to change pyqt5 window background colorpyqt widget background colorpyqt5 change window background colorwindow background color pyqt5how to set background color in pyqt5text background color pyqt5 pythonpyqt5 change main window background colorset background color pyqt5pyqt update background color in real timepyqt app background color background color pyqt background color pyqtchange background color pyqt designerpyqt update background color pyqt5 set window background colorpyqt5 color backgroundhow to change background color in pyqt5how to change pyqt5 background colorhow to change background in pyqt5pyqt change background color