forked from qt-creator/qt-creator
HelloWorld: Cleanup
Change-Id: I19abb60e9a6db3a99955924f52c0b920b7fbd7f6 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -4,13 +4,14 @@ QtcPlugin {
|
|||||||
name: "HelloWorld"
|
name: "HelloWorld"
|
||||||
|
|
||||||
Depends { name: "Core" }
|
Depends { name: "Core" }
|
||||||
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
|
Depends { name: "Qt"; submodules: ["widgets"] }
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
"helloworldplugin.cpp",
|
"helloworldplugin.cpp",
|
||||||
"helloworldplugin.h",
|
"helloworldplugin.h",
|
||||||
"helloworldwindow.cpp",
|
"helloworldwindow.cpp",
|
||||||
"helloworldwindow.h",
|
"helloworldwindow.h",
|
||||||
|
"helloworldtr.h"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
namespace HelloWorld {
|
namespace HelloWorld::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
/*! A mode with a push button based on BaseMode. */
|
/*! A mode with a push button based on BaseMode. */
|
||||||
|
|
||||||
@@ -53,17 +52,12 @@ HelloWorldPlugin::~HelloWorldPlugin()
|
|||||||
delete m_helloMode;
|
delete m_helloMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Initializes the plugin. Returns true on success.
|
/*! Initializes the plugin.
|
||||||
Plugins want to register objects with the plugin manager here.
|
Plugins want to register objects with the plugin manager here.
|
||||||
|
|
||||||
\a errorMessage can be used to pass an error message to the plugin system,
|
|
||||||
if there was any.
|
|
||||||
*/
|
*/
|
||||||
bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
void HelloWorldPlugin::initialize()
|
||||||
{
|
{
|
||||||
Q_UNUSED(arguments)
|
|
||||||
Q_UNUSED(errorMessage)
|
|
||||||
|
|
||||||
// Create a unique context for our own view, that will be used for the
|
// Create a unique context for our own view, that will be used for the
|
||||||
// menu entry later.
|
// menu entry later.
|
||||||
Core::Context context("HelloWorld.MainView");
|
Core::Context context("HelloWorld.MainView");
|
||||||
@@ -94,8 +88,6 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
|
|
||||||
// Add a mode with a push button based on BaseMode.
|
// Add a mode with a push button based on BaseMode.
|
||||||
m_helloMode = new HelloMode;
|
m_helloMode = new HelloMode;
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Notification that all extensions that this plugin depends on have been
|
/*! Notification that all extensions that this plugin depends on have been
|
||||||
@@ -121,5 +113,4 @@ void HelloWorldPlugin::sayHelloWorld()
|
|||||||
nullptr, tr("Hello World!"), tr("Hello World! Beautiful day today, isn't it?"));
|
nullptr, tr("Hello World!"), tr("Hello World! Beautiful day today, isn't it?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace HelloWorld::Internal
|
||||||
} // namespace HelloWorld
|
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
namespace HelloWorld {
|
namespace HelloWorld::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class HelloMode;
|
class HelloMode;
|
||||||
|
|
||||||
@@ -20,8 +19,7 @@ public:
|
|||||||
HelloWorldPlugin();
|
HelloWorldPlugin();
|
||||||
~HelloWorldPlugin() override;
|
~HelloWorldPlugin() override;
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage) override;
|
void initialize() override;
|
||||||
|
|
||||||
void extensionsInitialized() override;
|
void extensionsInitialized() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -30,5 +28,4 @@ private:
|
|||||||
HelloMode *m_helloMode = nullptr;
|
HelloMode *m_helloMode = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace HelloWorld::Internal
|
||||||
} // namespace HelloWorld
|
|
||||||
|
|||||||
@@ -5,16 +5,13 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace HelloWorld {
|
namespace HelloWorld::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class HelloWorldWindow : public QWidget
|
class HelloWorldWindow : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit HelloWorldWindow(QWidget *parent = nullptr);
|
explicit HelloWorldWindow(QWidget *parent = nullptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace HelloWorld::Internal
|
||||||
} // namespace HelloWorld
|
|
||||||
|
|||||||
Reference in New Issue
Block a user