Rolf Hausen
Rolf Hausen

Reputation: 135

QML invalid property name "signal" M16

i follow a tutorial about QML Development (in case of interest this one: https://www.youtube.com/watch?v=aMEQji7Rwrg )

at creating a first inscreen dialog he is using signal to connect the onClicked Signal to open the dialog and the same for destroying it.

But in my Code this does not work and i get the message: "invalid property name "signal" i tried to google this a while but i did not find anything helpful.

Here is the code from the qml file where it appears. If needed i can also add more code. but this is where the issue appears.

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15

Rectangle
{
    id: heatSelectDialog
    signal: destroyMe()
    anchors.fill: parent
    color: Qt.rgba(0, 0, 0, 0)

    MouseArea
    {
        anchors.fill: parent
        onClicked: heatSelectDialog.destroyMe();
    }

    Rectangle
    {
        id: innerRectangle
        width: parent.width /2
        height: parent.height * 0.8
        color: "black"
        border.color: "red"
        border.width: 3

    }
}

The error happens on the line: signal: destroyMe

i will be thanksful for your help

kind regards

Rolf Hausen

Upvotes: 0

Views: 374

Answers (1)

JarMan
JarMan

Reputation: 8277

You have a typo in the way that you declared your signal. There should not be a colon there. So rather than this:

signal: destroyMe()

You should be using this:

signal destroyMe()

Upvotes: 0

Related Questions