Solved Beep when spacebar pressed
-
Hello all.
I have what I hope is a simple question to answer. If I have a window with only a button in it, and if I hit the tab key to set the focus to the button, and if I then hit the spacebar, my onClicked() gets properly called. However, I also get a beep. Now, I can understand a beep if I don't have the focus set to the button - it would indicate that I've done something wrong (i.e. no action can be taken because no control has the focus). But why do I get the beep if I'm on the button? And, more importantly, how do I make it so that it doesn't beep?
Here's a very simple app to demonstrate:
import QtQuick 2.7 import QtQuick.Window 2.0 import QtQuick.Controls 2.0 ApplicationWindow { title: "Why the Beep?" width: 170 height: 60 visible: true Button { anchors.centerIn: parent text: "Press Me" onClicked: console.log("Button clicked."); } }
Any help is appreciated :-)
Kevin
-
Which platform you trying this ?
-
-
-
Strange. It happens with an empty window, but only with Qt 5.7 - not with Qt 5.6.
import QtQuick 2.6 import QtQuick.Window 2.2 Window { width: 200 height: 200 visible: true }
-
Same results (beeps with 5.7, not with 5.6) with a plain minimal Qt Gui C++ app without Qt Widgets nor Qt Quick at all.
#include <QtGui> int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QWindow window; window.show(); return app.exec(); }
-
Looks like the issue has been fixed in Qt 5.7.1.
-