Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Event handler does not get fired after postEvent

Event handler does not get fired after postEvent

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.8k 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.
  • R Offline
    R Offline
    RogerCui
    wrote on last edited by
    #1

    Hi,
    I have a MDI application. I'll show some widget asynchronously, the code is something as below,
    It runs fine if I have a few Views. However, if 10+ views get opened, "QMyWidget::customEvent" will not be fired, even I have posted the event. Are there somebody have clues?

    @=========================================
    void QMyWidget::Show()
    {
    QApplication::postEvent(this, new QEvent(ShowEvent));
    }

    void QMyWidget::customEvent(QEvent *event)
    {
    if (event->type() == ShowEvent)
    {
    // show myself
    }
    }@

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      What's the value of ShowEvent?

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RogerCui
        wrote on last edited by
        #3

        const QEvent::Type ShowEvent = QEvent::User;

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          Could you mock up a simple fully working example that shows the exact problem you're having (and use the code tags when posting it)? Of course you can also tar/zip it.

          Based on gut feeling I'd say that the event loop is being flooded.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          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