diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2009-06-17 09:48:21 (GMT) |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-06-17 09:48:21 (GMT) |
commit | b14ae565a95e26a0ca2890c3c438207aa6a4722f (patch) | |
tree | 4d11515c548b0f166ce0fcd9790b21b100c97374 /tools/designer | |
parent | fa8030a935acaacee570eee320e7510a4cfdc853 (diff) | |
download | Qt-b14ae565a95e26a0ca2890c3c438207aa6a4722f.zip Qt-b14ae565a95e26a0ca2890c3c438207aa6a4722f.tar.gz Qt-b14ae565a95e26a0ca2890c3c438207aa6a4722f.tar.bz2 |
Fixed an oversight in Qt Designer that prevents one from designing empty stacked widgets.
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tools/designer')
-rw-r--r-- | tools/designer/src/lib/shared/qdesigner_stackedbox.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp b/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp index 38b1d7c..0b45b7b 100644 --- a/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp +++ b/tools/designer/src/lib/shared/qdesigner_stackedbox.cpp @@ -315,7 +315,7 @@ QMenu *QStackedWidgetEventFilter::addContextMenuActions(QMenu *popup) QMenu *pageMenu = 0; const int count = stackedWidget()->count(); const bool hasSeveralPages = count > 1; - m_actionDeletePage->setEnabled(hasSeveralPages); + m_actionDeletePage->setEnabled(count); if (count) { const QString pageSubMenuLabel = tr("Page %1 of %2").arg(stackedWidget()->currentIndex() + 1).arg(count); pageMenu = popup->addMenu(pageSubMenuLabel); @@ -327,10 +327,13 @@ QMenu *QStackedWidgetEventFilter::addContextMenuActions(QMenu *popup) qdesigner_internal::PromotionTaskMenu::SuppressGlobalEdit, pageMenu); } + QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); + insertPageMenu->addAction(m_actionInsertPageAfter); + insertPageMenu->addAction(m_actionInsertPage); + } else { + QAction *insertPageAction = popup->addAction(tr("Insert Page")); + connect(insertPageAction, SIGNAL(triggered()), this, SLOT(addPage())); } - QMenu *insertPageMenu = popup->addMenu(tr("Insert Page")); - insertPageMenu->addAction(m_actionInsertPageAfter); - insertPageMenu->addAction(m_actionInsertPage); popup->addAction(m_actionNextPage); m_actionNextPage->setEnabled(hasSeveralPages); popup->addAction(m_actionPreviousPage); |