Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. error in SignalSpy
Qt 6.11 is out! See what's new in the release blog

error in SignalSpy

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 602 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    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
    }
    

    }

    @

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved