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(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)
def retranslateUi(self, TabWidget):
ui = Ui_TabWidget()
ui.setupUi(TabWidget)
TabWidget.show()
sys.exit(app.exec_())
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(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.connectSlotsByName(TabWidget)
def retranslateUi(self, TabWidget):
TabWidget.setWindowTitle(QtGui.QApplication.translate("TabWidget", "TabWidget", None, QtGui.QApplication.UnicodeUTF8))
app = QtGui.QApplication(sys.argv)
TabWidget = QtGui.QTabWidget()
ui = Ui_TabWidget()
ui.setupUi(TabWidget)
TabWidget.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
May i know where i did mistake??
Bookmarks