[PyQt] Tab labels not shown correctly
Souvik Dutta Chowdhury
Souvik.viksou at outlook.com
Mon Mar 9 14:19:00 GMT 2020
Ya seriously, and more so with the pyqt5 documentation made by riverbank. They should learn from python.
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: PyQt <pyqt-bounces at riverbankcomputing.com> on behalf of Damon Lynch <damonlynch at gmail.com>
Sent: Monday, March 9, 2020 7:30:51 PM
To: Davide Liessi <davide.liessi at gmail.com>
Cc: pyqt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: [PyQt] Tab labels not shown correctly
On Mon, Mar 9, 2020 at 9:48 AM Davide Liessi <davide.liessi at gmail.com<mailto:davide.liessi at gmail.com>> wrote:
Il giorno lun 9 mar 2020 alle ore 13:27 Souvik Dutta
<souvik.viksou at outlook.com<mailto: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.
Damon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200309/e48ae227/attachment.htm>
More information about the PyQt
mailing list