Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QQuickWidget touch
Forum Updated to NodeBB v4.3 + New Features

QQuickWidget touch

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 612 Views
  • 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 Offline
    J Offline
    joantoh
    wrote on last edited by
    #1

    quickwidget->setAttribute(Qt::WA_AcceptTouchEvents)

    does setting this attribute still works for touch events?
    [Qt version 5.13]

    jsulmJ 1 Reply Last reply
    0
    • J joantoh

      quickwidget->setAttribute(Qt::WA_AcceptTouchEvents)

      does setting this attribute still works for touch events?
      [Qt version 5.13]

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @joantoh said in QQuickWidget touch:

      does setting this attribute still works for touch events?

      Did you try?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      0
      • jsulmJ jsulm

        @joantoh said in QQuickWidget touch:

        does setting this attribute still works for touch events?

        Did you try?

        J Offline
        J Offline
        joantoh
        wrote on last edited by joantoh
        #3

        @jsulm yes i did. it doesn't work.

        main.cpp
        QQuickWidget *content = new QQuickWidget(QUrl("qrc:/myPopup.qml"));
        content->setAttribute(Qt::WA_TranslucentBackground);
        content->setClearColor(Qt::transparent);
        content->setAttribute(Qt::WA_AcceptTouchEvents);
        scene.addWidget(content);

        myPopup.qml
        import QtQuick 2.13
        import QtQuick.Controls 2.13

        Rectangle {
        id:itemParent
        width: 90; height: 90
        color: "red"

        MultiPointTouchArea {
        anchors.fill: parent
        minimumTouchPoints: 1
        maximumTouchPoints: 2

        touchPoints: [
            TouchPoint { id: touch1; objectName: "touch 1"; }
        ]
        onPressed: {
            console.log(touch1.objectName, "pressed:", touch1.pressed, touch1.x, touch1.y);
        }
        onReleased: {
            console.log(touch1.objectName, "onReleased:", touch1.pressed, touch1.x, touch1.y);
        }
        onTouchUpdated: {
            console.log(touch1.objectName, "onTouchUpdated:", touch1.pressed, touch1.x, touch1.y);
        }
        

        }
        }

        jsulmJ 1 Reply Last reply
        0
        • J joantoh

          @jsulm yes i did. it doesn't work.

          main.cpp
          QQuickWidget *content = new QQuickWidget(QUrl("qrc:/myPopup.qml"));
          content->setAttribute(Qt::WA_TranslucentBackground);
          content->setClearColor(Qt::transparent);
          content->setAttribute(Qt::WA_AcceptTouchEvents);
          scene.addWidget(content);

          myPopup.qml
          import QtQuick 2.13
          import QtQuick.Controls 2.13

          Rectangle {
          id:itemParent
          width: 90; height: 90
          color: "red"

          MultiPointTouchArea {
          anchors.fill: parent
          minimumTouchPoints: 1
          maximumTouchPoints: 2

          touchPoints: [
              TouchPoint { id: touch1; objectName: "touch 1"; }
          ]
          onPressed: {
              console.log(touch1.objectName, "pressed:", touch1.pressed, touch1.x, touch1.y);
          }
          onReleased: {
              console.log(touch1.objectName, "onReleased:", touch1.pressed, touch1.x, touch1.y);
          }
          onTouchUpdated: {
              console.log(touch1.objectName, "onTouchUpdated:", touch1.pressed, touch1.x, touch1.y);
          }
          

          }
          }

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @joantoh said in QQuickWidget touch:

          scene.addWidget(content);

          What is scene here?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          0
          • jsulmJ jsulm

            @joantoh said in QQuickWidget touch:

            scene.addWidget(content);

            What is scene here?

            J Offline
            J Offline
            joantoh
            wrote on last edited by
            #5

            @jsulm said in QQuickWidget touch:

            t is scene here?

            QGraphicsScene scene;
            scene.setSceneRect(0, 0, 1920, 1080);

            QGraphicsView view(&scene);
            view.show();

            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