A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
graphlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added: DrawingWindo::waitMousePress()
[graphlib.git]
/
DrawingWindow.h
diff --git
a/DrawingWindow.h
b/DrawingWindow.h
index
d1c174b
..
732183a
100644
(file)
--- a/
DrawingWindow.h
+++ b/
DrawingWindow.h
@@
-57,6
+57,8
@@
public:
unsigned int getPointColor(int x, int y);
unsigned int getPointColor(int x, int y);
+ bool waitMousePress(int &x, int &y, int &button,
+ unsigned long time = ULONG_MAX);
bool sync(unsigned long time = ULONG_MAX);
void closeGraph();
bool sync(unsigned long time = ULONG_MAX);
void closeGraph();
@@
-68,6
+70,7
@@
public:
protected:
void closeEvent(QCloseEvent *ev);
void customEvent(QEvent *ev);
protected:
void closeEvent(QCloseEvent *ev);
void customEvent(QEvent *ev);
+ void mousePressEvent(QMouseEvent *ev);
void keyPressEvent(QKeyEvent *ev);
void paintEvent(QPaintEvent *ev);
void showEvent(QShowEvent *ev);
void keyPressEvent(QKeyEvent *ev);
void paintEvent(QPaintEvent *ev);
void showEvent(QShowEvent *ev);
@@
-79,6
+82,8
@@
private:
QBasicTimer timer;
QMutex imageMutex;
QBasicTimer timer;
QMutex imageMutex;
+ QMutex mouseMutex;
+ QWaitCondition mouseCondition;
QMutex syncMutex;
QWaitCondition syncCondition;
bool terminateThread;
QMutex syncMutex;
QWaitCondition syncCondition;
bool terminateThread;
@@
-87,6
+92,9
@@
private:
QImage *image;
QPainter *painter;
QImage *image;
QPainter *painter;
+ QPoint mousePos;
+ Qt::MouseButton mouseButton;
+
bool dirtyFlag;
QRect dirtyRect;
bool dirtyFlag;
QRect dirtyRect;