Hi I've this hort program in Python ad Qt4
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
color = QtGui.QColor(99, 0, 0)
class colorButton(QtGui.QWidget):
def __init__(self, args):
QtGui.QWidget.__init__(self,args)
self.setGeometry(150, 22, 50, 50)
self.setStyleSheet("QWidget { background-color: %s }" % color.name())
class ColorDialog(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setGeometry(40, 40, 220, 100)
self.setWindowTitle('ColorDialog')
button=colorButton(self)
app = QtGui.QApplication(sys.argv)
cd = ColorDialog()
cd.show()
app.exec_()
The intrpreter doesn't give me any error, but the "colored" widget isn't shown. Why? thank