tools/designer/src/components/formeditor/formeditor.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the Qt Designer of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #include "formeditor.h"
00025 #include "metadatabase_p.h"
00026 #include "widgetdatabase_p.h"
00027 #include "widgetfactory_p.h"
00028 #include "formwindowmanager.h"
00029 #include "qmainwindow_container.h"
00030 #include "qdockwidget_container.h"
00031 #include "qworkspace_container.h"
00032 #include "default_container.h"
00033 #include "default_layoutdecoration.h"
00034 #include "default_actionprovider.h"
00035 #include "qlayoutwidget_propertysheet.h"
00036 #include "spacer_propertysheet.h"
00037 #include "line_propertysheet.h"
00038 #include "qtbrushmanager.h"
00039 #include "brushmanagerproxy.h"
00040 #include "iconcache.h"
00041 
00042 // sdk
00043 #include <QtDesigner/QExtensionManager>
00044 
00045 // shared
00046 #include <pluginmanager_p.h>
00047 #include <qdesigner_taskmenu_p.h>
00048 #include <qdesigner_propertysheet_p.h>
00049 #include <qdesigner_promotedwidget_p.h>
00050 
00051 using namespace qdesigner_internal;
00052 
00053 FormEditor::FormEditor(QObject *parent)
00054     : QDesignerFormEditorInterface(parent)
00055 {
00056     QDesignerPluginManager *pluginManager = new QDesignerPluginManager(this);
00057     setPluginManager(pluginManager);
00058 
00059     WidgetDataBase *widgetDatabase = new WidgetDataBase(this);
00060     setWidgetDataBase(widgetDatabase);
00061 
00062     MetaDataBase *metaDataBase = new MetaDataBase(this);
00063     setMetaDataBase(metaDataBase);
00064 
00065     WidgetFactory *widgetFactory = new WidgetFactory(this);
00066     setWidgetFactory(widgetFactory);
00067 
00068     FormWindowManager *formWindowManager = new FormWindowManager(this, this);
00069     setFormManager(formWindowManager);
00070 
00071     QExtensionManager *mgr = new QExtensionManager(this);
00072 
00073     mgr->registerExtensions(new QDesignerContainerFactory(mgr),             Q_TYPEID(QDesignerContainerExtension));
00074     mgr->registerExtensions(new QMainWindowContainerFactory(mgr),           Q_TYPEID(QDesignerContainerExtension));
00075     mgr->registerExtensions(new QDockWidgetContainerFactory(mgr),           Q_TYPEID(QDesignerContainerExtension));
00076     mgr->registerExtensions(new QWorkspaceContainerFactory(mgr),            Q_TYPEID(QDesignerContainerExtension));
00077 
00078     mgr->registerExtensions(new QDesignerLayoutDecorationFactory(mgr),      Q_TYPEID(QDesignerLayoutDecorationExtension));
00079     mgr->registerExtensions(new QDesignerActionProviderFactory(mgr),        Q_TYPEID(QDesignerActionProviderExtension));
00080 
00081     mgr->registerExtensions(new QDesignerPropertySheetFactory(mgr),         Q_TYPEID(QDesignerPropertySheetExtension));
00082     mgr->registerExtensions(new QLayoutWidgetPropertySheetFactory(mgr),     Q_TYPEID(QDesignerPropertySheetExtension));
00083     mgr->registerExtensions(new SpacerPropertySheetFactory(mgr),            Q_TYPEID(QDesignerPropertySheetExtension));
00084     mgr->registerExtensions(new LinePropertySheetFactory(mgr),              Q_TYPEID(QDesignerPropertySheetExtension));
00085     mgr->registerExtensions(new PromotedWidgetPropertySheetFactory(mgr),    Q_TYPEID(QDesignerPropertySheetExtension));
00086 
00087     mgr->registerExtensions(new QDesignerTaskMenuFactory(mgr),              Q_TYPEID(QDesignerTaskMenuExtension));
00088 
00089     setExtensionManager(mgr);
00090 
00091     setIconCache(new IconCache(this));
00092 
00093     QtBrushManager *brushManager = new QtBrushManager(this);
00094     setBrushManager(brushManager);
00095 
00096     BrushManagerProxy *brushProxy = new BrushManagerProxy(this, this);
00097     brushProxy->setBrushManager(brushManager);
00098 }
00099 
00100 FormEditor::~FormEditor()
00101 {
00102     delete formWindowManager();
00103 }

Generated on Thu Mar 15 12:01:00 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1