Cannot call member function 'void* QMetaType::construct(void*, const void*) const' without object
-
wrote on 4 Jan 2014, 05:05 last edited by
Hello,
I am reciveing this error :
@C:\Qt\Qt5.1.0\Tools\QtCreator\bin\dynamicClasses\main.cpp:60: error: cannot call member function 'void* QMetaType::construct(void*, const void*) const' without object@
"This is the code I copied":http://pastebin.com/4BALVvGu from "this site":http://kunalmaemo.blogspot.com.au/2010/07/creating-class-dynamically-from-its.html
What I am trying to do is create a class object from a string.
I can use
@QMetaObject::invokeMethod(window, "methodFromWindow()", Qt::DirectConnection);@
To call a method, but I want to able to create an object(?) to hold values. eg class.setValue();Thanks for any help :)
-
wrote on 4 Jan 2014, 06:23 last edited by
Error is that you are calling function which does not exists. From "doc":http://qt-project.org/doc/qt-5.0/qtcore/qmetatype.html, this are the existing construct functions:
@static void * QMetaType::construct(int type, void * where, const void * copy)
void* QMetaType::construct(void*, const void*) const@
and your call is:
@QMetaType::construct( id )@which does not match any of the functions above. From the code, I imagine you would like to call the static one, but for this you are missing 2x void* pointers. Try asking the guy who wrote this.
-
wrote on 4 Jan 2014, 07:29 last edited by
I will edit the post to what I was trying to do.
1/3