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. Response to back (navigation) key: C++ based android app built in Qt
Forum Updated to NodeBB v4.3 + New Features

Response to back (navigation) key: C++ based android app built in Qt

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 3 Posters 526 Views 1 Watching
  • 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.
  • ahsan737A Offline
    ahsan737A Offline
    ahsan737
    wrote on last edited by
    #1

    How can I introduce the function which takes to the recent previous screen of the app whenever back key (android navigation key) is pressed? Currently, it exits/closes the app whenever the user click the back button. The app is built using the C++ language only, QML is not involved at all.

    M 1 Reply Last reply
    0
    • ahsan737A ahsan737

      How can I introduce the function which takes to the recent previous screen of the app whenever back key (android navigation key) is pressed? Currently, it exits/closes the app whenever the user click the back button. The app is built using the C++ language only, QML is not involved at all.

      M Offline
      M Offline
      mvuori
      wrote on last edited by
      #2

      You need to add an eventFilter to your mainwindow, grab key events there and do what you wish - perhaps send a signal to your UI objects.

      ahsan737A 1 Reply Last reply
      0
      • M mvuori

        You need to add an eventFilter to your mainwindow, grab key events there and do what you wish - perhaps send a signal to your UI objects.

        ahsan737A Offline
        ahsan737A Offline
        ahsan737
        wrote on last edited by ahsan737
        #3

        @mvuori @Davronito thank you for kind suggestions, I've successfully implemented it. Lack of experience with Qt leads me to ask such basic questions.

        1 Reply Last reply
        0
        • DavronitoD Offline
          DavronitoD Offline
          Davronito
          wrote on last edited by
          #4

          https://forum.qt.io/topic/28801/android-backbutton

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved