From 507b362d42d5eed6277ad17422b6ba61acca636e Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 16 Jan 2005 22:19:12 +0000 Subject: print AB --- (limited to 'kaddressbook/views/contactlistview.cpp') diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index 23b091c..e75810e 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp @@ -277,6 +277,33 @@ ContactListView::ContactListView(KAddressBookTableView *view, new DynamicTip( this ); } +void ContactListView::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 ); + qDebug("scale %f ", scale); + drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); + p.end(); + qDebug("Why does it not print??? "); +#endif +} void ContactListView::setAlternateColor(const QColor &m_AlternateColor) { -- cgit v0.9.0.2