Не знаком с QT, но, как говорят другие, используйте priority_queue
.
Вам также понадобится функтор, чтобы структура могла получить доступ к информации о приоритете и указать порядок сортировки.
struct is_higher_priority {
bool operator()( MyRunnable const &l, MyRunnable const &b )
{ return l.priority > r.priority; }
};
std::priority_queue< MyRunnable, std::deque<MyRunnable>, is_higher_priority > q;
...
q.push( task_1 );
q.push( task_2 );
q.push( task_3 );
MyRunnable &highest = q.top();
highest.run();
q.pop();