[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: QGroupBox title is cut off after modifying it
From:       Maurizio Berti <maurizio.berti () gmail ! com>
Date:       2023-07-16 18:28:33
Message-ID: CAPn+-XSYRTss2DxPmD6mePE2vjqqmE_jpFnq2PMcJP5QGucsVA () mail ! gmail ! com
[Download RAW message or body]

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@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

[Attachment #3 (text/html)]

<div dir="ltr"><div><div>Without a MWE we cannot guess things.<br></div>QGroupBox doesn&#39;t \
use a QLabel for its title, it is drawn using the QStyle \
implementation.<br></div><div><br></div><div>You should check if you forgot some stylesheet \
hanging around within the widget tree above the group box, and ensure that you didn&#39;t use \
generic QSS properties (which are always discouraged for parent widgets).<br><br></div><div>It \
*may* be a Qt bug, but without more context we really cannot do \
anything.<br></div><div><br></div><div>Cheers,</div><div>MaurizioB<br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno dom 16 lug 2023 alle ore 16:49 \
&lt;<a href="mailto:c.buhtz@posteo.jp">c.buhtz@posteo.jp</a>&gt; ha \
scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br> <br>
I tried but I&#39;m not able to create an minimal working example to<br>
reproduce this. So I can only offer you a screenshot to illustrate my<br>
problem. Maybe you have an idea or a hint what could it be or where to<br>
look.<br>
<br>
  <a href="https://i.imgur.com/QpIlbot.png" rel="noreferrer" \
target="_blank">https://i.imgur.com/QpIlbot.png</a><br> <br>
There is a QGroupBox which title is cutoff at the end. Not sure if<br>
there is a QLabel behind it. But it looks like that the widget did not<br>
expand to the full possible length.<br>
<br>
Initially the title was short. After an event/signal the title was<br>
modified with a longer string.<br>
<br>
There are much more other widgets and layouts invovled. I assume that<br>
one of them influence the groupbox behavior.<br>
<br>
It is initialized like this in the QMainWindow<br>
<br>
      self.filesWidget = QGroupBox(self)<br>
      filesLayout = QVBoxLayout(self.filesWidget)<br>
<br>
      # ...<br>
      self.mainSplitter = QSplitter(Qt.Horizontal, self)<br>
      self.mainSplitter.addWidget(self.timeLine)<br>
      self.mainSplitter.addWidget(self.filesWidget)<br>
<br>
As I stated I&#39;m not able to reproduce in an MWE. My MWE works well.<br>
Everytime I modify the string the groupbox resize itself and display<br>
the whole string.<br>
<br>
I&#39;m confused.<br>
<br>
Currently I can workaround it with just initializing the title with a<br>
some blank spaces.<br>
<br>
Kind<br>
Christian<br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div \
dir="ltr" class="gmail_signature">È difficile avere una convinzione precisa quando si parla \
delle ragioni del cuore. - &quot;Sostiene Pereira&quot;, Antonio Tabucchi<br><a \
href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic