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. QMessageBox not receiving keyPressEvents
Forum Updated to NodeBB v4.3 + New Features

QMessageBox not receiving keyPressEvents

Scheduled Pinned Locked Moved Solved Mobile and Embedded
3 Posts 2 Posters 569 Views 2 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.
  • A Offline
    A Offline
    allagar
    wrote on last edited by
    #1

    Hi, I have subclassed QMessasgebox to add a timer and also an override of the keyPressEvent. There are 2 buttons for accept and retry. The timer and buttons appear to operate correctly but I am not receiving any keyPressEvents. Prior to usage I have created my QApplication but have not called QApplicaion.exec() and have not created a main QWidget. If I instantiate a QWidget my message box starts to receive keyPressEvents. Is a QWidget needed for QMessagbox to receive keyPressEvents? I thought when QMessagebox.exec() was called Qt creates an event queue which would post keyPressEvents? This app uses an older version of Qt 4.7.0 running on an Arm platform, Thanks.

    ? 1 Reply Last reply
    0
    • A allagar

      Hi, I have subclassed QMessasgebox to add a timer and also an override of the keyPressEvent. There are 2 buttons for accept and retry. The timer and buttons appear to operate correctly but I am not receiving any keyPressEvents. Prior to usage I have created my QApplication but have not called QApplicaion.exec() and have not created a main QWidget. If I instantiate a QWidget my message box starts to receive keyPressEvents. Is a QWidget needed for QMessagbox to receive keyPressEvents? I thought when QMessagebox.exec() was called Qt creates an event queue which would post keyPressEvents? This app uses an older version of Qt 4.7.0 running on an Arm platform, Thanks.

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @allagar Hi! There are couple of things that might go wrong, please post a minimal example so we don't have to poke around in the dark.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        allagar
        wrote on last edited by
        #3

        Wieland, many thanks for the reply after more investigation this appears to be related to my application and how the keypad is being supported, I have marked this as solved. Thanks again.

        1 Reply Last reply
        0

        • Login

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