author | zecke <zecke> | 2004-04-08 00:42:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-08 00:42:01 (UTC) |
commit | 5afca2540a2d6bf733c89ea97748496a679bc576 (patch) (unidiff) | |
tree | 3e4e419ccc0e1b1cb71cc2cf7e75d36f9301de81 | |
parent | 8c54ad421c7bee65b2a1442ce85c09f2eff3efc6 (diff) | |
download | opie-5afca2540a2d6bf733c89ea97748496a679bc576.zip opie-5afca2540a2d6bf733c89ea97748496a679bc576.tar.gz opie-5afca2540a2d6bf733c89ea97748496a679bc576.tar.bz2 |
Import a QPixmap via QCOP
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 19 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 20 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.h | 5 |
4 files changed, 40 insertions, 6 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 3331193..d9d0ce0 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -56,2 +56,4 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | |||
56 | // init members | 56 | // init members |
57 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | ||
58 | this, SLOT(slotAppMessage(const QCString&, const QByteArray&)) ); | ||
57 | 59 | ||
@@ -665 +667,18 @@ void DrawPad::saveConfig() | |||
665 | } | 667 | } |
668 | |||
669 | |||
670 | /* | ||
671 | * Import a Thumbnail from SCAP or similiar | ||
672 | */ | ||
673 | void DrawPad::slotAppMessage( const QCString& str, const QByteArray& ar ) { | ||
674 | QDataStream stream(ar, IO_ReadOnly ); | ||
675 | /* | ||
676 | * import the pixmap | ||
677 | */ | ||
678 | if ( str == "importPixmap(QPixmap)" ) { | ||
679 | QPixmap pix; | ||
680 | stream >> pix;; | ||
681 | m_pDrawPadCanvas->importPixmap( pix ); | ||
682 | QPEApplication::setKeepRunning(); | ||
683 | } | ||
684 | } | ||
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 8ba6e58..ba9e47d 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -50,2 +50,4 @@ private slots: | |||
50 | 50 | ||
51 | void slotAppMessage( const QCString&, const QByteArray& ); | ||
52 | |||
51 | void setPointTool(); | 53 | void setPointTool(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 446096c..423ef26 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -182,3 +182,3 @@ void DrawPadCanvas::load(QIODevice* ioDevice) | |||
182 | if (m_pages.isEmpty()) { | 182 | if (m_pages.isEmpty()) { |
183 | m_pages.append(new Page("", | 183 | m_pages.append(new Page("", |
184 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | 184 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), |
@@ -196,3 +196,3 @@ void DrawPadCanvas::initialPage() | |||
196 | { | 196 | { |
197 | m_pages.append(new Page("", | 197 | m_pages.append(new Page("", |
198 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | 198 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), |
@@ -267,2 +267,14 @@ void DrawPadCanvas::importPage(const QString& fileName) | |||
267 | 267 | ||
268 | void DrawPadCanvas::importPixmap( const QPixmap& pix ) { | ||
269 | Page* importedPage = new Page(); | ||
270 | |||
271 | (*importedPage->pixmap()) = pix; | ||
272 | m_pages.insert(m_pages.at()+1, importedPage ); | ||
273 | resizeContents(m_pages.current()->pixmap()->width(), | ||
274 | m_pages.current()->pixmap()->height() ); | ||
275 | viewport()->update(); | ||
276 | |||
277 | emit pagesChanged(); | ||
278 | } | ||
279 | |||
268 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) | 280 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) |
@@ -355,3 +367,3 @@ void DrawPadCanvas::deleteAll() | |||
355 | 367 | ||
356 | m_pages.append(new Page("", | 368 | m_pages.append(new Page("", |
357 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | 369 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), |
@@ -391,3 +403,3 @@ void DrawPadCanvas::deletePage() | |||
391 | if (m_pages.isEmpty()) { | 403 | if (m_pages.isEmpty()) { |
392 | m_pages.append(new Page("", | 404 | m_pages.append(new Page("", |
393 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), | 405 | clipper()->width()+(verticalScrollBar()->isVisible()?verticalScrollBar()->width():0), |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h index 80a2a7e..2b3d4a5 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.h +++ b/noncore/graphics/drawpad/drawpadcanvas.h | |||
@@ -25,3 +25,3 @@ class Page; | |||
25 | class DrawPadCanvas : public QScrollView | 25 | class DrawPadCanvas : public QScrollView |
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
@@ -38,2 +38,3 @@ public: | |||
38 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); | 38 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); |
39 | void importPixmap( const QPixmap& ); | ||
39 | 40 | ||
@@ -58,3 +59,3 @@ public slots: | |||
58 | void movePageDown(); | 59 | void movePageDown(); |
59 | 60 | ||
60 | void undo(); | 61 | void undo(); |