Problems with QGraphicsLayout

Matthias Fuchs mat69 at gmx.net
Sat Feb 28 18:46:53 CET 2009


On Freitag 27 Februar 2009 13:52:47 Matthias Fuchs wrote:
> On Freitag 27 Februar 2009 12:47:12 Artur Souza(MoRpHeUz) wrote:
> > On Friday 27 February 2009 08:32:31 Matthias Fuchs wrote:
> > > I tried QSizePolicy::Preferred, updateGeometry() on the layout,
> > > invalidate and adjustSize on both the labels and the layout. Maybe the
> > > order in which I called these methods was wrong or maybe I'm doing
> > > something stupid, it did not work.
> >
> > Try to set the preferred size of the Plasma::Label...something like:
> >
> > label->setPreferredSize(QSize(200,200));
> >
> > that should solve your issue if I'm not crazy right in the morning =P
>
> Either I misunderstood what you meant or this does not solve the problem as
> it rather makes the Labels larger than needed in most cases.
>
> The Labels shall only be as large as the text is. One reason for that is
> that I use isUnderMouse() to detect clicks on the label and I also set a
> cursor for the label. And empty space should not result in a different
> cursor or in visiting a website if you click on it.

Ok, for people with the same problem: Setting the minimumWidth fixed it


More information about the Plasma-devel mailing list