Doc: Modernize example code a bit

Use Qt 5 connects.

Change-Id: I0e8ae956258892f60a1d12222a081c0fa6577717
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2016-03-15 10:08:56 +01:00
parent af05e661a3
commit 1c483b95a6
2 changed files with 7 additions and 3 deletions

View File

@@ -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