Mean, Median and Mode of a QVector
Sorted vs Unsorted

Your QVector sequence contains an unsorted sequence of values.  Your median calculation has a precondition that your sequence is sorted.  Consider the sequence 1, 0, 1, what is the median?

Small, Focused, and Testable Functions

Prefer writing functions that employ the single responsibility principle.  Splitting out median and testing it with different sequence types would have pointed out a problem. How about calculating the mean of an empty container? Is division by zero a problem?

Standard Algorithms

Being able to understand when you should use standard algorithms and applying them is very important.  Mean can be written using std::accumulate().  Median can be written in terms of std::nth_element().  Mode can be written using boost::bimap (or utilize std::unordered_map+std::multimap) and std::upper_bound() with std::transform() to return the modes of a sequence.  Not all sequences are uni-modal.