X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/blobdiff_plain/ec9e65e0d44b797710909ca9416575cec555789f..984344660cf8dad0c54bd4aefba2a034c144da3c:/DrawingWindow.h diff --git a/DrawingWindow.h b/DrawingWindow.h index d1c174b..732183a 100644 --- a/DrawingWindow.h +++ b/DrawingWindow.h @@ -57,6 +57,8 @@ public: 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(); @@ -68,6 +70,7 @@ public: 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); @@ -79,6 +82,8 @@ private: QBasicTimer timer; QMutex imageMutex; + QMutex mouseMutex; + QWaitCondition mouseCondition; QMutex syncMutex; QWaitCondition syncCondition; bool terminateThread; @@ -87,6 +92,9 @@ private: QImage *image; QPainter *painter; + QPoint mousePos; + Qt::MouseButton mouseButton; + bool dirtyFlag; QRect dirtyRect;