#include <multipagewidget.h>
Inheritance diagram for MultiPageWidget:


Definition at line 33 of file multipagewidget.h.
Public Slots | |
| void | setCurrentIndex (int index) |
Signals | |
| void | currentIndexChanged (int index) |
| void | pageTitleChanged (const QString &title) |
Public Member Functions | |
| MultiPageWidget (QWidget *parent=0) | |
| QSize | sizeHint () const |
| void | addPage (QWidget *page) |
| void | removePage (int index) |
| int | count () const |
| int | currentIndex () const |
| void | insertPage (int index, QWidget *page) |
| QWidget * | widget (int index) |
| QString | pageTitle () const |
| void | setPageTitle (QString const &newTitle) |
Private Attributes | |
| QStackedWidget * | stackWidget |
| QComboBox * | comboBox |
| QVBoxLayout * | layout |
| MultiPageWidget::MultiPageWidget | ( | QWidget * | parent = 0 |
) |
Definition at line 28 of file multipagewidget.cpp.
References QLayout::addWidget(), comboBox, QObject::connect(), QWidget::layout(), setCurrentIndex(), QWidget::setLayout(), QObject::setObjectName(), SIGNAL, SLOT, and stackWidget.
00029 : QWidget(parent) 00030 { 00031 comboBox = new QComboBox(); 00032 comboBox->setObjectName("__qt__passive_comboBox"); 00033 stackWidget = new QStackedWidget(); 00034 00035 connect(comboBox, SIGNAL(activated(int)), 00036 this, SLOT(setCurrentIndex(int))); 00037 00038 layout = new QVBoxLayout(); 00039 layout->addWidget(comboBox); 00040 layout->addWidget(stackWidget); 00041 setLayout(layout); 00042 }
Here is the call graph for this function:

| QSize MultiPageWidget::sizeHint | ( | ) | const [virtual] |
Reimplemented from QWidget.
Definition at line 44 of file multipagewidget.cpp.
00045 { 00046 return QSize(200, 150); 00047 }
| void MultiPageWidget::addPage | ( | QWidget * | page | ) |
Definition at line 49 of file multipagewidget.cpp.
References count(), and insertPage().
Referenced by MultiPageWidgetContainerExtension::addWidget().
00050 { 00051 insertPage(count(), page); 00052 }
Here is the call graph for this function:

| void MultiPageWidget::removePage | ( | int | index | ) |
Definition at line 54 of file multipagewidget.cpp.
References comboBox, QComboBox::removeItem(), QStackedWidget::removeWidget(), stackWidget, QStackedWidget::widget(), and widget().
Referenced by MultiPageWidgetContainerExtension::remove().
00055 { 00056 QWidget *widget = stackWidget->widget(index); 00057 stackWidget->removeWidget(widget); 00058 00059 comboBox->removeItem(index); 00060 }
Here is the call graph for this function:

| int MultiPageWidget::count | ( | ) | const |
Definition at line 62 of file multipagewidget.cpp.
References QStackedWidget::count(), and stackWidget.
Referenced by addPage(), and MultiPageWidgetContainerExtension::count().
00063 { 00064 return stackWidget->count(); 00065 }
Here is the call graph for this function:

| int MultiPageWidget::currentIndex | ( | ) | const |
Definition at line 67 of file multipagewidget.cpp.
References QStackedWidget::currentIndex(), and stackWidget.
Referenced by MultiPageWidgetContainerExtension::currentIndex(), MultiPageWidgetPlugin::pageTitleChanged(), setCurrentIndex(), and setPageTitle().
00068 { 00069 return stackWidget->currentIndex(); 00070 }
Here is the call graph for this function:

| void MultiPageWidget::insertPage | ( | int | index, | |
| QWidget * | page | |||
| ) |
Definition at line 72 of file multipagewidget.cpp.
References QString::arg(), comboBox, QComboBox::count(), QComboBox::insertItem(), QStackedWidget::insertWidget(), QString::isEmpty(), QWidget::setParent(), QWidget::setWindowTitle(), stackWidget, and QWidget::windowTitle().
Referenced by addPage(), and MultiPageWidgetContainerExtension::insertWidget().
00073 { 00074 page->setParent(stackWidget); 00075 00076 stackWidget->insertWidget(index, page); 00077 00078 QString title = page->windowTitle(); 00079 if (title.isEmpty()) { 00080 title = tr("Page %1").arg(comboBox->count() + 1); 00081 page->setWindowTitle(title); 00082 } 00083 comboBox->insertItem(index, title); 00084 }
Here is the call graph for this function:

| QWidget * MultiPageWidget::widget | ( | int | index | ) |
Definition at line 95 of file multipagewidget.cpp.
References stackWidget, and QStackedWidget::widget().
Referenced by MultiPageWidgetPlugin::pageTitleChanged(), removePage(), and MultiPageWidgetContainerExtension::widget().
00096 { 00097 return stackWidget->widget(index); 00098 }
Here is the call graph for this function:

| QString MultiPageWidget::pageTitle | ( | ) | const |
Definition at line 100 of file multipagewidget.cpp.
References QStackedWidget::currentWidget(), stackWidget, and QWidget::windowTitle().
00101 { 00102 return stackWidget->currentWidget()->windowTitle(); 00103 }
Here is the call graph for this function:

| void MultiPageWidget::setPageTitle | ( | QString const & | newTitle | ) |
Definition at line 105 of file multipagewidget.cpp.
References comboBox, currentIndex(), QStackedWidget::currentWidget(), emit, pageTitleChanged(), QComboBox::setItemText(), QWidget::setWindowTitle(), and stackWidget.
00106 { 00107 comboBox->setItemText(currentIndex(), newTitle); 00108 stackWidget->currentWidget()->setWindowTitle(newTitle); 00109 emit pageTitleChanged(newTitle); 00110 }
Here is the call graph for this function:

| void MultiPageWidget::setCurrentIndex | ( | int | index | ) | [slot] |
Definition at line 86 of file multipagewidget.cpp.
References comboBox, currentIndex(), currentIndexChanged(), emit, QStackedWidget::setCurrentIndex(), QComboBox::setCurrentIndex(), and stackWidget.
Referenced by MultiPageWidget(), and MultiPageWidgetContainerExtension::setCurrentIndex().
00087 { 00088 if (index != currentIndex()) { 00089 stackWidget->setCurrentIndex(index); 00090 comboBox->setCurrentIndex(index); 00091 emit currentIndexChanged(index); 00092 } 00093 }
| void MultiPageWidget::currentIndexChanged | ( | int | index | ) | [signal] |
Referenced by setCurrentIndex().
| void MultiPageWidget::pageTitleChanged | ( | const QString & | title | ) | [signal] |
Referenced by setPageTitle().
QStackedWidget* MultiPageWidget::stackWidget [private] |
Definition at line 62 of file multipagewidget.h.
Referenced by count(), currentIndex(), insertPage(), MultiPageWidget(), pageTitle(), removePage(), setCurrentIndex(), setPageTitle(), and widget().
QComboBox* MultiPageWidget::comboBox [private] |
Definition at line 63 of file multipagewidget.h.
Referenced by insertPage(), MultiPageWidget(), removePage(), setCurrentIndex(), and setPageTitle().
QVBoxLayout* MultiPageWidget::layout [private] |
Definition at line 64 of file multipagewidget.h.
1.5.1