-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 6 | ||||
-rw-r--r-- | noncore/graphics/drawpad/main.cpp | 1 |
5 files changed, 11 insertions, 6 deletions
@@ -1,4 +1,5 @@ | |||
1 | 2004-??-??The Opie Team <opie@handhelds.org> | 1 | 2004-??-??The Opie Team <opie@handhelds.org> |
2 | 2 | ||
3 | * Fixed Drawpad initialization (Bug #1314) (mickeyl) | ||
3 | * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) | 4 | * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) |
4 | * Added Conversion tool for pim-data (eilers) | 5 | * Added Conversion tool for pim-data (eilers) |
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index d9d0ce0..c0f42d9 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -50,5 +50,4 @@ | |||
50 | 50 | ||
51 | using namespace Opie::Ui; | 51 | using namespace Opie::Ui; |
52 | using namespace Opie::Ui; | ||
53 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | 52 | DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) |
54 | : QMainWindow(parent, name, WStyle_ContextHelp) | 53 | : QMainWindow(parent, name, WStyle_ContextHelp) |
@@ -282,5 +281,8 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | |||
282 | changeBrushColor(Qt::white); | 281 | changeBrushColor(Qt::white); |
283 | 282 | ||
284 | finishStartup(); | 283 | // delay the rest of the initialization and do it from within the mainloop |
284 | // if we don't do this, the widget layout may not be constructed upon | ||
285 | // and we will end up with a wrong QScrollview page size (Mickeyl) | ||
286 | QTimer::singleShot( 100, this, SLOT( finishStartup() ) ); | ||
285 | } | 287 | } |
286 | 288 | ||
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index ba9e47d..63d3057 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -42,7 +42,8 @@ public: | |||
42 | 42 | ||
43 | bool antiAliasing(); | 43 | bool antiAliasing(); |
44 | void finishStartup(); | ||
45 | 44 | ||
46 | private slots: | 45 | private slots: |
46 | void finishStartup(); | ||
47 | |||
47 | void newPage(); | 48 | void newPage(); |
48 | void clearPage(); | 49 | void clearPage(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 423ef26..5d0c6e4 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -517,9 +517,11 @@ void DrawPadCanvas::contentsMouseMoveEvent(QMouseEvent* e) | |||
517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) | 517 | void DrawPadCanvas::drawContents(QPainter* p, int cx, int cy, int cw, int ch) |
518 | { | 518 | { |
519 | Page* currentPage = m_pages.current(); | ||
520 | if ( !currentPage ) return; // no page yet --> initialization not finished (Mickeyl) | ||
519 | QRect clipRect(cx, cy, cw, ch); | 521 | QRect clipRect(cx, cy, cw, ch); |
520 | QRect pixmapRect(0, 0, m_pages.current()->pixmap()->width(), m_pages.current()->pixmap()->height()); | 522 | QRect pixmapRect(0, 0, currentPage->pixmap()->width(), m_pages.current()->pixmap()->height()); |
521 | QRect drawRect = pixmapRect.intersect(clipRect); | 523 | QRect drawRect = pixmapRect.intersect(clipRect); |
522 | 524 | ||
523 | p->drawPixmap(drawRect.topLeft(), *(m_pages.current()->pixmap()), drawRect); | 525 | p->drawPixmap(drawRect.topLeft(), *(currentPage->pixmap()), drawRect); |
524 | 526 | ||
525 | if (drawRect.right() < clipRect.right()) { | 527 | if (drawRect.right() < clipRect.right()) { |
diff --git a/noncore/graphics/drawpad/main.cpp b/noncore/graphics/drawpad/main.cpp index e48bb2e..f468022 100644 --- a/noncore/graphics/drawpad/main.cpp +++ b/noncore/graphics/drawpad/main.cpp | |||
@@ -17,4 +17,3 @@ | |||
17 | 17 | ||
18 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
19 | using namespace Opie::Core; | ||
20 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) | 19 | OPIE_EXPORT_APP( OApplicationFactory<DrawPad> ) |