2
我Qt Creator中写一个项目,如果我写如何使用QCursor :: pos()而不使用QApplication?
QPoint cursorPos=QCursor::pos();
然后cursorPos = { - 2147483648,-2147483648}这显然是错误的。但是,如果我写
QApplication *application=new QApplication(argc,argv);
QPoint cursorPos=QCursor::pos();
然后cursorPos是正确的鼠标位置。有没有什么办法可以让QCursor :: pos()在没有QApplication的情况下工作?谢谢。 :D