You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm currently following the video about 22 Modern UI and I'm working with the json file. I'm trying to do the same in the video with the stacked widgets and changing background colors of the buttons, according to the page you're on. I noticed the QT-PyQt-PySide-Custom_Widgets has changed a lot since the video came out. One of the difference is the khamisikibet.github.io site. I'm trying to change the background color of the QPushButton as showed in Customizing QPushButtons, but no matter what I do that has to do with colors, it gives me this error:
File "C:\Users...\Python39\lib\site-packages\Custom_Widgets\Qss\colorsystem.py", line 259, in CreateVariables
bg_rgb_1 = hex_to_rgb(theme.BG_1)
File "C:\Users...\Python39\lib\site-packages\Custom_Widgets\Qss\colorsystem.py", line 39, in hex_to_rgb
r = int(hex_color[0:2], 16)
ValueError: invalid literal for int() with base 16: 'wh'
The changing of the page when the QPushButton is clicked is working and the themes of the buttons are working, indicating that the json file is working, but there appears to be an issue with the colors. It seems that somehow, no matter if I try customTheme, defaultStyle or fallBackStyle in the form of hex, binary or stringname (e.g. blue, green), it gives 'wh' as input for the r = int(hex_color[0:2], 16).
Is there something I am doing wrong or is there something wrong with the colorsystem.py?
My code can be found below:
`{
"QCustomQStackedWidget":[
{
"name":"mainPages",
"navigation":[
{
"navigationButtons":[
{
"trainBtn": "mainBodyContainerTrain",
"testBtn": "mainBodyContainerTest",
"usersBtn": "mainBodyContainerUsers"
}
]
}
]
}
],
}`
The first part of QCustomQStackedWidget is working, but the second part, where I only try one button (trainBtn) isn't working, even when I try background-color. Also gives the same error when working with QPushButtonGroup.
I noticed that this discussion is not very active, but if someone could help, it would mean the world to me. Thanks in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm currently following the video about 22 Modern UI and I'm working with the json file. I'm trying to do the same in the video with the stacked widgets and changing background colors of the buttons, according to the page you're on. I noticed the QT-PyQt-PySide-Custom_Widgets has changed a lot since the video came out. One of the difference is the khamisikibet.github.io site. I'm trying to change the background color of the QPushButton as showed in Customizing QPushButtons, but no matter what I do that has to do with colors, it gives me this error:
File "C:\Users...\Python39\lib\site-packages\Custom_Widgets\Qss\colorsystem.py", line 259, in CreateVariables
bg_rgb_1 = hex_to_rgb(theme.BG_1)
File "C:\Users...\Python39\lib\site-packages\Custom_Widgets\Qss\colorsystem.py", line 39, in hex_to_rgb
r = int(hex_color[0:2], 16)
ValueError: invalid literal for int() with base 16: 'wh'
The changing of the page when the QPushButton is clicked is working and the themes of the buttons are working, indicating that the json file is working, but there appears to be an issue with the colors. It seems that somehow, no matter if I try customTheme, defaultStyle or fallBackStyle in the form of hex, binary or stringname (e.g. blue, green), it gives 'wh' as input for the r = int(hex_color[0:2], 16).
Is there something I am doing wrong or is there something wrong with the colorsystem.py?
My code can be found below:
`{
"QCustomQStackedWidget":[
{
"name":"mainPages",
"navigation":[
{
"navigationButtons":[
{
"trainBtn": "mainBodyContainerTrain",
"testBtn": "mainBodyContainerTest",
"usersBtn": "mainBodyContainerUsers"
}
]
}
]
}
],
}`
The first part of QCustomQStackedWidget is working, but the second part, where I only try one button (trainBtn) isn't working, even when I try background-color. Also gives the same error when working with QPushButtonGroup.
I noticed that this discussion is not very active, but if someone could help, it would mean the world to me. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions