From 6387137cdb7ed76e0a16731ae580727bd41e24d1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Dec 2011 13:18:21 +0100 Subject: [PATCH] Qt Designer/QtUiLoader: Remove support for QWorkspace. Change-Id: Ic0ffb13c5d30528800c1beae85d5224e8f2f7104 Sanity-Review: Qt Sanity Bot Reviewed-by: Lars Knoll Reviewed-by: David Faure --- .../src/components/formeditor/formeditor.cpp | 3 - .../src/components/formeditor/formeditor.pri | 2 - .../components/formeditor/formwindowmanager.cpp | 2 +- .../components/formeditor/qdesigner_resource.cpp | 3 +- .../src/components/formeditor/qmdiarea_container.h | 3 - .../components/formeditor/qworkspace_container.cpp | 100 --------------------- .../components/formeditor/qworkspace_container.h | 79 ---------------- .../taskmenu/containerwidget_taskmenu.cpp | 13 --- .../components/taskmenu/containerwidget_taskmenu.h | 2 - .../src/lib/shared/qdesigner_promotion.cpp | 1 - src/designer/src/lib/shared/widgetdatabase.cpp | 3 - src/designer/src/lib/uilib/abstractformbuilder.cpp | 7 -- src/designer/src/lib/uilib/widgets.table | 3 - 13 files changed, 2 insertions(+), 219 deletions(-) delete mode 100644 src/designer/src/components/formeditor/qworkspace_container.cpp delete mode 100644 src/designer/src/components/formeditor/qworkspace_container.h diff --git a/src/designer/src/components/formeditor/formeditor.cpp b/src/designer/src/components/formeditor/formeditor.cpp index fa202a3..0618a17 100644 --- a/src/designer/src/components/formeditor/formeditor.cpp +++ b/src/designer/src/components/formeditor/formeditor.cpp @@ -48,7 +48,6 @@ #include "widgetfactory_p.h" #include "formwindowmanager.h" #include "qmainwindow_container.h" -#include "qworkspace_container.h" #include "qmdiarea_container.h" #include "qwizard_container.h" #include "default_container.h" @@ -111,7 +110,6 @@ FormEditor::FormEditor(QObject *parent) QMainWindowContainerFactory::registerExtension(mgr, containerExtensionId); QDockWidgetContainerFactory::registerExtension(mgr, containerExtensionId); QScrollAreaContainerFactory::registerExtension(mgr, containerExtensionId); - QWorkspaceContainerFactory::registerExtension(mgr, containerExtensionId); QMdiAreaContainerFactory::registerExtension(mgr, containerExtensionId); QWizardContainerFactory::registerExtension(mgr, containerExtensionId); @@ -132,7 +130,6 @@ FormEditor::FormEditor(QObject *parent) QToolBoxWidgetPropertySheetFactory::registerExtension(mgr); QTabWidgetPropertySheetFactory::registerExtension(mgr); QMdiAreaPropertySheetFactory::registerExtension(mgr); - QWorkspacePropertySheetFactory::registerExtension(mgr); QWizardPagePropertySheetFactory::registerExtension(mgr); QWizardPropertySheetFactory::registerExtension(mgr); diff --git a/src/designer/src/components/formeditor/formeditor.pri b/src/designer/src/components/formeditor/formeditor.pri index 2ec3bff..6b51561 100644 --- a/src/designer/src/components/formeditor/formeditor.pri +++ b/src/designer/src/components/formeditor/formeditor.pri @@ -24,7 +24,6 @@ HEADERS += $$PWD/qdesigner_resource.h \ $$PWD/default_container.h \ $$PWD/default_actionprovider.h \ $$PWD/qmainwindow_container.h \ - $$PWD/qworkspace_container.h \ $$PWD/qmdiarea_container.h \ $$PWD/qwizard_container.h \ $$PWD/default_layoutdecoration.h \ @@ -52,7 +51,6 @@ SOURCES += $$PWD/qdesigner_resource.cpp \ $$PWD/spacer_propertysheet.cpp \ $$PWD/line_propertysheet.cpp \ $$PWD/qmainwindow_container.cpp \ - $$PWD/qworkspace_container.cpp \ $$PWD/qmdiarea_container.cpp \ $$PWD/qwizard_container.cpp \ $$PWD/default_container.cpp \ diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp index 93b9a96..12a0cc2 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.cpp +++ b/src/designer/src/components/formeditor/formwindowmanager.cpp @@ -215,7 +215,7 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e) } if (QWidget *managedWidget = findManagedWidget(fw, widget)) { - // Prevent MDI and QWorkspace subwindows from being closed by clicking at the title bar + // Prevent MDI subwindows from being closed by clicking at the title bar if (managedWidget != widget && eventType == QEvent::Close) { e->ignore(); return true; diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 8470814..1ca1321 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -101,7 +101,6 @@ #include #include #include -#include #include #include #include @@ -1530,7 +1529,7 @@ static inline bool checkContainerProperty(const QWidget *w, const QString &prope return QTabWidgetPropertySheet::checkProperty(propertyName); if (qobject_cast(w)) return QStackedWidgetPropertySheet::checkProperty(propertyName); - if (qobject_cast(w) || qobject_cast(w)) + if (qobject_cast(w)) return QMdiAreaPropertySheet::checkProperty(propertyName); return true; } diff --git a/src/designer/src/components/formeditor/qmdiarea_container.h b/src/designer/src/components/formeditor/qmdiarea_container.h index d7bd495..c275c36 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.h +++ b/src/designer/src/components/formeditor/qmdiarea_container.h @@ -49,7 +49,6 @@ #include #include -#include QT_BEGIN_NAMESPACE @@ -79,7 +78,6 @@ private: }; // PropertySheet for QMdiArea: Fakes window title and name. -// Also works for a QWorkspace as it relies on the container extension. class QMdiAreaPropertySheet: public QDesignerPropertySheet { @@ -111,7 +109,6 @@ private: typedef ExtensionFactory QMdiAreaContainerFactory; typedef QDesignerPropertySheetFactory QMdiAreaPropertySheetFactory; -typedef QDesignerPropertySheetFactory QWorkspacePropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/qworkspace_container.cpp b/src/designer/src/components/formeditor/qworkspace_container.cpp deleted file mode 100644 index d3fde23..0000000 --- a/src/designer/src/components/formeditor/qworkspace_container.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Designer of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qworkspace_container.h" -#include "qmdiarea_container.h" - -#include - -QT_BEGIN_NAMESPACE - -namespace qdesigner_internal { - -QWorkspaceContainer::QWorkspaceContainer(QWorkspace *widget, QObject *parent) - : QObject(parent), - m_workspace(widget) -{ -} - -int QWorkspaceContainer::count() const -{ - return m_workspace->windowList(QWorkspace::CreationOrder).count(); -} - -QWidget *QWorkspaceContainer::widget(int index) const -{ - if (index < 0) - return 0; - return m_workspace->windowList(QWorkspace::CreationOrder).at(index); -} - -int QWorkspaceContainer::currentIndex() const -{ - if (QWidget *aw = m_workspace->activeWindow()) - return m_workspace->windowList(QWorkspace::CreationOrder).indexOf(aw); - return -1; -} - -void QWorkspaceContainer::setCurrentIndex(int index) -{ - m_workspace->setActiveWindow(m_workspace->windowList(QWorkspace::CreationOrder).at(index)); -} - -void QWorkspaceContainer::addWidget(QWidget *widget) -{ - QWidget *frame = m_workspace->addWindow(widget, Qt::Window); - frame->show(); - m_workspace->cascade(); - QMdiAreaContainer::positionNewMdiChild(m_workspace, frame); -} - -void QWorkspaceContainer::insertWidget(int, QWidget *widget) -{ - addWidget(widget); -} - -void QWorkspaceContainer::remove(int /* index */) -{ - // nothing to do here, reparenting to formwindow is apparently sufficient -} -} - -QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/qworkspace_container.h b/src/designer/src/components/formeditor/qworkspace_container.h deleted file mode 100644 index ce51515..0000000 --- a/src/designer/src/components/formeditor/qworkspace_container.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Qt Designer of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWORKSPACE_CONTAINER_H -#define QWORKSPACE_CONTAINER_H - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -namespace qdesigner_internal { - -class QWorkspaceContainer: public QObject, public QDesignerContainerExtension -{ - Q_OBJECT - Q_INTERFACES(QDesignerContainerExtension) -public: - explicit QWorkspaceContainer(QWorkspace *widget, QObject *parent = 0); - - virtual int count() const; - virtual QWidget *widget(int index) const; - virtual int currentIndex() const; - virtual void setCurrentIndex(int index); - virtual void addWidget(QWidget *widget); - virtual void insertWidget(int index, QWidget *widget); - virtual void remove(int index); - -private: - QWorkspace *m_workspace; -}; - -typedef ExtensionFactory QWorkspaceContainerFactory; -} // namespace qdesigner_internal - -QT_END_NAMESPACE - -#endif // QWORKSPACE_CONTAINER_H diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp index 475735c..34a770b 100644 --- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp @@ -58,7 +58,6 @@ #include #include #include -#include #include #include @@ -269,16 +268,6 @@ MdiContainerWidgetTaskMenu::MdiContainerWidgetTaskMenu(QMdiArea *m, QObject *par connect(m_cascadeAction, SIGNAL(triggered()), m, SLOT(cascadeSubWindows())); } -MdiContainerWidgetTaskMenu::MdiContainerWidgetTaskMenu(QWorkspace *m, QObject *parent) : - ContainerWidgetTaskMenu(m, MdiContainer, parent) -{ - initializeActions(); - connect(m_nextAction, SIGNAL(triggered()), m, SLOT(activateNextWindow())); - connect(m_previousAction, SIGNAL(triggered()), m, SLOT(activatePreviousWindow())); - connect(m_tileAction, SIGNAL(triggered()),m , SLOT(tile())); - connect(m_cascadeAction, SIGNAL(triggered()), m, SLOT(cascade())); -} - void MdiContainerWidgetTaskMenu::initializeActions() { m_nextAction =new QAction(tr("Next Subwindow"), this); @@ -341,8 +330,6 @@ QObject *ContainerWidgetTaskMenuFactory::createExtension(QObject *object, const if (QMdiArea* ma = qobject_cast(widget)) return new MdiContainerWidgetTaskMenu(ma, parent); - if (QWorkspace *ws = qobject_cast(widget)) - return new MdiContainerWidgetTaskMenu(ws, parent); if (QWizard *wz = qobject_cast(widget)) return new WizardContainerWidgetTaskMenu(wz, parent); return new ContainerWidgetTaskMenu(widget, PageContainer, parent); diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.h b/src/designer/src/components/taskmenu/containerwidget_taskmenu.h index 2305104..4f6aeb3 100644 --- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.h @@ -56,7 +56,6 @@ class QDesignerFormEditorInterface; class QDesignerContainerExtension; class QAction; class QMdiArea; -class QWorkspace; class QMenu; class QWizard; @@ -127,7 +126,6 @@ class MdiContainerWidgetTaskMenu : public ContainerWidgetTaskMenu { Q_OBJECT public: explicit MdiContainerWidgetTaskMenu(QMdiArea *m, QObject *parent = 0); - explicit MdiContainerWidgetTaskMenu(QWorkspace *m, QObject *parent = 0); virtual QList taskActions() const; private: diff --git a/src/designer/src/lib/shared/qdesigner_promotion.cpp b/src/designer/src/lib/shared/qdesigner_promotion.cpp index 4c3ad47..8b2a911 100644 --- a/src/designer/src/lib/shared/qdesigner_promotion.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotion.cpp @@ -67,7 +67,6 @@ namespace { rc.insert(QStringLiteral("Spacer")); rc.insert(QStringLiteral("QMainWindow")); rc.insert(QStringLiteral("QDialog")); - rc.insert(QStringLiteral("QWorkspace")); rc.insert(QStringLiteral("QMdiArea")); rc.insert(QStringLiteral("QMdiSubWindow")); } diff --git a/src/designer/src/lib/shared/widgetdatabase.cpp b/src/designer/src/lib/shared/widgetdatabase.cpp index 7c7caf8..29a9ae8 100644 --- a/src/designer/src/lib/shared/widgetdatabase.cpp +++ b/src/designer/src/lib/shared/widgetdatabase.cpp @@ -313,7 +313,6 @@ WidgetDataBase::WidgetDataBase(QDesignerFormEditorInterface *core, QObject *pare item(indexOfClassName(QStringLiteral("QDockWidget")))->setContainer(true); item(indexOfClassName(QStringLiteral("QDesignerDockWidget")))->setContainer(true); item(indexOfClassName(QStringLiteral("QMdiArea")))->setContainer(true); - item(indexOfClassName(QStringLiteral("QWorkspace")))->setContainer(true); item(indexOfClassName(QStringLiteral("QWizard")))->setContainer(true); item(indexOfClassName(QStringLiteral("QWizardPage")))->setContainer(true); @@ -508,8 +507,6 @@ static inline bool suitableForNewForm(const QString &className) { if (className.isEmpty()) // Missing custom widget information return false; - if (className == QStringLiteral("QWorkspace")) - return false; if (className == QStringLiteral("QSplitter")) return false; if (className.startsWith(QStringLiteral("QDesigner")) || className.startsWith(QStringLiteral("QLayout"))) diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index 6294619..0e0cd27 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -596,13 +596,6 @@ bool QAbstractFormBuilder::addItem(DomWidget *ui_widget, QWidget *widget, QWidge } #endif -#ifndef QT_NO_WORKSPACE - else if (QWorkspace *ws = qobject_cast(parentWidget)) { - ws->addWindow(widget); - return true; - } -#endif - #ifndef QT_NO_DOCKWIDGET else if (QDockWidget *dockWidget = qobject_cast(parentWidget)) { dockWidget->setWidget(widget); diff --git a/src/designer/src/lib/uilib/widgets.table b/src/designer/src/lib/uilib/widgets.table index 9b87278..4202139 100644 --- a/src/designer/src/lib/uilib/widgets.table +++ b/src/designer/src/lib/uilib/widgets.table @@ -106,9 +106,6 @@ DECLARE_WIDGET(QTreeView, "") DECLARE_WIDGET(QTreeWidget, "") #endif DECLARE_WIDGET(QWidget, "") -#ifndef QT_NO_WORKSPACE -DECLARE_WIDGET(QWorkspace, "") -#endif #ifndef QT_NO_SPLITTER DECLARE_WIDGET(QSplitter, "") #endif -- 2.7.4