Qt::MiddleButton replaced with Qt::MidButton as the former isn't supported on Qt-4.6
Refactored local enums to top of file in anonyomous namespace. Local types cannot be used as template arguments, but they were used in a std::vector