-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated with many changes. Trying to do mouse movement internally fro…
…m viewer.
- Loading branch information
inblueswithu
committed
Nov 22, 2013
1 parent
c2ea65a
commit 7c124ee
Showing
10 changed files
with
360 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Thumbs.db | ||
Thumbs.db | ||
*.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "ButtonMouse.h" | ||
|
||
ButtonMouse::ButtonMouse(QQuickItem* gui, QCursor* cursor) | ||
{ | ||
this->gui = gui; | ||
this->cursor = cursor; | ||
} | ||
|
||
void ButtonMouse::Button1Slot() | ||
{ | ||
// cursor->setPos(50, 175); | ||
|
||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonPress, QPointF(50, 175), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonRelease, QPointF(50, 175), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
} | ||
|
||
void ButtonMouse::Button2Slot() | ||
{ | ||
// cursor->setPos(50, 125); | ||
|
||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonPress, QPointF(50, 125), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonRelease, QPointF(50, 125), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
} | ||
|
||
void ButtonMouse::Button3Slot() | ||
{ | ||
// cursor->setPos(50, 75); | ||
|
||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonPress, QPointF(50, 75), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonRelease, QPointF(50, 75), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
} | ||
|
||
void ButtonMouse::Button4Slot() | ||
{ | ||
// cursor->setPos(50, 25); | ||
|
||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonPress, QPointF(50, 25), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
QGuiApplication::sendEvent(gui, new QMouseEvent(QEvent::MouseButtonRelease, QPointF(50, 25), | ||
Qt::LeftButton, Qt::LeftButton, Qt::NoModifier)); | ||
qDebug() << "in button4 slot"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef BUTTONMOUSE_H | ||
#define BUTTONMOUSE_H | ||
|
||
#include <QObject> | ||
#include <QtCore> | ||
#include <QCursor> | ||
#include <QGuiApplication> | ||
#include <QMouseEvent> | ||
#include <QQuickItem> | ||
|
||
class ButtonMouse: public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
ButtonMouse(QQuickItem* gui, QCursor* cursor); | ||
|
||
public slots: | ||
void Button1Slot(); | ||
void Button2Slot(); | ||
void Button3Slot(); | ||
void Button4Slot(); | ||
|
||
private: | ||
QCursor* cursor; | ||
QQuickItem* gui; | ||
}; | ||
|
||
#endif // BUTTONMOUSE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.