Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 5.6.1 - MouseArea pressed() and onPressAndHold() misbihaving - BUG?

Qt 5.6.1 - MouseArea pressed() and onPressAndHold() misbihaving - BUG?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 619 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.
  • S Offline
    S Offline
    Szymon
    wrote on last edited by
    #1

    Qt Version 5.6.1
    Device: WEC7
    When I run the example below on WEC7 the MouseArea signals misbehave.
    I press and hold the close button.
    I get the following flow of the signals:
    Status:+pressed+pressandhold+released+pressed+pressandhold+released

    When I run this example on Win32 i get the expected behaviour:
    Status:+pressed+pressandhold+released

    So I guess either there is a BUG in WINCE/WEC or I am something missing here.
    "+pressandhold+released" signals get emitted almost immediattely after the press.
    Could anyone help? Any ideas?

    import QtQuick 2.6
    import QtQuick.Window 2.2
    
    Window {
        id: root
        visible: true
        width: 480;
        height: 800;
        color: "#cbcaca"
        title: "Demo"
        flags: Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window
    
        Rectangle {
            id: close
            width: 100; height: 100;
            anchors {
                bottom: parent.bottom;
                left: parent.left;
            }
            color: "orange"
            border.color: "black"
            border.width: 1;
            opacity: 0.5
            Text {
                id: quittext
                text: qsTr("X")
                anchors.centerIn: parent;
                font.pointSize: 20;
                font.bold: true;
            }
    
            MouseArea {
                anchors.fill: parent;
                onReleased:  {
                    statustext.text=statustext.text+"+released";
                    close.color="orange"
                }
                onClicked: {
                    statustext.text=statustext.text+"+clicked";
                    Qt.quit();
                }
                onPressAndHold: {
                    statustext.text=statustext.text+"+pressandhold";
                }
                onPressed: {
                    statustext.text=statustext.text+"+pressed";
                    close.color="green"
                }
            }
        }
    
        Rectangle {
            id: status
            height: 100; width: parent.width-100;
            anchors { left: close.right; bottom: parent.bottom; }
            Text {
                width: parent.width;
                id: statustext
                anchors.centerIn: parent;text: qsTr("Signals: ")
                font.pointSize: 8;
                wrapMode: Text.WordWrap
            }
            MouseArea {
                anchors.fill: parent;
                onClicked: Qt.quit();
            }
        }
    
    }
    
    
    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