Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot call member function 'void* QMetaType::construct(void*, const void*) const' without object
Forum Updated to NodeBB v4.3 + New Features

Cannot call member function 'void* QMetaType::construct(void*, const void*) const' without object

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    daniel132
    wrote on last edited by
    #1

    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 :)

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Seba84
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        daniel132
        wrote on last edited by
        #3

        I will edit the post to what I was trying to do.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved