Commit 42ad3de7 authored by Tomaz Canabrava's avatar Tomaz Canabrava Committed by Daniel Agar

CustomPlugin: Use qobject_cast

qobject_cast is times faster then dynamic_cast for objects that
inherit QObject. Also, use auto keyword to not duplicate the
name of the Class
parent 3a7ddee7
......@@ -47,7 +47,7 @@ customQuickInterfaceSingletonFactory(QQmlEngine*, QJSEngine*)
qCDebug(CustomLog) << "Creating CustomQuickInterface instance";
CustomQuickInterface* pIFace = new CustomQuickInterface();
CustomPlugin* pPlug = dynamic_cast<CustomPlugin*>(qgcApp()->toolbox()->corePlugin());
auto* pPlug = qobject_cast<CustomPlugin*>(qgcApp()->toolbox()->corePlugin());
if(pPlug) {
} else {
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