summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/contactlistview.cpp
Unidiff
Diffstat (limited to 'kaddressbook/views/contactlistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/contactlistview.cpp27
1 files changed, 27 insertions, 0 deletions
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
@@ -268,24 +268,51 @@ ContactListView::ContactListView(KAddressBookTableView *view,
268 // setFrameStyle(QFrame::NoFrame); 268 // setFrameStyle(QFrame::NoFrame);
269 //setLineWidth ( 0 ); 269 //setLineWidth ( 0 );
270 //setMidLineWidth ( 0 ); 270 //setMidLineWidth ( 0 );
271 //setMargin ( 0 ); 271 //setMargin ( 0 );
272#ifndef KAB_EMBEDDED 272#ifndef KAB_EMBEDDED
273 connect(this, SIGNAL(dropped(QDropEvent*)), 273 connect(this, SIGNAL(dropped(QDropEvent*)),
274 this, SLOT(itemDropped(QDropEvent*))); 274 this, SLOT(itemDropped(QDropEvent*)));
275#endif //KAB_EMBEDDED 275#endif //KAB_EMBEDDED
276 276
277 277
278 new DynamicTip( this ); 278 new DynamicTip( this );
279} 279}
280void ContactListView::printMe()
281{
282#ifdef DESKTOP_VERSION
283 QPrinter printer;
284 if (!printer.setup() )
285 return;
286 QPainter p;
287 p.begin ( &printer );
288 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
289 float dx, dy;
290 int wid = (m.width() * 9)/10;
291 dx = (float) wid/(float)contentsWidth ();
292 dy = (float)(m.height()) / (float)contentsHeight ();
293 float scale;
294 // scale to fit the width or height of the paper
295 if ( dx < dy )
296 scale = dx;
297 else
298 scale = dy;
299 p.translate( m.width()/10,0 );
300 p.scale( scale, scale );
301 qDebug("scale %f ", scale);
302 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
303 p.end();
304 qDebug("Why does it not print??? ");
305#endif
306}
280 307
281void ContactListView::setAlternateColor(const QColor &m_AlternateColor) 308void ContactListView::setAlternateColor(const QColor &m_AlternateColor)
282{ 309{
283 mAlternateColor = m_AlternateColor; 310 mAlternateColor = m_AlternateColor;
284} 311}
285 312
286void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect ) 313void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect )
287{ 314{
288 QBrush b = palette().brush(QPalette::Active, QColorGroup::Base); 315 QBrush b = palette().brush(QPalette::Active, QColorGroup::Base);
289 316
290 // Get the brush, which will have the background pixmap if there is one. 317 // Get the brush, which will have the background pixmap if there is one.
291 if (b.pixmap()) 318 if (b.pixmap())