diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2009-06-17 09:48:22 (GMT) |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-06-17 09:48:22 (GMT) |
commit | c4551c5df74bcd7e6166ce502832704b9495c685 (patch) | |
tree | 444d8000a624912828be8c9edcca02396be7c84d /tools/designer/src | |
parent | b14ae565a95e26a0ca2890c3c438207aa6a4722f (diff) | |
download | Qt-c4551c5df74bcd7e6166ce502832704b9495c685.zip Qt-c4551c5df74bcd7e6166ce502832704b9495c685.tar.gz Qt-c4551c5df74bcd7e6166ce502832704b9495c685.tar.bz2 |
Fixed an oversight in Qt Designer that prevents one from designing empty tab widgets.
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tools/designer/src')
-rw-r--r-- | tools/designer/src/lib/shared/qdesigner_tabwidget.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp index 22833b3..eb4dfa2 100644 --- a/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/tools/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -368,7 +368,7 @@ QMenu *QTabWidgetEventFilter::addContextMenuActions(QMenu *popup) { QMenu *pageMenu = 0; const int count = m_tabWidget->count(); - m_actionDeletePage->setEnabled(count > 1); + m_actionDeletePage->setEnabled(count); if (count) { const int currentIndex = m_tabWidget->currentIndex(); const QString pageSubMenuLabel = tr("Page %1 of %2").arg(currentIndex + 1).arg(count); @@ -381,11 +381,13 @@ QMenu *QTabWidgetEventFilter::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->addSeparator(); return pageMenu; } |