QGroupBox title is cut off after modifying it

Maurizio Berti maurizio.berti at gmail.com
Sun Jul 16 19:28:33 BST 2023


Without a MWE we cannot guess things.
QGroupBox doesn't use a QLabel for its title, it is drawn using the QStyle
implementation.

You should check if you forgot some stylesheet hanging around within the
widget tree above the group box, and ensure that you didn't use generic QSS
properties (which are always discouraged for parent widgets).

It *may* be a Qt bug, but without more context we really cannot do anything.

Cheers,
MaurizioB

Il giorno dom 16 lug 2023 alle ore 16:49 <c.buhtz at posteo.jp> ha scritto:

> Hello,
>
> I tried but I'm not able to create an minimal working example to
> reproduce this. So I can only offer you a screenshot to illustrate my
> problem. Maybe you have an idea or a hint what could it be or where to
> look.
>
>  https://i.imgur.com/QpIlbot.png
>
> There is a QGroupBox which title is cutoff at the end. Not sure if
> there is a QLabel behind it. But it looks like that the widget did not
> expand to the full possible length.
>
> Initially the title was short. After an event/signal the title was
> modified with a longer string.
>
> There are much more other widgets and layouts invovled. I assume that
> one of them influence the groupbox behavior.
>
> It is initialized like this in the QMainWindow
>
>     self.filesWidget = QGroupBox(self)
>     filesLayout = QVBoxLayout(self.filesWidget)
>
>     # ...
>     self.mainSplitter = QSplitter(Qt.Horizontal, self)
>     self.mainSplitter.addWidget(self.timeLine)
>     self.mainSplitter.addWidget(self.filesWidget)
>
> As I stated I'm not able to reproduce in an MWE. My MWE works well.
> Everytime I modify the string the groupbox resize itself and display
> the whole string.
>
> I'm confused.
>
> Currently I can workaround it with just initializing the title with a
> some blank spaces.
>
> Kind
> Christian
>


-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230716/1bd6c971/attachment.htm>


More information about the PyQt mailing list