[Qt-interest] How to re-lay out items in QListView on dataChanged()

Malyushytsky, Alex alex at wai.com
Tue Apr 27 02:21:40 CEST 2010


>> doItemsLayout() by the way is not documented in docs.
>> It actually do what I've been asking for. But isn't it too expensive?

I am glad advice was helpful. Even though I can't say that Qt documentation is bad (it is probably the best I seen for products which are available for gpl and lgpl and even most commercial ), nothing can replace source code.
So I would recommend to look in header files especially, if you can't find something seems reasonable in documentation, sometimes it pays to look in cpp files.

If you can't find feature in the documentation, but it exists in the code, mostly likely documentation was not updated yet or this developer has not decided, if this feature would not be changed in the future. But if such function in the public or protected area I would not worry about it. Finally you need it , right?

>> ... But isn't it too expensive?

I afraid nobody will answer this except you. You either use it, if you agree to pay the cost, or don't if you don't.

Regards,
   Alex


-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Dmitry Teslenko
Sent: Monday, April 26, 2010 12:24 AM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] How to re-lay out items in QListView on dataChanged()

> Hello!
>
> I have QListView in ItemView mode that shows previews of windows and
> window captions beneath.
> Windows are of different sizes, so my QListView's model provide data
> for Qt::DecorationRole and Qt::SizeHintRole.
>
> In scenario 1 I have all previews ready and after model reset QListView
> lays out all previews according its size hints.
>
> In scenario 2 I have only list of windows ready and worker threads preparing
> previews. After model reset QListView lays out previews stubs and waits.
> Thren previews are finally ready, model emits dataChanged() signals to
> notify QListView it's time to update previews. QListView re-reads previews
> from model and shows them nicely. Bad thing QListView doesn't also
> re-layout items and some of them looks cropped.
>
> How to trigger QListView item re-layout?


On Sat, Apr 24, 2010 at 00:55, Malyushytsky, Alex <alex at wai.com> wrote:
>>> How to trigger QListView item re-layout?
>
> I have not tried myself, but have you tried to call  doItemsLayout()?
>

Thanks for your interest. I've noticed layoutChanged() signal in docs.
doItemsLayout() by the way is not documented in docs.
It actually do what I've been asking for. But isn't it too expensive?

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”




More information about the Qt-interest-old mailing list