Unsolved postEvent & Priority - Does it work ?
-
I send three events of each with following with priority using postEvent.
- Pri-1(Lowest)
- Pri-2
- 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
- Pri-4 event is processed first.
- 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 ?
-
Hi,
What level is Pri-4 ?
How are you setting these values ? -
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)
} -
Can you provide a minimal compilable application showing that behaviour ?