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. postEvent & Priority - Does it work ?
Forum Updated to NodeBB v4.3 + New Features

postEvent & Priority - Does it work ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.0k 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.
  • dheerendraD Offline
    dheerendraD Offline
    dheerendra
    Qt Champions 2022
    wrote on last edited by
    #1

    I send three events of each with following with priority using postEvent.

    1. Pri-1(Lowest)
    2. Pri-2
    3. Pri-3(Hightest)

    Now it is processing Pri-3 events as it is highest priority.

    While it is still processing Pri-3, I send Pri-4 event to the same object. My expectation was that

    1. Pri-4 event is processed first.
    2. Then Pri-3, Pri-2 and Pri-1

    However Pri-4 event is processed after Pri-3, Pri-2 & Pri-1.

    Any thing missing here ?

    Dheerendra
    @Community Service
    Certified Qt Specialist
    http://www.pthinks.com

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

      Hi,

      What level is Pri-4 ?
      How are you setting these values ?

      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
      1
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        Enumerations have been defined like follows.
        enum CustomEventPriority
        {
        Priority_1 = Qt::HighEventPriority,
        Priority_2 = Priority_1 + 1,
        Priority_3 = Priority_2 + 1,
        Priority_4 = Priority_3 + 1,
        Priority_5 = Priority_4 + 1,
        Priority_6 = Priority_5 + 1,
        Priority_7 = Priority_6 + 1,
        Priority_8 = Priority_7 + 1,
        Priority_9 = Priority_8 + 1,
        Priority_High = Priority_9 + 10,
        // Not that important
        StatusEventPriority = Qt::LowEventPriority,

        // These are less important than Status events
        IdleProcessingDoneEventPriority = StatusEventPriority - 1
        

        };

        It is sent like the follows.
        void sendEvent2Data(CustomEventPriority prio) {
        QApplication::postEvent(this->m_data,evt,prio)
        }

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

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

          Can you provide a minimal compilable application showing that behaviour ?

          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