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. Event for QWidget after "back" pressed in Android
Forum Update on Monday, May 27th 2025

Event for QWidget after "back" pressed in Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 329 Views
  • 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.
  • G Offline
    G Offline
    Gourmet
    wrote on last edited by Gourmet
    #1

    I am little weird: if focus is on some QWidget and user presses system "back" button - then will this widget receive any event or signal? Which one?

    If this happiness with QMainWindow - it receives close event. What about QWidget?

    J.HilkJ 1 Reply Last reply
    0
    • G Gourmet

      I am little weird: if focus is on some QWidget and user presses system "back" button - then will this widget receive any event or signal? Which one?

      If this happiness with QMainWindow - it receives close event. What about QWidget?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      Hi @Gourmet
      I think that is the default behavior for everything. Exception may be stuff like QLineEdit that has an active focus and accepts keyPressEvents.

      You can either override the keyPressEvent of your top most widget/ or install an event filter on that.

      The key you'll have to listen to is the Qt::Key_Back key.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1

      • Login

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