From: stv Date: Mon, 6 Jun 2005 10:38:33 +0000 (+0000) Subject: no message X-Git-Tag: T3_0_0_a2~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f5cc8ed72e4e36a40bb39dd51a848c0fdc6906a3;p=modules%2Fgui.git no message --- diff --git a/src/Qtx/QtxListView.cxx b/src/Qtx/QtxListView.cxx index ad8be3cfd..2ae608b74 100755 --- a/src/Qtx/QtxListView.cxx +++ b/src/Qtx/QtxListView.cxx @@ -127,7 +127,17 @@ void QtxListView::show() void QtxListView::resizeContents( int w, int h ) { +/* + if ( myButton && myButton->isVisibleTo( myButton->parentWidget() ) ) + { + if ( header()->orientation() == Qt::Horizontal ) + w += myButton->width(); + else + h += myButton->width(); + } +*/ QListView::resizeContents( w, h ); + onHeaderResized(); } @@ -143,7 +153,7 @@ void QtxListView::hide( int ind ) bool QtxListView::isShown( int ind ) const { - if( ind>=0 && indcount() ) + if ( ind>=0 && indcount() ) return columnWidth( ind ) > 0 || header()->isResizeEnabled( ind ); else return false; @@ -154,12 +164,15 @@ void QtxListView::setShown( int ind, bool sh ) if( ind<0 || ind>=header()->count() || isShown( ind )==sh ) return; - ColumnData& data = myColumns[ ind ]; - if( sh ) + ColumnData& data = myColumns[ind]; + if ( sh ) { - setColumnWidth( ind, data.width ); - header()->setResizeEnabled( data.resizeable, ind ); + int w = data.width; + bool resizeable = data.resizeable; myColumns.remove( ind ); + + setColumnWidth( ind, w ); + header()->setResizeEnabled( resizeable, ind ); } else { @@ -171,6 +184,11 @@ void QtxListView::setShown( int ind, bool sh ) updateContents(); } +void QtxListView::setColumnWidth( int c, int w ) +{ + QListView::setColumnWidth( c, !myColumns.contains( c ) ? w : 0 ); +} + QSize QtxListView::sizeHint() const { QSize sz = QListView::sizeHint(); @@ -222,7 +240,7 @@ void QtxListView::onHeaderResized() if ( myHeaderState == HeaderButton ) { - if( header()->orientation() == Qt::Horizontal ) + if ( header()->orientation() == Qt::Horizontal ) myButton->move( lw+x, lw ); else myButton->move( lw, lw+x );