[Issue N7298] [PATCH] QListBox ensureCurrentVisible() brokenness...
qt-bugs at trolltech.com
qt-bugs at trolltech.com
Tue Oct 1 10:48:52 BST 2002
On Monday, 30 Sep 2002 20:23 Scott Wheeler wrote:
> On Monday 30 September 2002 15:31, qt-bugs at trolltech.com wrote:
>
> > The following has been applied to Qt. Thanks for reporting this one.
> <snip>
>
> This *mostly* fixes the problem, but still misses at least one case.
> If you
> resize the widget, the same problem of scrolling back to the selected
> item
> happens. (My patch did address that.) In the test case that I sent,
> try
> starting it up, selecting the first item, scrolling down to the
> bottem, and
> then resizing the window.
>
> More realistically, I'm using a KListBox with a slider in between the
> listbox
> and other widgets, so it's a common case that the listbox is
> resized...
>
> Cheers,
>
> -Scott
Hi Scott
I had actuall applied this one as well. Just did it in two goes so I
forgot to attach it
@@ -3950,9 +3950,11 @@
if ( d->resizeTimer->isActive() )
d->resizeTimer->stop();
if ( d->rowMode == FixedNumber && d->columnMode == FixedNumber ) {
+ bool currentItemVisible = itemVisible( currentItem() );
doLayout();
QScrollView::resizeEvent( e );
- ensureCurrentVisible();
+ if ( currentItemVisible )
+ ensureCurrentVisible();
if ( d->current )
viewport()->repaint( itemRect( d->current ), FALSE );
} else if ( ( d->columnMode == FitToWidth || d->rowMode == FitToHeight ) && !(isVisible()) ) {
best regards
Anders Bakken - Trolltech AS, W. Thranes gt. 98, N-0175 Oslo, Norway
More information about the kde-core-devel
mailing list