Problems with Open-Source Downloads read https://www.qt.io/blog/problem-with-open-source-downloads and https://forum.qt.io/post/638946

Why do I get Qt Warnings?



  • Hello,

    I am using a class and it throws me warnings referenced to Signals&slots, but I don't know the background of this, I would like to build my class the right way with no warnings.

    This is my class in question:

    @
    class PluginPage : public QDeclarativeItem
    {
    Q_OBJECT

    Q_PROPERTY (QString groupName READ getGroupName WRITE setGroupName)

    public:
    PluginPage(QDeclarativeItem* poParent = NULL);
    virtual ~PluginPage(void);

    void setGroupName (const QString& sName);
    QString getGroupName () const;

    public slots:
    void recoverConnection(QString msg);
    void setPluginSize(int iWidth, int iHeight);

    signals:
    void reconnectionMsg(QString msg);
    void widthChanged();
    void heightChanged();

    private:
    QString m_sGroupName;;
    };
    @

    and the Warnings:

    c:\tool\qt5\5.1.0\msvc2010\include\qtcore\qobject_impl.h(133): warning C4512: 'QtPrivate::QSlotObjectBase' : assignment operator could not be generated
    1> c:\tool\qt5\5.1.0\msvc2010\include\qtcore\qobject_impl.h(107) : see declaration of 'QtPrivate::QSlotObjectBase'
    1>c:\tool\qt5\5.1.0\msvc2010\include\qtdeclarative\qdeclarativeprivate.h(240): warning C4510: 'QDeclarativePrivate::RegisterComponent' : default constructor could not be generated
    1> c:\tool\qt5\5.1.0\msvc2010\include\qtdeclarative\qdeclarativeprivate.h(234) : see declaration of 'QDeclarativePrivate::RegisterComponent'
    1>c:\tool\qt5\5.1.0\msvc2010\include\qtdeclarative\qdeclarativeprivate.h(240): warning C4512: 'QDeclarativePrivate::RegisterComponent' : assignment operator could not be generated
    1> c:\tool\qt5\5.1.0\msvc2010\include\qtdeclarative\qdeclarativeprivate.h(234) : see declaration of 'QDeclarativePrivate::RegisterComponent'
    1>c:\tool\qt5\5.1.0\msvc2010\include\qtdeclarative\qdeclarativeprivate.h(240): warning C4610: struct 'QDeclarativePrivate::RegisterComponent' can never be instantiated - user defined constructor required
    1>
    1>Build succeeded.

    And I am using Qt5.1 libraries and MSVC 2010 with Warnig Level4 (/W4).

    It would be great if anyone could share some ideas.

    Thanks in advance!


Log in to reply