SignalSpy records TWO clicks when clicking on a Button ONCE.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-ui-toolkit (Ubuntu) |
New
|
High
|
Unassigned |
Bug Description
Execute the code below using qmltestrunner, and the test will fail because 'count' is 2, not 1.
import QtTest 1.0
import QtQuick 2.4
import Ubuntu.Components 1.3
Item {
id: root
width: units.gu(50)
height: units.gu(80)
Button {
id: button
text: "Click me"
onClicked: {
}
}
TestCase {
name: "ButtonClickedSpy"
when: windowShown
id: testCase
SignalSpy {
id: buttonSpy
target: button
}
function test_click_button() {
}
}
}
Test results here: http://
Changed in ubuntu-ui-toolkit (Ubuntu): | |
importance: | Undecided → High |
description: | updated |
description: | updated |
description: | updated |
and it seems it's not Qt's fault, since it only delivers 1 press and 1 release, as can be seen from
PASS : qmltestrunner: :ButtonClickedS py::initTestCas e() :ButtonClickedS py::test_ click_button( ) qml: spy count after clearing = 0 :ButtonClickedS py::test_ click_button( ) qt.quick.mouse: QQuickWindow: :mousePressEven t() QPointF(160,304) 1 QFlags(0x1) :ButtonClickedS py::test_ click_button( ) qt.quick.mouse: QQuickWindow: :mouseReleaseEv ent() QPointF(160,304) 1 QFlags() :ButtonClickedS py::test_ click_button( ) qml: click :ButtonClickedS py::test_ click_button( ) qml: new count = 1 :ButtonClickedS py::test_ click_button( ) qml: new count = 2 :ButtonClickedS py::test_ click_button( ) Could not click button.
QDEBUG : qmltestrunner:
QDEBUG : qmltestrunner:
QDEBUG : qmltestrunner:
QDEBUG : qmltestrunner:
QDEBUG : qmltestrunner:
QDEBUG : qmltestrunner:
FAIL! : qmltestrunner:
Actual (): 2
Expected (): 1