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. QT dialog issue - Why is application blocked if post event to a QDialog object when it was just closed
QtWS25 Last Chance

QT dialog issue - Why is application blocked if post event to a QDialog object when it was just closed

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

    The following QT interface technical problems: please help to see if there is a solution, thank you!

    1. The system is connected with an external physical key/button. When the key is pressed, the key event is sent to the App through the CAN bus

    2. After the App passes the CAN bus, route the key event in the following ways:

    QWidget* fw = QApplication::focusWidget();

    if(fw)

    {

    auto keyPres = new QKeyEvent(QEvent::KeyPress , Qt::Key_Return , Qt::NoModifier);

    QApplication::postEvent(fw , keyPres);

    }

    1. The problem now is that when the App pops up a dialog box (there is a confirm and cancel BUTTON on the dialog box), the tester deliberately clicks the BUTTON on the touch screen at the same time and clicks the physical button at the same time,

    Occasionally, the App will not receive the touch screen message, and it feels like the App Block is living, but it can still respond to other keys.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Is your dialog shown using exec ? If so, change the logic to use the open method. That way you will have only one event loop running to handle all your events.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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