error in SignalSpy



  • 2 error in SignalSpy
    Type TestCase unavailable
    module "Qt.test.qttestroot" is not installed.

    @

    import QtQuick 2.2
    import QtQuick.Controls 1.1
    import QtTest 1.0

    ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("Exit")
                onTriggered: Qt.quit();
            }
        }
    }
    
    Button{
        id:button
        SignalSpy{
            id:spy
            target:button
            signalName: "clicked"
        }
        TestCase{
            name:"ButtonClick"
            function test_click(){
                compare(spy.count,0)
                button.clicked();
                compar(spy.count,1)
            }
    
        }
    }
    
    Text {
        text: qsTr("Hello World")
        anchors.centerIn: parent
    }
    

    }

    @


Log in to reply
 

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