15 #include <QDialogButtonBox> 16 #include <QPushButton> 41 Qt::UniqueConnection );
42 mStackedWidget->insertWidget( 0, panel );
43 mStackedWidget->setCurrentIndex( 0 );
48 return qobject_cast<
QgsPanelWidget*>( mStackedWidget->widget( 0 ) );
53 QWidget* widget = mStackedWidget->widget( 0 );
54 mStackedWidget->removeWidget( widget );
60 for (
int i = mStackedWidget->count(); i >= 0; i-- )
62 if (
QgsPanelWidget* panelWidget = qobject_cast<QgsPanelWidget*>( mStackedWidget->widget( i ) ) )
64 mStackedWidget->removeWidget( panelWidget );
65 if ( panelWidget->autoDelete() )
67 panelWidget->deleteLater();
70 else if (
QWidget* widget = mStackedWidget->widget( i ) )
72 mStackedWidget->removeWidget( widget );
73 widget->deleteLater();
79 this->updateBreadcrumb();
85 if ( mStackedWidget->currentIndex() == 0 )
99 int index = mStackedWidget->addWidget( panel );
100 mStackedWidget->setCurrentIndex( index );
104 this->updateBreadcrumb();
110 mStackedWidget->setCurrentIndex( mStackedWidget->currentIndex() - 1 );
111 mStackedWidget->removeWidget( panel );
117 if ( mStackedWidget->currentIndex() == 0 )
122 this->updateBreadcrumb();
125 void QgsPanelWidgetStack::updateBreadcrumb()
128 Q_FOREACH (
QString title, mTitles )
130 breadcrumb +=
QString(
" %1 >" ).
arg( title );
133 breadcrumb.
chop( 1 );
134 mTitleText->setText( breadcrumb );
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const