Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Event handler does not get fired after postEvent

    General and Desktop
    2
    4
    3595
    Loading More Posts
    • 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
      RogerCui last edited by

      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 Reply Quote 0
      • F
        Franzk last edited by

        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 Reply Quote 0
        • R
          RogerCui last edited by

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

          1 Reply Last reply Reply Quote 0
          • F
            Franzk last edited by

            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 Reply Quote 0
            • First post
              Last post