author | zautrix <zautrix> | 2005-03-28 13:31:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-28 13:31:19 (UTC) |
commit | e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48 (patch) (side-by-side diff) | |
tree | e1b5b2d51b8026b08f6eb3680304fa8d86d1873a /korganizer/koeventviewer.cpp | |
parent | 314908d5d9139af7711c6e425260363bb014afce (diff) | |
download | kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.zip kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.gz kdepimpi-e4e6bda3a6b0a82e3f64db0fa5f7d60cab9f0e48.tar.bz2 |
fixes
Diffstat (limited to 'korganizer/koeventviewer.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventviewer.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 1508638..445fc86 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -50,12 +50,15 @@ //#define size count //#endif #ifdef DESKTOP_VERSION #include <kabc/addresseedialog.h> #include <kabc/addresseeview.h> +#include <qprinter.h> +#include <qpainter.h> +#include <qpaintdevicemetrics.h> #else //DESKTOP_VERSION #include <externalapphandler.h> #include <qtopia/qcopenvelope_qws.h> #endif //DESKTOP_VERSION KOEventViewer::KOEventViewer(QWidget *parent,const char *name) @@ -66,12 +69,38 @@ KOEventViewer::KOEventViewer(QWidget *parent,const char *name) } KOEventViewer::~KOEventViewer() { } +void KOEventViewer::printMe() +{ +#ifdef DESKTOP_VERSION + QPrinter printer; + if (!printer.setup() ) + return; + QPainter p; + p.begin ( &printer ); + QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); + float dx, dy; + int wid = (m.width() * 9)/10; + dx = (float) wid/(float)contentsWidth (); + dy = (float)(m.height()) / (float)contentsHeight (); + float scale; + // scale to fit the width or height of the paper + if ( dx < dy ) + scale = dx; + else + scale = dy; + p.translate( m.width()/10,0 ); + p.scale( scale, scale ); + drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); + p.end(); +#endif + +} void KOEventViewer::setSource(const QString& n) { if ( n.left(3) == "uid" ) #ifdef DESKTOP_VERSION { |