summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbookcardview.cpp
Unidiff
Diffstat (limited to 'kaddressbook/views/kaddressbookcardview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index b503652..1e5a556 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -18,19 +18,24 @@
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qdragobject.h> 24#include <q3dragobject.h>
25#include <qevent.h> 25#include <qevent.h>
26#include <qiconview.h> 26#include <q3iconview.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29#include <qregexp.h> 29#include <qregexp.h>
30#include <qapplication.h> 30#include <qapplication.h>
31//Added by qt3to4:
32#include <QDropEvent>
33#include <QKeyEvent>
34#include <Q3VBoxLayout>
35#include <QDragEnterEvent>
31 36
32#include <kabc/addressbook.h> 37#include <kabc/addressbook.h>
33#include <kabc/addressee.h> 38#include <kabc/addressee.h>
34#include <kconfig.h> 39#include <kconfig.h>
35#include <kdebug.h> 40#include <kdebug.h>
36#include <klocale.h> 41#include <klocale.h>
@@ -122,13 +127,13 @@ void AddresseeCardView::printMe()
122#ifdef DESKTOP_VERSION 127#ifdef DESKTOP_VERSION
123 QPrinter printer; 128 QPrinter printer;
124 if (!printer.setup() ) 129 if (!printer.setup() )
125 return; 130 return;
126 QPainter p; 131 QPainter p;
127 p.begin ( &printer ); 132 p.begin ( &printer );
128 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 133 Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &printer );
129 float dx, dy; 134 float dx, dy;
130 int wid = (m.width() * 9)/10; 135 int wid = (m.width() * 9)/10;
131 dx = (float) wid/(float)contentsWidth (); 136 dx = (float) wid/(float)contentsWidth ();
132 dy = (float)(m.height()) / (float)contentsHeight (); 137 dy = (float)(m.height()) / (float)contentsHeight ();
133 float scale; 138 float scale;
134 // scale to fit the width or height of the paper 139 // scale to fit the width or height of the paper
@@ -145,13 +150,13 @@ void AddresseeCardView::printMe()
145} 150}
146 151
147 152
148void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) 153void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e)
149{ 154{
150#ifndef KAB_EMBEDDED 155#ifndef KAB_EMBEDDED
151 if (QTextDrag::canDecode(e)) 156 if (Q3TextDrag::canDecode(e))
152 e->accept(); 157 e->accept();
153#else //KAB_EMBEDDED 158#else //KAB_EMBEDDED
154qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); 159qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented");
155#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
156} 161}
157 162
@@ -173,13 +178,13 @@ KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab,
173 QWidget *parent, const char *name ) 178 QWidget *parent, const char *name )
174 : KAddressBookView( ab, parent, name ) 179 : KAddressBookView( ab, parent, name )
175{ 180{
176 mShowEmptyFields = false; 181 mShowEmptyFields = false;
177 182
178 // Init the GUI 183 // Init the GUI
179 QVBoxLayout *layout = new QVBoxLayout(viewWidget()); 184 Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
180 185
181 mCardView = new AddresseeCardView(viewWidget(), "mCardView"); 186 mCardView = new AddresseeCardView(viewWidget(), "mCardView");
182 mCardView->setSelectionMode(CardView::Extended); 187 mCardView->setSelectionMode(CardView::Extended);
183 layout->addWidget(mCardView); 188 layout->addWidget(mCardView);
184 189
185 // Connect up the signals 190 // Connect up the signals
@@ -517,9 +522,9 @@ void KAddressBookCardView::addresseeSelected()
517 } 522 }
518 523
519 if (!found) 524 if (!found)
520 emit selected(QString::null); 525 emit selected(QString::null);
521 526
522} 527}
523#ifndef KAB_EMBEDDED 528#ifndef KAB_EMBEDDED_
524#include "kaddressbookcardview.moc" 529#include "moc_kaddressbookcardview.cpp"
525#endif //KAB_EMBEDDED 530#endif //KAB_EMBEDDED