Follow Qt's coding style (remove spaces around and inside parenthesis)
Use nullptr (new in c++11) instead of NULL
Better dupe frame handling