Error 2660: qmlRegisterType fails when applying to class which inherits from 2 base classes

  • Hi All,

    I want to register my class DA_RailCarrier to QML via

    qmlRegisterType<DA_RailCarrier>("DA_RailCarrier", 1, 0, "DA_RailCarrier");

    The class is declared as follows:
    class DA_RailCarrier : public QObject, public WST_FSM

    When compiling, I get the following message:
    C2660: 'WST_FSM::operator new': function does not take 2 arguments

    The error references to createInto in qqmlprivate.h:

        void Q_QML_EXPORT qdeclarativeelement_destructor(QObject *);
        template<typename T>
        class QQmlElement : public T
            virtual ~QQmlElement() {
        template<typename T>
        void createInto(void *memory) { new (memory) QQmlElement<T>; }

    I tried to add#include <new>to WST_FSM, same result.
    WST_FSM is in general not a Q_OBJECT derived class, but I've also tried it with QObject as base class.

    Does anyone know a solution? thanks in advance,


    System Info:

    • Qt 5.4.1
    • Compiler MSVC2013

  • Lifetime Qt Champion


    Can you show the declaration of WST_FSM and DA_RailCarrier ?

  • @SGaist


    class WST_FSM {
        ////    Constructors and destructors    ////
        //## operation WST_FSM(WST_TSK)
        //## operation ~WST_FSM()
        virtual ~WST_FSM( void );


    class DA_RailCarrier : public QObject, public WST_FSM {
            Q_PROPERTY( QVariantList Order_t READ getQmlOrder_t NOTIFY guiRefresh)    

  • Lifetime Qt Champion

    That's not enough to identify the problem at hand, you should post the complete declaration of both classes

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.