[PyQt] problem with css...

Jebagnana Das jebagnanadas at gmail.com
Tue Dec 15 06:05:21 GMT 2009


Hi all,

      In the below program the style sheet properties isn't working
even after it's set. Can you please where i went wrong????

from PyQt4 import QtCore, QtGui
import sys

class Ui_TabWidget(object):
    def setupUi(self, TabWidget):
        TabWidget.setObjectName("TabWidget")
        TabWidget.resize(400, 300)

        self.tabBar=QtGui.QTabBar
<http://doc.trolltech.com/latest/QTabBar.html>(TabWidget)

        self.tabBar.setStyleSheet("QTabBar{left-margin:20;right-margin:20;}")

        self.tabBar.addTab("Tab1")
        self.tabBar.setTabText(0,"hello")

        self.tabBar.addTab("Tab2")
        self.tabBar.setTabText(1,"hai")

        TabWidget.setTabBar(self.tabBar)

        self.retranslateUi(TabWidget)

        QtCore.QMetaObject
<http://doc.trolltech.com/latest/QMetaObject.html>.connectSlotsByName(TabWidget)

    def retranslateUi(self, TabWidget):
        TabWidget.setWindowTitle(QtGui.QApplication
<http://doc.trolltech.com/latest/QApplication.html>.translate("TabWidget",
"TabWidget", None, QtGui.QApplication
<http://doc.trolltech.com/latest/QApplication.html>.UnicodeUTF8))


app = QtGui.QApplication
<http://doc.trolltech.com/latest/QApplication.html>(sys.argv)

TabWidget = QtGui.QTabWidget <http://doc.trolltech.com/latest/QTabWidget.html>()
ui = Ui_TabWidget()
ui.setupUi(TabWidget)
TabWidget.show()
sys.exit(app.exec_())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091215/e2314c7b/attachment.html


More information about the PyQt mailing list