summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbookcardview.cpp
Side-by-side diff
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
@@ -12,31 +12,36 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
-#include <qdragobject.h>
+#include <q3dragobject.h>
#include <qevent.h>
-#include <qiconview.h>
+#include <q3iconview.h>
#include <qlayout.h>
#include <qstringlist.h>
#include <qregexp.h>
#include <qapplication.h>
+//Added by qt3to4:
+#include <QDropEvent>
+#include <QKeyEvent>
+#include <Q3VBoxLayout>
+#include <QDragEnterEvent>
#include <kabc/addressbook.h>
#include <kabc/addressee.h>
#include <kconfig.h>
#include <kdebug.h>
#include <klocale.h>
#include "kabprefs.h"
#include "viewmanager.h"
#include "kaddressbookcardview.h"
@@ -116,48 +121,48 @@ AddresseeCardView::AddresseeCardView(QWidget *parent, const char *name)
AddresseeCardView::~AddresseeCardView()
{
}
void AddresseeCardView::printMe()
{
#ifdef DESKTOP_VERSION
QPrinter printer;
if (!printer.setup() )
return;
QPainter p;
p.begin ( &printer );
- QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
+ Q3PaintDeviceMetrics m = Q3PaintDeviceMetrics ( &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();
repaint();
#endif
}
void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e)
{
#ifndef KAB_EMBEDDED
- if (QTextDrag::canDecode(e))
+ if (Q3TextDrag::canDecode(e))
e->accept();
#else //KAB_EMBEDDED
qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented");
#endif //KAB_EMBEDDED
}
void AddresseeCardView::dropEvent(QDropEvent *e)
{
emit addresseeDropped(e);
}
void AddresseeCardView::startDrag()
@@ -167,25 +172,25 @@ void AddresseeCardView::startDrag()
///////////////////////////////
// KAddressBookCardView
KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab,
QWidget *parent, const char *name )
: KAddressBookView( ab, parent, name )
{
mShowEmptyFields = false;
// Init the GUI
- QVBoxLayout *layout = new QVBoxLayout(viewWidget());
+ Q3VBoxLayout *layout = new Q3VBoxLayout(viewWidget());
mCardView = new AddresseeCardView(viewWidget(), "mCardView");
mCardView->setSelectionMode(CardView::Extended);
layout->addWidget(mCardView);
// Connect up the signals
connect(mCardView, SIGNAL(executed(CardViewItem *)),
this, SLOT(addresseeExecuted(CardViewItem *)));
connect(mCardView, SIGNAL(selectionChanged()),
this, SLOT(addresseeSelected()));
connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)),
this, SIGNAL(dropped(QDropEvent*)));
@@ -511,15 +516,15 @@ void KAddressBookCardView::addresseeSelected()
if ( aItem )
{
emit selected(aItem->addressee().uid());
found = true;
}
}
}
if (!found)
emit selected(QString::null);
}
-#ifndef KAB_EMBEDDED
-#include "kaddressbookcardview.moc"
+#ifndef KAB_EMBEDDED_
+#include "moc_kaddressbookcardview.cpp"
#endif //KAB_EMBEDDED