diff options
author | Eike Ziller <eike.ziller@nokia.com> | 2012-01-26 17:40:25 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@nokia.com> | 2012-01-27 13:57:47 +0100 |
commit | 6bfb79322db486e1b5a18b7d752ad152413263c4 (patch) | |
tree | e384131827ebd6b90e234f39d229865111778b91 /doc/pluginhowto/examples/wizard | |
parent | 591754be7e6770bdec7cd985c163c4c76ab06ecb (diff) | |
download | qt-creator-6bfb79322db486e1b5a18b7d752ad152413263c4.tar.gz |
Remove old, never-finished, outdated howto draft.
This is slowly being replaced by the "Extending Qt Creator Manual"
(source in doc/api, 'make docs' generates it in doc/html-dev)
Change-Id: I38e92b5b3b6d41e03fcccee5c299a3aebc5ed354
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'doc/pluginhowto/examples/wizard')
18 files changed, 0 insertions, 948 deletions
diff --git a/doc/pluginhowto/examples/wizard/customproject/CustomProject.pluginspec b/doc/pluginhowto/examples/wizard/customproject/CustomProject.pluginspec deleted file mode 100644 index 755f91acd7..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/CustomProject.pluginspec +++ /dev/null @@ -1,10 +0,0 @@ -<plugin name="CustomProject" version="0.0.1"> - <vendor>FooCompanyInc</vendor> - <copyright></copyright> - <license></license> - <description>{{PLUGIN_DESCRIPTION}}</description> - <url>http://www.FooCompanyInc.com</url> - <dependencyList> - <dependency name="Core"/> - </dependencyList> -</plugin> diff --git a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.cpp b/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.cpp deleted file mode 100644 index 75f8ffedca..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#include "customprojectplugin.h" -#include "customprojectwizard.h" - -#include <QtPlugin> -#include <QStringList> - -CustomProjectPlugin::CustomProjectPlugin() -{ - // Do nothing -} - -void CustomProjectPlugin::extensionsInitialized() -{ - // Do nothing -} - -bool CustomProjectPlugin::initialize(const QStringList &args, QString *errorMessage) -{ - Q_UNUSED(args); - Q_UNUSED(errorMessage); - - addAutoReleasedObject(new CustomProjectWizard); - - return true; -} - -void CustomProjectPlugin::shutdown() -{ - // Do nothing -} - -Q_EXPORT_PLUGIN(CustomProjectPlugin) diff --git a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.h b/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.h deleted file mode 100644 index 8defce3606..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.h +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#ifndef CUSTOMPROJECT_PLUGIN_H -#define CUSTOMPROJECT_PLUGIN_H - -#include <extensionsystem/iplugin.h> - -class CustomProjectPlugin : public ExtensionSystem::IPlugin -{ -public: - CustomProjectPlugin(); - - void extensionsInitialized(); - bool initialize(const QStringList &arguments, QString *errorString); - void shutdown(); -}; - -#endif // CUSTOMPROJECT_PLUGIN_H - diff --git a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.pro b/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.pro deleted file mode 100644 index 07a5239be4..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/customprojectplugin.pro +++ /dev/null @@ -1,20 +0,0 @@ -#QTC_SOURCE = C:/Work/QtCreator -#QTC_BUILD = C:/Work/QtCreator/build -QTC_SOURCE = ../../../../.. -QTC_BUILD = ../../../../.. -TEMPLATE = lib -TARGET = CustomProject -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD -PROVIDER = FooCompanyInc - -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) - -LIBS += -L$$IDE_PLUGIN_PATH/Nokia - -HEADERS = customprojectplugin.h \ - customprojectwizard.h -SOURCES = customprojectplugin.cpp \ - customprojectwizard.cpp -OTHER_FILES = CustomProject.pluginspec diff --git a/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.cpp b/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.cpp deleted file mode 100644 index cbd4e1610b..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#include "customprojectwizard.h" - -#include <QMessageBox> -#include <QApplication> -#include <QIcon> - -CustomProjectWizard::CustomProjectWizard() -{ -} - -Core::IWizard::Kind CustomProjectWizard::kind() const -{ - return IWizard::ProjectWizard; -} - -QIcon CustomProjectWizard::icon() const -{ - return qApp->windowIcon(); -} - -QString CustomProjectWizard::description() const -{ - return "A custom project"; -} - -QString CustomProjectWizard::displayName() const -{ - return tr("CustomProject"); -} - -QString CustomProjectWizard::category() const -{ - return "FooCompanyInc"; -} - -QString CustomProjectWizard::trCategory() const -{ - return tr("FooCompanyInc"); -} - -void CustomProjectWizard::runWizard(const QString &path, QWidget *parent) -{ - Q_UNUSED(path); - Q_UNUSED(parent); - QMessageBox::information(parent, "Custom Wizard Dialog", "Hi there!"); -} diff --git a/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.h b/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.h deleted file mode 100644 index 3d5864899b..0000000000 --- a/doc/pluginhowto/examples/wizard/customproject/customprojectwizard.h +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#ifndef CUSTOMPROJECTWIZARD_H -#define CUSTOMPROJECTWIZARD_H - -#include <coreplugin/dialogs/iwizard.h> - -class CustomProjectWizard : public Core::IWizard -{ -public: - CustomProjectWizard(); - - Core::IWizard::Kind kind() const; - QIcon icon() const; - QString description() const; - QString displayName() const; - QString category() const; - QString trCategory() const; - void runWizard(const QString &path, QWidget *parent); -}; - -#endif // CUSTOMPROJECTWIZARD_H diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelHeader.txt b/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelHeader.txt deleted file mode 100644 index 3bca49049b..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelHeader.txt +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef {{UPPER_CLASS_NAME}}_H -#define {{UPPER_CLASS_NAME}}_H - -#include <{{BASE_CLASS_NAME}}> - -struct {{CLASS_NAME}}Data; - -class {{CLASS_NAME}} : public {{BASE_CLASS_NAME}} -{ - Q_OBJECT - -public: - {{CLASS_NAME}}(QObject* parent=0); - ~{{CLASS_NAME}}(); - int rowCount(const QModelIndex& parent) const; - QVariant data(const QModelIndex& index, int role) const; - -private: - {{CLASS_NAME}}Data* d; -}; - -#endif // {{UPPER_CLASS_NAME}}_H diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelSource.txt b/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelSource.txt deleted file mode 100644 index 3a5ba8abd4..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelSource.txt +++ /dev/null @@ -1,23 +0,0 @@ -#include <{{CLASS_HEADER}}> - -struct {{CLASS_NAME}}Data -{ -}; - -{{CLASS_NAME}}::{{CLASS_NAME}}(QObject* parent) - :{{BASE_CLASS_NAME}}(parent) -{ - d = {{CLASS_NAME}}Data; -} - -{{CLASS_NAME}}::~{{CLASS_NAME}}() -{ -} - -int {{CLASS_NAME}}::rowCount(const QModelIndex& parent) const -{ -} - -QVariant {{CLASS_NAME}}::data(const QModelIndex& index, int role) const -{ -} diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelWizard.pluginspec b/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelWizard.pluginspec deleted file mode 100644 index 1ffcd88109..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/ItemModelWizard.pluginspec +++ /dev/null @@ -1,10 +0,0 @@ -<plugin name="ItemModelWizard" version="0.0.1"> - <vendor>FooCompanyInc</vendor> - <copyright></copyright> - <license></license> - <description>{{PLUGIN_DESCRIPTION}}</description> - <url>http://www.FooCompanyInc.com</url> - <dependencyList> - <dependency name="Core"/> - </dependencyList> -</plugin> diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.cpp b/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.cpp deleted file mode 100644 index 241980514b..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#include "itemmodelwizardplugin.h" -#include "modelclasswizard.h" - -#include <QApplication> -#include <QIcon> -#include <QtPlugin> -#include <QStringList> - -ItemModelWizardPlugin::ItemModelWizardPlugin() -{ - // Do nothing -} - -ItemModelWizardPlugin::~ItemModelWizardPlugin() -{ - // Do notning -} - -void ItemModelWizardPlugin::extensionsInitialized() -{ - // Do nothing -} - -bool ItemModelWizardPlugin::initialize(const QStringList &args, QString *errorMessage) -{ - Q_UNUSED(args); - Q_UNUSED(errorMessage); - Core::BaseFileWizardParameters params; - params.setKind(Core::IWizard::ClassWizard); - params.setIcon(qApp->windowIcon()); - params.setDescription("Generates an item-model class"); - params.setName("Item Model"); - params.setCategory("FooCompany"); - params.setTrCategory(tr("FooCompany")); - addAutoReleasedObject(new ModelClassWizard(params, this)); - return true; - -} - -void ItemModelWizardPlugin::shutdown() -{ - // Do nothing -} - -Q_EXPORT_PLUGIN(ItemModelWizardPlugin) diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.h b/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.h deleted file mode 100644 index fc8779b11d..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.h +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#ifndef ITEMMODELWIZARD_PLUGIN_H -#define ITEMMODELWIZARD_PLUGIN_H - -#include <extensionsystem/iplugin.h> - -class ItemModelWizardPlugin : public ExtensionSystem::IPlugin -{ -public: - ItemModelWizardPlugin(); - ~ItemModelWizardPlugin(); - - void extensionsInitialized(); - bool initialize(const QStringList &arguments, QString *errorString); - void shutdown(); -}; - -#endif // ITEMMODELWIZARD_PLUGIN_H - diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.pro b/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.pro deleted file mode 100644 index ce0bb00b15..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/itemmodelwizardplugin.pro +++ /dev/null @@ -1,27 +0,0 @@ -#QTC_SOURCE = C:/Work/QtCreator -#QTC_BUILD = C:/Work/QtCreator/build -QTC_SOURCE = ../../../../.. -QTC_BUILD = ../../../../.. -TEMPLATE = lib -TARGET = ItemModelWizard -IDE_SOURCE_TREE = $$QTC_SOURCE -IDE_BUILD_TREE = $$QTC_BUILD -PROVIDER = FooCompanyInc - -include($$QTC_SOURCE/src/qtcreatorplugin.pri) -include($$QTC_SOURCE/src/plugins/coreplugin/coreplugin.pri) -include($$QTC_SOURCE/src/plugins/texteditor/texteditor.pri) -include($$QTC_SOURCE/src/plugins/cppeditor/cppeditor.pri) - -LIBS += -L$$IDE_PLUGIN_PATH/Nokia - -HEADERS = itemmodelwizardplugin.h \ - modelnamepage.h \ - modelclasswizard.h -SOURCES = itemmodelwizardplugin.cpp \ - modelnamepage.cpp \ - modelclasswizard.cpp -OTHER_FILES = ItemModelWizard.pluginspec -FORMS += modelnamepage.ui - -RESOURCES += template.qrc diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.cpp b/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.cpp deleted file mode 100644 index 16880d1724..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#include "modelclasswizard.h" -#include "modelnamepage.h" - -#include <cppeditor/cppeditor.h> -#include <cppeditor/cppeditorconstants.h> -#include <coreplugin/basefilewizard.h> - -#include <QFile> -#include <QFileInfo> - -ModelClassWizard::ModelClassWizard(const Core::BaseFileWizardParameters ¶meters, QObject *parent) - : Core::BaseFileWizard(parameters, parent) -{ -} - -QWizard *ModelClassWizard::createWizardDialog(QWidget *parent, - const QString &defaultPath, const WizardPageList &extensionPages) const -{ - // Create a wizard - QWizard *wizard = new QWizard(parent); - wizard->setWindowTitle(tr("Model Class Wizard")); - - // Make our page as first page - ModelNamePage *page = new ModelNamePage(wizard); - int pageId = wizard->addPage(page); - wizard->setProperty("_PageId_", pageId); - page->setPath(defaultPath); - - // Now add the remaining pages - foreach (QWizardPage *p, extensionPages) - wizard->addPage(p); - return wizard; -} - -QString ModelClassWizard::readFile(const QString& fileName, - const QMap<QString,QString> & replacementMap) const -{ - QFile file(fileName); - file.open(QFile::ReadOnly); - QString result = file.readAll(); - QMap<QString,QString>::const_iterator it = replacementMap.begin(); - QMap<QString,QString>::const_iterator end = replacementMap.end(); - - for (; it != end; ++it) - result.replace(it.key(), it.value()); - return result; -} - -Core::GeneratedFiles ModelClassWizard::generateFiles - (const QWizard *wizard, QString *errorMessage) const -{ - Q_UNUSED(errorMessage); - Core::GeneratedFiles ret; - int pageId = wizard->property("_PageId_").toInt(); - ModelNamePage *page = qobject_cast<ModelNamePage*>(wizard->page(pageId)); - - if (!page) - return ret; - ModelClassParameters params = page->parameters(); - QMap<QString,QString> replacementMap; - - replacementMap["{{UPPER_CLASS_NAME}}"] = params.className.toUpper(); - replacementMap["{{BASE_CLASS_NAME}}"] = params.baseClass; - replacementMap["{{CLASS_NAME}}"] = params.className; - replacementMap["{{CLASS_HEADER}}"] = QFileInfo(params.headerFile).fileName(); - - Core::GeneratedFile headerFile(params.path + '/' + params.headerFile); - headerFile.setEditorKind(CppEditor::Constants::CPPEDITOR_KIND); - - Core::GeneratedFile sourceFile(params.path + '/' + params.sourceFile); - sourceFile.setEditorKind(CppEditor::Constants::CPPEDITOR_KIND); - - if (params.baseClass == "QAbstractItemModel") { - headerFile.setContents(readFile(":/CustomProject/ItemModelHeader", replacementMap)); - sourceFile.setContents(readFile(":/CustomProject/ItemModelSource", replacementMap)); - } - - else if (params.baseClass == "QAbstractTableModel") { - headerFile.setContents(readFile(":/CustomProject/TableModelHeader", replacementMap)); - sourceFile.setContents(readFile(":/CustomProject/TableModelSource", replacementMap)); - } - - else if (params.baseClass == "QAbstractListModel") { - headerFile.setContents(readFile(":/CustomProject/ListModelHeader", replacementMap)); - sourceFile.setContents(readFile(":/CustomProject/ListModelSource", replacementMap)); - } - - ret << headerFile << sourceFile; - return ret; -} diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.h b/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.h deleted file mode 100644 index ad4b279b9b..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelclasswizard.h +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#ifndef MODELCLASSWIZARD_H -#define MODELCLASSWIZARD_H - -#include <coreplugin/basefilewizard.h> - -#include <QMap> - -class ModelClassWizard : public Core::BaseFileWizard -{ - Q_OBJECT - -public: - explicit ModelClassWizard(const Core::BaseFileWizardParameters ¶meters, QObject *parent = 0); - - QWizard *createWizardDialog(QWidget *parent, const QString &defaultPath, - const WizardPageList &extensionPages) const; - - Core::GeneratedFiles generateFiles(const QWizard *w, QString *errorMessage) const; - -private: - QString readFile(const QString &fileName, - const QMap<QString, QString> &replacementMap) const; -}; - -#endif // MODELCLASSWIZARD_H diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.cpp b/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.cpp deleted file mode 100644 index 3cb051cf1a..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#include "modelnamepage.h" - -ModelNamePage::ModelNamePage(QWidget *parent) - : QWizardPage(parent) -{ - setTitle("Enter model class information"); - setSubTitle("The header and source file names will be derived from the class name"); - ui.setupUi(this); -} - -void ModelNamePage::setPath(const QString &path) -{ - this->path = path; -} - -void ModelNamePage::on_txtModelClass_textEdited(const QString &text) -{ - ui.txtHeaderFile->setText(text + ".h"); - ui.txtImplFile->setText(text + ".cpp"); -} - -ModelClassParameters ModelNamePage::parameters() const -{ - ModelClassParameters params; - params.className = ui.txtModelClass->text(); - params.headerFile = ui.txtHeaderFile->text(); - - params.sourceFile = ui.txtImplFile->text(); - params.baseClass = ui.cmbBaseClass->currentText(); - params.path = path; - return params; -} diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.h b/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.h deleted file mode 100644 index af49434830..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the documentation of Qt Creator. -** -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -****************************************************************************/ - -#ifndef MODELNAMEPAGE_H -#define MODELNAMEPAGE_H - -#include "ui_modelnamepage.h" - -#include <QWizardPage> - -struct ModelClassParameters -{ - QString className; - QString headerFile; - QString sourceFile; - QString baseClass; - QString path; -}; - -class ModelNamePage : public QWizardPage -{ - Q_OBJECT - -public: - ModelNamePage(QWidget *parent = 0); - - void setPath(const QString &path); - ModelClassParameters parameters() const; - -private slots: - void on_txtModelClass_textEdited(const QString &text); - -private: - Ui::ModelNamePage ui; - QString path; -}; - -#endif // MODELNAMEPAGE_H diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.ui b/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.ui deleted file mode 100644 index 848969c01c..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/modelnamepage.ui +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>ModelNamePage</class> - <widget class="QWidget" name="ModelNamePage"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>346</width> - <height>257</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0"> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Model Class Name:</string> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="txtModelClass"/> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Base Class Name:</string> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="cmbBaseClass"> - <item> - <property name="text"> - <string>QAbstractItemModel</string> - </property> - </item> - <item> - <property name="text"> - <string>QAbstractListModel</string> - </property> - </item> - <item> - <property name="text"> - <string>QAbstractTableModel</string> - </property> - </item> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Header:</string> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="txtHeaderFile"/> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Implementation:</string> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QLineEdit" name="txtImplFile"/> - </item> - <item row="4" column="1"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>61</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/doc/pluginhowto/examples/wizard/itemmodelwizard/template.qrc b/doc/pluginhowto/examples/wizard/itemmodelwizard/template.qrc deleted file mode 100644 index 343a5962c5..0000000000 --- a/doc/pluginhowto/examples/wizard/itemmodelwizard/template.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/CustomProject"> - <file alias="ItemModelSource">ItemModelSource.txt</file> - <file alias="ItemModelHeader">ItemModelHeader.txt</file> - </qresource> -</RCC> |