Review Request: Send a Qt::Key_Back key on the back button instead of the Qt::Key_Close key.

/#!/JoePea trusktr at gmail.com
Thu Jan 17 03:48:20 UTC 2013


I think that's a good idea. I'm in favor.

/#!/JoePea
On Jan 10, 2013 10:39 AM, "Micke Prag" <micke.prag at telldus.se> wrote:

>    This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108332/
>   Review request for Necessitas.
> By Micke Prag.
> Description
>
> Send a Qt::Key_Back key on the back button instead of the Qt::Key_Close key.
>
> This makes it much easier to control the behavior of the back button.
> For example this code can be used in a QML application to implement back button control.
>
> Item {
>     focus: true
>     Keys.onBackPressed: {
>         if (shouldHandleBackButton()) {
>             doHandleBackButton()
>         } else {
>             // Close the application, default behaviour
>             event.accepted = false
>         }
>     }
> }
>
> Basically it emits a Key_Close key event on the back button. If no one accepts it the current top level widget gets the close event as before. This can also be implemented in a non QML application in a similar way by subclassing QWidget::keyPressEvent() and calling QEvent::accept() on the event.
>
>   Testing
>
> Tested on Cube U30GT
>
>   Diffs
>
>    - src/android/jar/src/org/kde/necessitas/industrius/QtActivityDelegate.java
>    (650081c)
>    - src/gui/kernel/qwidget.cpp (d67c388)
>    - src/plugins/platforms/android/src/androidjnimain.cpp (5ee30c6)
>
> View Diff <http://git.reviewboard.kde.org/r/108332/diff/>
>
> _______________________________________________
> Necessitas-devel mailing list
> Necessitas-devel at kde.org
> https://mail.kde.org/mailman/listinfo/necessitas-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/necessitas-devel/attachments/20130116/eee4d3a0/attachment.html>


More information about the Necessitas-devel mailing list