[PyQt] Tab labels not shown correctly

Damon Lynch damonlynch at gmail.com
Mon Mar 9 14:00:51 GMT 2020

On Mon, Mar 9, 2020 at 9:48 AM Davide Liessi <davide.liessi at gmail.com>

> Il giorno lun 9 mar 2020 alle ore 13:27 Souvik Dutta
> <souvik.viksou at outlook.com> ha scritto:
> > Did you use the correct selector like you should probably say,
> > self.setStyleSheet(<object name>: disabled{padding: 0px 0px 0px 0px})
> I started from the examples in
> https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar
> and with the help of
> https://doc.qt.io/qt-5/stylesheet-reference.html
> I arrived at the example below, which reproduces quite well the
> default style on Mac, while also fixing the display of the text in the
> tabs.
> Thanks for your help!
> Best wishes.
> Davide

While I don't have the message in front of me, I do recall a senior Qt
developer mentioning that while manipulating stylesheets has its uses, they
are seriously limited and can get you into trouble. In short they're a
hack. They might be fine for prototyping, but if you want to do it
properly, you need to learn how Qt styles its widgets and work with its
system. Which is  definitely more difficult. The complexity is real.
Whether it is worth it is up to each developer (I do use stylesheets myself
for some things). It would be nice if the Qt documentation would do a
better job of introducing Qt widget styling and how to get results quickly
and efficiently without stylesheets.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200309/9e7120f0/attachment-0001.htm>

More information about the PyQt mailing list