Doc: Update first plugin example.

Change-Id: I90405eaba68efa0f6861a54a7283dc062a3d1408
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
This commit is contained in:
Eike Ziller
2014-03-31 11:04:17 +02:00
parent cbb053068c
commit b0f5fbc866
5 changed files with 44 additions and 29 deletions
@@ -9,9 +9,7 @@
<url>http://www.mycompany.com</url>
//! [2]
//! [3]
<dependencyList>
<dependency name=\"Core\" version=\"$$QTCREATOR_VERSION\"/>
</dependencyList>
$$dependencyList
//! [3]
</plugin>
+22 -9
View File
@@ -1,7 +1,4 @@
#! [1]
TARGET = Example
TEMPLATE = lib
DEFINES += EXAMPLE_LIBRARY
#! [1]
@@ -10,8 +7,8 @@ DEFINES += EXAMPLE_LIBRARY
#! [2]
SOURCES += exampleplugin.cpp
HEADERS += exampleplugin.h\
example_global.h\
HEADERS += exampleplugin.h \
example_global.h \
exampleconstants.h
#! [2]
@@ -41,10 +38,26 @@ isEmpty(IDE_BUILD_TREE):IDE_BUILD_TREE=/Users/example/qtcreator-build
PROVIDER = MyCompany
#![5]
#![6]
#! [6]
###### If the plugin can be depended upon by other plugins, this code needs to be outsourced to
###### <dirname>_dependencies.pri, where <dirname> is the name of the directory containing the
###### plugin's sources.
QTC_PLUGIN_NAME = Example
QTC_LIB_DEPENDS += \
# nothing here at this time
QTC_PLUGIN_DEPENDS += \
coreplugin
QTC_PLUGIN_RECOMMENDS += \
# optional plugin dependencies. nothing here at this time
###### End _dependencies.pri contents ######
#! [6]
#![7]
include($$QTCREATOR_SOURCES/src/qtcreatorplugin.pri)
include($$QTCREATOR_SOURCES/src/plugins/coreplugin/coreplugin.pri)
LIBS += -L$$IDE_PLUGIN_PATH/QtProject
#![6]
#![7]
@@ -75,7 +75,7 @@ ExtensionSystem::IPlugin::ShutdownFlag ExamplePlugin::aboutToShutdown()
//! [slot implementation]
void ExamplePlugin::triggerAction()
{
QMessageBox::information(Core::ICore::instance()->mainWindow(),
QMessageBox::information(Core::ICore::mainWindow(),
tr("Action triggered"),
tr("This is an action from Example."));
}
@@ -14,6 +14,7 @@ namespace Internal {
class ExamplePlugin : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Example.json")
//! [base class]
public: