computree / computree-plugin-lvox

Computree voxel plugin
0 stars 1 forks source link

Fix warning about metatype QVector<int> #6

Closed giraldeau closed 7 years ago

giraldeau commented 7 years ago

The following warning occurs when using computree:

QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
giraldeau commented 7 years ago

The somewhat dirty trick consists to register the type in the main.cpp file:

diff --git a/ComputreeGui/main.cpp b/ComputreeGui/main.cpp
index 3a6237f..9c50713 100644
--- a/ComputreeGui/main.cpp
+++ b/ComputreeGui/main.cpp
@@ -28,6 +28,7 @@
 #include <QApplication>
 #include <QCommandLineParser>
 #include <QCommandLineOption>
+#include <QVector>

 #include "view/MainView/gguimanager.h"

@@ -50,6 +51,12 @@ int main(int argc, char *argv[])

     osg::setNotifyHandler(new DM_OSGNotifyHandler());

+    /*
+     * Prevent the warning: QObject::connect: Cannot queue arguments of type
+     * 'QVector<int>'
+     */
+    qRegisterMetaType<QVector<int>>();
+
     GGuiManager gm(&language);
     gm.initUi();