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

List:       kde-commits
Subject:    Re: KDE/kdelibs/nepomuk/ui
From:       Peter Penz <peter.penz19 () gmail ! com>
Date:       2010-06-13 8:03:29
Message-ID: 201006131003.30104.peter.penz19 () gmail ! com
[Download RAW message or body]

On Sunday 13 June 2010 09:39:45 Sebastian Trüg wrote:
> Very nice work, Peter. Thanks a lot. I doubt that I would have ever
> thought of that. Is this documented somehwere?

I've checked the documentation again and have not found anything. Personally I 
think the minimumSizHint() in the example at 
http://doc.qt.nokia.com/4.3/layouts-flowlayout.html should be corrected to 
return a value being able to show all items. I'll submit a suggestion to the 
qt bugtracker for this, but currently the bugtracker seems to be down :-(

> Cheers,
> Sebastian
> 
> On 06/12/2010 08:47 PM, Peter Penz wrote:
> > SVN commit 1137422 by ppenz:
> > 
> > Provide a minimum size hint, that is capable to show the whole content in
> > one line. This allows the layout system, to check the heightForWidth()
> > value, if the minimum width cannot be provided.
> > 
> > This fixes the issue, that the Nepomok Tag widget does not show all tags
> > or the "Change..." label.
> > 
> > CCMAIL:  trueg@kde.org
> > BUG: 240099
> > 
> >  M  +8 -2      kblocklayout.cpp
> > 
> > --- trunk/KDE/kdelibs/nepomuk/ui/kblocklayout.cpp #1137421:1137422
> > @@ -177,9 +177,15 @@
> > 
> >  {
> >  
> >      QSize size;
> >      QLayoutItem *item;
> > 
> > -    foreach (item, d->itemList)
> > -        size = size.expandedTo(item->minimumSize());
> > +    foreach (item, d->itemList) {
> > +        const QSize itemSize = item->minimumSize();
> > +        size.rwidth() += itemSize.width();
> > +        if (itemSize.height() > size.height()) {
> > +            size.setHeight(itemSize.height());
> > +        }
> > +    }
> > 
> > +    size.rwidth() += horizontalSpacing() * d->itemList.count();
> > 
> >      size += QSize(2*margin(), 2*margin());
> >      return size;
> >  
> >  }

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

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