Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Missing PointerDevice Type?

    QML and Qt Quick
    2
    2
    219
    Loading More Posts
    • 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.
    • J
      JrDeskJockey last edited by

      Hello. I was hoping to see if I could detect if the platform my app is running on contains a touch screen or not. I found this PointerDevice QML type in both the 5.10 and 5.11 documentation...
      https://doc.qt.io/archives/qt-5.10/qml-qtquick-pointerdevice.html
      http://doc.qt.io/qt-5/qml-qtquick-pointerdevice.html

      For whatever reason whenever I try to create a PointerDevice type it gives me Unknown component (M300). I have tried importing both QtQuick 2.11 and QtQuick 2.7 but can't seem to get the error to go away. Any thoughts?

      PointerDevice {
              
      }
      
      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @JrDeskJockey last edited by

        @JrDeskJockey
        i never used it myself, but since it only provides 2 read-only properties my guess is that it is rather a singleton type.

        For example:

        switch( PointerDevice.type )
        {
            case DeviceType.Mouse:
                 ....
                 break;
        }
        

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 2
        • First post
          Last post