I would like to change the QStyle::PM_TabBarTabHSpace for the PyQt application. I read the Qt document for QStyle , but I'm not sure how to install it correctly in PyQt.
Inoperative code:
style = QStyleFactory.create('Cleanlooks') style.PM_TabBarTabHSpace = 5 # 5 pixels? app.setStyle(style)
This code works, but it does not change the indentation on the tab tabs. I tried to use stylesheets to change the filling of the tab, but this destroys the graphic drawing, so that none of the elements of the search style are drawn by default (I do not want to override all the ui drawings).
I think I may have to use QProxyStyle , but I cannot find examples of using this in PyQt4. Edit: PyQt doesn't seem to have a QProxyStyle, since from PyQt4.QtGui import QProxyStyle fails.
Can someone please write an example of changing the value of PM_TabBarTabHSpace ? Thanks.
Edit Here is the skeleton code. Changing the PM_TabBarTabHSpace value does nothing. :(
from PyQt4.QtGui import (QApplication, QTabWidget, QWidget, QStyle, QStyleFactory) def myPixelMetric(self, option=None, widget=None): if option == QStyle.PM_TabBarTabHSpace: return 200
source share