intellisense don’t display property and sinal of attached property in qml

  attached-properties, c++, qml, qt, qtquickcontrols2

I created a MessageBoard Class that have attached properties of Message class every thing is ok but intellisense don’t display properties and signal of Message class in qml file


class Message : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString content READ content WRITE setContent NOTIFY contentChanged)
    Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
    //...
}

MessageBoard class


#include <QObject>
#include<message.h>
#include<networkengine.h>

class MessageBoard : public QObject
{
    Q_OBJECT
    QML_ATTACHED(Message)
public:
    static Message* qmlAttachedProperties(QObject *object)
    {
        return NetworkEngine::m_Message;
    }
};

I’m using this classes and there is no error but I like intellisense help me in coding

Popup{
    id: messagebar
    Material.background: MessageBoard.backColor
    parent: Overlay.overlay
    Label {
        color: "white"
        text: MessageBoard.content
        anchors.fill: parent
    }
    visible: MessageBoard.visible
}

Source: Windows Questions C++

LEAVE A COMMENT