[Qt-interest] QListView::scrollTo() problem

Anthony Serdyukov uksus70 at gmail.com
Tue Dec 30 03:35:11 CET 2008


Thanks for attention, but I really need to correct you.

The problem is that the view in QListView::BatchedMode does the layout
in several iterations, as I've noticed in my previous post.
So, even when all events are processed the layout is not complete.

At least the experiment says so: singleShot(0) is not the solution.

2008/12/30 Malyushytsky, Alex <alex at wai.com>:
>>> Yes, I thought about it and even tried. But I don't think it's a good
> way because nobody can tell how much the delay should be.
>
> I might not see a problem, but according to my impression I know :P
> It is 0.
>
> Correct me if I am wrong.
>
> All you need is to get notified when events started before are done.
> So connecting modelReset() signal to your slot supposed to give you a good point to call QTimer::singleShot with 0 as a delay.
>
> Best regards,
> Alex
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Anthony Serdyukov
> Sent: Tuesday, December 23, 2008 9:07 PM
> To: Alan M. Carroll
> Cc: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QListView::scrollTo() problem
>
> Yes, I thought about it and even tried. But I don't think it's a good
> way because nobody can tell how much the delay should be.
>
> 2008/12/23 Alan M. Carroll <amc at network-geographics.com>:
>> QTimer::singleShot
>>
>> I use this very frequently when I have timing issues like this (not quite as handy as perform:with:afterDelay, but usable).
>>
>> At 12:01 AM 12/23/2008, Anthony Serdyukov wrote:
>>>Good day.
>>>
>>>I have QListView on my form.
>>>At start up the model for the view is empty.
>>>When user "opens document", the model is emitting modelReset() signal,
>>>and the data is queried by the view.
>>>
>>>All was going well. But now I need to scroll list view to some item
>>>during document opening. I tried to use scrollTo method, but it
>>>failed.
>>>My investigation told me that the view is still querying SizeHintRole
>>>when I call scrollTo() method.
>>>So, it cannot satisfy my request since the scrollbars range is
>>>undefined yet. But this is just my supposition.
>>>
>>>What could you suggest?
>>>
>>>--
>>>Regards,
>>>Anthony
>>>_______________________________________________
>>>Qt-interest mailing list
>>>Qt-interest at trolltech.com
>>>http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>
>
>
> --
> Regards,
> Anthony
> _______________________________________________
> 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."
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



-- 
Regards,
Anthony



More information about the Qt-interest-old mailing list