Commit 1c483b95 authored by hjk's avatar hjk

Doc: Modernize example code a bit

Use Qt 5 connects.

Change-Id: I0e8ae956258892f60a1d12222a081c0fa6577717
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent af05e661
......@@ -15,7 +15,8 @@
#include <QtPlugin>
using namespace Example::Internal;
namespace Example {
namespace Internal {
ExamplePlugin::ExamplePlugin()
{
......@@ -45,7 +46,7 @@ bool ExamplePlugin::initialize(const QStringList &arguments, QString *errorStrin
Core::Command *cmd = Core::ActionManager::registerAction(action, Constants::ACTION_ID,
Core::Context(Core::Constants::C_GLOBAL));
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A")));
connect(action, SIGNAL(triggered()), this, SLOT(triggerAction()));
connect(action, &QAction::triggered, this, &ExamplePlugin::triggerAction);
//! [add action]
//! [add menu]
Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID);
......@@ -80,3 +81,6 @@ void ExamplePlugin::triggerAction()
tr("This is an action from Example."));
}
//! [slot implementation]
} // namespace Internal
} // namespace Example
......@@ -28,7 +28,7 @@ public:
//! [plugin functions]
//! [slot]
private slots:
private:
void triggerAction();
//! [slot]
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment