HelloWorld: Cleanup

Change-Id: I19abb60e9a6db3a99955924f52c0b920b7fbd7f6
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Marcus Tillmanns
2023-10-05 14:51:21 +02:00
parent 951f513088
commit 1da8f62783
4 changed files with 11 additions and 25 deletions

View File

@@ -4,13 +4,14 @@ QtcPlugin {
name: "HelloWorld"
Depends { name: "Core" }
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
Depends { name: "Qt"; submodules: ["widgets"] }
files: [
"helloworldplugin.cpp",
"helloworldplugin.h",
"helloworldwindow.cpp",
"helloworldwindow.h",
"helloworldtr.h"
]
}

View File

@@ -16,8 +16,7 @@
#include <QMessageBox>
#include <QPushButton>
namespace HelloWorld {
namespace Internal {
namespace HelloWorld::Internal {
/*! A mode with a push button based on BaseMode. */
@@ -53,17 +52,12 @@ HelloWorldPlugin::~HelloWorldPlugin()
delete m_helloMode;
}
/*! Initializes the plugin. Returns true on success.
/*! Initializes the plugin.
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
// menu entry later.
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.
m_helloMode = new HelloMode;
return true;
}
/*! 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?"));
}
} // namespace Internal
} // namespace HelloWorld
} // namespace HelloWorld::Internal

View File

@@ -5,8 +5,7 @@
#include <extensionsystem/iplugin.h>
namespace HelloWorld {
namespace Internal {
namespace HelloWorld::Internal {
class HelloMode;
@@ -20,8 +19,7 @@ public:
HelloWorldPlugin();
~HelloWorldPlugin() override;
bool initialize(const QStringList &arguments, QString *errorMessage) override;
void initialize() override;
void extensionsInitialized() override;
private:
@@ -30,5 +28,4 @@ private:
HelloMode *m_helloMode = nullptr;
};
} // namespace Internal
} // namespace HelloWorld
} // namespace HelloWorld::Internal

View File

@@ -5,16 +5,13 @@
#include <QWidget>
namespace HelloWorld {
namespace Internal {
namespace HelloWorld::Internal {
class HelloWorldWindow : public QWidget
{
Q_OBJECT
public:
explicit HelloWorldWindow(QWidget *parent = nullptr);
};
} // namespace Internal
} // namespace HelloWorld
} // namespace HelloWorld::Internal