Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.1
-
None
-
Symbian 9.2
-
9525ef8f3f8c2f28992457a626356cec86bd7279
Description
QKeyEvent::text() is empty on Symbian for the Enter (Qt::Key_Return, Qt::Key_Enter);
I have attached a small Qt App (keyevent.zip) that prints out the QKeyEvent values when a key is pressed.
This app shows that text is set on Windows and Linux, and empty on Symbian.
An Enter key event with empty text causes different (and wrong) behavior on Symbian.
The Qt documentation states that the text for the Enter
key should not be empty. It should only be empty for modifier keys
(Ctrl, Shift, ...)
QString QKeyEvent::text () const
Returns the Unicode text that this key generated. The text returned
can be an empty string in cases where modifier keys, such as Shift,
Control, Alt, and Meta, are being pressed or released. In such cases
key() will contain a valid value.
And here is the result of my traces.
Tracing Enter key on Linux. Enter key text is '\r'.
Also, on Windows there is text for the Enter key.
EventHandler::keyEvent Qt key = 16777220 , "
EventHandler::keyEvent plat key = 65293
virtualkeycode = 13
text().isEmpty() = false
" xt = " <- text is '\r' (0x0D) so prints funny
keyIdentifier "Enter"
Tracing in Symbian. Enter key text is empty.
EventHandler::keyEvent Qt key = 16777221 , ""
EventHandler::keyEvent plat key = 13
nativeVirtualKeyCode = 13 , 13
text = Empty <- modified trace to put "Empty" when isEmpty() is true.
keyIdentifier = "Enter"