Hello all,
1) I want to have a Tabbed widget with some spaces between it's tab bars(ie., between adjacent tab headers).. And i learnt that we can customize the tab widget if we use QTabBar with stylesheets like left-margin and right-margin etc.. So i created a tab bar and attatched it with the QTabWidget.. But when i set the style sheet for QTabBar it didn't show up.. Do i have to do this for every instance of tabs in the QTabBar(If yes then how can i catch the instance for tab1)???
But here in this link http://doc.trolltech.com/4.3/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar theyr'e creating the styles globally for the TabBar..

And this program isn't working as intended...
Qt Code:
  1. from PyQt4 import QtCore, QtGui
  2. import sys
  3.  
  4. class Ui_TabWidget(object):
  5. def setupUi(self, TabWidget):
  6. TabWidget.setObjectName("TabWidget")
  7. TabWidget.resize(400, 300)
  8.  
  9. self.tabBar=QtGui.QTabBar(TabWidget)
  10.  
  11. self.tabBar.setStyleSheet("QTabBar{left-margin:20;right-margin:20;}")
  12.  
  13. self.tabBar.addTab("Tab1")
  14. self.tabBar.setTabText(0,"hello")
  15.  
  16. self.tabBar.addTab("Tab2")
  17. self.tabBar.setTabText(1,"hai")
  18.  
  19. TabWidget.setTabBar(self.tabBar)
  20.  
  21. self.retranslateUi(TabWidget)
  22.  
  23. QtCore.QMetaObject.connectSlotsByName(TabWidget)
  24.  
  25. def retranslateUi(self, TabWidget):
  26. TabWidget.setWindowTitle(QtGui.QApplication.translate("TabWidget", "TabWidget", None, QtGui.QApplication.UnicodeUTF8))
  27.  
  28.  
  29. app = QtGui.QApplication(sys.argv)
  30.  
  31. TabWidget = QtGui.QTabWidget()
  32. ui = Ui_TabWidget()
  33. ui.setupUi(TabWidget)
  34. TabWidget.show()
  35. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode 
May i know where i did mistake??

2) I want to show the Tab header of the selected tab in different color gradient.. Can you please tell me how to set the different colors for tab-headers???
Any help in this regard would be great..Thanks..