QT Designer: Push Button Error
-
Background push button disappears even when it has been colored.
I am a beginner and trying to create a GUI following a tutorial on Youtube. I am only 7 minutes in. When importing the button and changing the background color, there is no effect.
Does anyone have a solution? Thank You
-
Background push button disappears even when it has been colored.
I am a beginner and trying to create a GUI following a tutorial on Youtube. I am only 7 minutes in. When importing the button and changing the background color, there is no effect.
Does anyone have a solution? Thank You
@KevinAR
I am not sure whether/how much of stylesheet rules are actually shown in Designer. Run your program and see if that doesn't show it with background color? From Designer I think there is also some kind of "Preview" menu item you can pick to show the window you are designing as it will be at runtime? -
I think I find the cause of this problem when I use a background with a JPG file. It causes the button to become transparent. However, when I don’t use the background, the button still appears.
@KevinAR said in QT Designer: Push Button Error:
I think I find the cause of this problem when I use a background with a JPG file. It causes the button to become transparent. However, when I don’t use the background, the button still appears.
Your assumptions might be wrong here.
How do you set the background for your widget/app?Note: if you go
QWidget { background-image: "someImage"; }
your
QPushButton
will also inherit the stylesheet... maybe that's why you think it's transparent.