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();
}
bool QtxListView::isShown( int ind ) const
{
- if( ind>=0 && ind<header()->count() )
+ if ( ind>=0 && ind<header()->count() )
return columnWidth( ind ) > 0 || header()->isResizeEnabled( ind );
else
return false;
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
{
updateContents();
}
+void QtxListView::setColumnWidth( int c, int w )
+{
+ QListView::setColumnWidth( c, !myColumns.contains( c ) ? w : 0 );
+}
+
QSize QtxListView::sizeHint() const
{
QSize sz = QListView::sizeHint();
if ( myHeaderState == HeaderButton )
{
- if( header()->orientation() == Qt::Horizontal )
+ if ( header()->orientation() == Qt::Horizontal )
myButton->move( lw+x, lw );
else
myButton->move( lw, lw+x );