Guest User

Untitled

a guest
Feb 13th, 2026
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #ifndef MOUSEPOSSETTER_H
  2. #define MOUSEPOSSETTER_H
  3.  
  4. #include <QObject>
  5. #include <QCursor>
  6.  
  7. class MousePosSetter : public QObject
  8. {
  9.     Q_OBJECT
  10. public:
  11.     explicit MousePosSetter(QObject *parent = nullptr);
  12.  
  13.     // Q_INVOKABLE void set(int x, int y) { QCursor::setPos(x, y); }
  14.     Q_INVOKABLE void set(qreal x, qreal y) { QCursor::setPos(qRound(x), qRound(y)); }
  15. signals:
  16. };
  17.  
  18. #endif // MOUSEPOSSETTER_H
  19.  
Advertisement
Add Comment
Please, Sign In to add comment