I think this is a little more efficient than dxdy, and easier to read. We call DxDy2 a lot, can any of those use Angle/DirAngle?
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}