C++ (Qt)int hw = 2 * tw->frameWidth();for( int i = 0; i < tw->columnCount(); i++ ){ if( tw->isColumnHidden( i ) ) continue; // if we want to maximize column tw->resizeColumnToContents( i ); hw += tw->columnWidth( i );}