diff options
author | J-P Nurmi <jpnurmi@gmail.com> | 2009-06-17 11:48:22 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-06-17 11:48:22 +0200 |
commit | c4551c5df74bcd7e6166ce502832704b9495c685 (patch) | |
tree | 444d8000a624912828be8c9edcca02396be7c84d /tools | |
parent | b14ae565a95e26a0ca2890c3c438207aa6a4722f (diff) | |
download | qt4-tools-c4551c5df74bcd7e6166ce502832704b9495c685.tar.gz |
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')
-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 22833b36ec..eb4dfa258c 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; } |