From b3460b8fd5d10882334d6bc6ddeadd6b395aa4b0 Mon Sep 17 00:00:00 2001 From: giersch Date: Wed, 21 Nov 2007 07:16:10 +0000 Subject: [PATCH] . --- DrawingWindow.cpp | 10 ++++++++++ DrawingWindow.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/DrawingWindow.cpp b/DrawingWindow.cpp index cf111e9..4cbccc3 100644 --- a/DrawingWindow.cpp +++ b/DrawingWindow.cpp @@ -139,6 +139,16 @@ void DrawingWindow::fillCircle(int x, int y, int r) painter->setBrush(Qt::NoBrush); } +void DrawingWindow::drawText(int x, int y, const char *text) +{ + QRect r(image->rect()); + r.moveTo(x, y); + safeLock(imageMutex); + painter->drawText(r, 0, text, &r); + dirty(r); + safeUnlock(imageMutex); +} + bool DrawingWindow::sync(unsigned long time) { bool synced; diff --git a/DrawingWindow.h b/DrawingWindow.h index 79544dc..28dc14b 100644 --- a/DrawingWindow.h +++ b/DrawingWindow.h @@ -48,6 +48,8 @@ public: void drawCircle(int x, int y, int r); void fillCircle(int x, int y, int r); + void drawText(int x, int y, const char *text); + bool sync(unsigned long time = ULONG_MAX); void sleep(unsigned long secs); -- 2.20.1