From 930a2e160c77b141b3d504d898d201eb9adc505a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 6 Feb 2013 11:41:15 +0100 Subject: TaskHandler: Use named property to store handler in action Change-Id: Ia946bcca0a1143b00d8a4ab2a71b2bd0f894aad8 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/taskwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index aa8acaf5e9..4889dc8347 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -310,7 +310,10 @@ TaskWindow::~TaskWindow() static ITaskHandler *handler(QAction *action) { - return qobject_cast(action->data().value()); + QVariant prop = action->property("ITaskHandler"); + ITaskHandler *handler = qobject_cast(prop.value()); + QTC_CHECK(handler); + return handler; } void TaskWindow::delayedInitialization() @@ -328,7 +331,7 @@ void TaskWindow::delayedInitialization() QAction *action = h->createAction(this); QTC_ASSERT(action, continue); - action->setData(qVariantFromValue(qobject_cast(h))); + action->setProperty("ITaskHandler", qVariantFromValue(qobject_cast(h))); connect(action, SIGNAL(triggered()), this, SLOT(actionTriggered())); d->m_actions << action; -- cgit v1.2.1