21 : QTabWidget( parent )
31 mSetTabVisibleFlag =
true;
32 removeTab( info.sourceIndex );
34 mSetTabVisibleFlag =
false;
44 mSetTabVisibleFlag =
true;
45 insertTab( info.sourceIndex + 1, info.widget, info.label );
47 mSetTabVisibleFlag =
false;
62 Q_FOREACH (
const TabInformation &info, mTabs )
64 if ( info.widget == widget )
73 if ( !mSetTabVisibleFlag )
75 QWidget *newWidget = widget( index );
79 mTabs.insert( 0, TabInformation( newWidget, tabText( index ) ) );
83 bool inserted =
false;
84 QList<TabInformation>::iterator it;
86 for ( it = mTabs.begin(); it != mTabs.end(); ++it )
88 if ( it->sourceIndex == index )
90 mTabs.insert( it, TabInformation( newWidget, tabText( index ) ) );
98 mTabs.append( TabInformation( newWidget, tabText( index ) ) );
103 synchronizeIndexes();
108 if ( !mSetTabVisibleFlag )
110 QList<TabInformation>::iterator it;
112 for ( it = mTabs.begin(); it != mTabs.end(); ++it )
114 if ( it->sourceIndex == index )
116 mTabs.removeOne( *it );
122 synchronizeIndexes();
125 void QgsTabWidget::synchronizeIndexes()
129 QWidget *nextWidget = widget( 0 );
131 QList<TabInformation>::iterator it;
133 for ( it = mTabs.begin(); it != mTabs.end(); ++it )
135 if ( it->widget == nextWidget )
138 nextWidget = widget( i + 1 );
141 QgsDebugMsg( QStringLiteral(
"Tab %1 (%2): %3" ).arg( it->sourceIndex ).arg( it->label ).arg( i ) );
145 QgsTabWidget::TabInformation QgsTabWidget::tabInfo( QWidget *widget )
147 Q_FOREACH (
const TabInformation &info, mTabs )
149 if ( info.widget == widget )
152 return TabInformation();
157 return other.widget == widget && other.sourceIndex == sourceIndex;
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)