Hi everyone, i have a question about set button color in houdini 16.5 by pyside2
this my code
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
class Color_Lab(QWidget):
def __init__(self):
super(Color_Lab,self).__init__()
self.setWindowFlags(Qt.WindowStaysOnTopHint)
self.setWindowTitle(“Node_Color”)
self.setGeometry(100,100,1000,200)
Box = QHBoxLayout()
self.setLayout(Box)
add_button_css = “QPushButton{font-size: 10px; font-family: Arial;background-color:black}”
add_button = QPushButton('a')
#c=add_button.palette()
#col=QColor(0,50,50)
#c.setColor(QPalette.Button,col)
#add_button.setPalette©
add_button.setFixedWidth( 110 )
Box.addWidget(add_button)
#self.setStyleSheet(“background-color:rgb(0,0,0)”)
add_button.setStyleSheet(“background-color:red”)
Main=Color_Lab()
Main.show()
A big problem confuse me, Nothing is changed. I don't know what’happen,Does anyone know a answer. please help. Because in other version it can work.
some problem about Pyside2 set button color
6294 3 0- landyvfx
- Member
- 8 posts
- Joined: Sept. 2017
- Offline
- claudiohick
- Member
- 36 posts
- Joined: May 2013
- Offline
- landyvfx
- Member
- 8 posts
- Joined: Sept. 2017
- Offline
- landyvfx
- Member
- 8 posts
- Joined: Sept. 2017
- Offline
-
- Quick Links