Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

TapHandler isn't working for me :'(



  • Hello Qt Freinds,

    I'm trying QtQuick for the first time I'm following the tutorial located @ here

    I'm running into the following error in Qt Creator:
    qrc:/main.qml:13 TapHandler is not a type

    Here is the code

    import QtQuick 2.12
    
    Rectangle {
        width: 200
        height: 100
        color: "red"
    
        Text {
            anchors.centerIn: parent
            text: "Hello, World!"
        }
    
        TapHandler {
            onTapped: parent.color = "blue"
        }
    }
    

    If I use the import statement as is, I get the following error:

    QQmlApplicationEngine failed to load component
    qrc:/main.qml:1 module "QtQuick" version 2.12 is not installed

    I can use version 2.9 or 2.10 and all is good other that the TapHandler related error.

    I'm using QtCreator 4.9.0.


Log in to reply