void KNMusicTreeViewBase::resetHeaderState() { //Hide all column first. for(int i=Name+1; i<MusicDataCount; i++) { setColumnHidden(i, true); } //Show the default columns. setColumnHidden(Time, false); setColumnHidden(Artist, false); setColumnHidden(Album, false); setColumnHidden(Genre, false); setColumnHidden(Rating, false); //Reorder the columns. moveToFirst(Rating); moveToFirst(Genre); moveToFirst(Album); moveToFirst(Artist); moveToFirst(Time); moveToFirst(Name); //Set the default width. setColumnWidth(Genre, 81); setColumnWidth(Album, 126); setColumnWidth(Artist, 126); setColumnWidth(Time, 60); setColumnWidth(Name, 200); }
MainWidget::MainWidget( QWidget* parent, const char* name ) : QSplitter( parent, name ), m_dirty( false ), m_wrapText( false ) { m_scanStack = new ScanStack( this, "scan stack" ); m_htmlWidget = new HTMLWidget( &m_stylesheetURLs, this, "html widget" ); m_indexWidget = new IndexWidget( m_scanStack, this, "index widget" ); moveToFirst( m_indexWidget ); m_scanStack->appendHTMLWidget( m_htmlWidget ); setOpaqueResize( true ); QTimer::singleShot( 0, this, SLOT( slotFinaliseInitialisation( ))); connect( m_htmlWidget, SIGNAL( errorLoadingLocalManPage( const QString& )), SLOT( slotErrorLoadingLocalManPage( const QString& ))); connect( m_indexWidget, SIGNAL( visibleScanWidgetChanged( ScanWidget* )), SLOT( slotVisibleScanWidgetChanged( ScanWidget* ))); }
void KNMusicAlbumSongListView::resetHeader() { connect(header(), &QHeaderView::sortIndicatorChanged, this, &KNMusicAlbumSongListView::onActionSort); for(int i=KNMusicGlobal::Name+1; i<KNMusicGlobal::MusicDataCount; i++) { setColumnHidden(i, true); } setColumnHidden(KNMusicGlobal::Time, false); setColumnHidden(KNMusicGlobal::Artist, false); setColumnHidden(KNMusicGlobal::Genre, false); setColumnHidden(KNMusicGlobal::Rating, false); setColumnHidden(KNMusicGlobal::TrackNumber, false); moveToFirst(KNMusicGlobal::Rating); moveToFirst(KNMusicGlobal::Genre); moveToFirst(KNMusicGlobal::Artist); moveToFirst(KNMusicGlobal::Time); moveToFirst(KNMusicGlobal::Name); moveToFirst(KNMusicGlobal::TrackNumber); }