I'm writing a project in Qt Creator, and if I write
QPoint cursorPos=QCursor::pos();
then cursorPos={-2147483648,-2147483648} which is obviously wrong. However, if I write
QApplication *application=new QApplication(argc,argv);
QPoint cursorPos=QCursor::pos();
then cursorPos is the correct mouse position. Is there any way I can get QCursor::pos() to work without QApplication? Thanks. :D