author | zautrix <zautrix> | 2004-10-10 23:26:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-10 23:26:49 (UTC) |
commit | ea40295e233db219dc2431960e18fb4398ddb75c (patch) (side-by-side diff) | |
tree | 1d654ae51d7f65f4375787105951a8f4f9fc359e /kaddressbook/views/kaddressbookiconview.cpp | |
parent | 640874bb21ea348edb33a54690ad225e0efdd1e4 (diff) | |
download | kdepimpi-ea40295e233db219dc2431960e18fb4398ddb75c.zip kdepimpi-ea40295e233db219dc2431960e18fb4398ddb75c.tar.gz kdepimpi-ea40295e233db219dc2431960e18fb4398ddb75c.tar.bz2 |
added better searching in kapi
Diffstat (limited to 'kaddressbook/views/kaddressbookiconview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index fdc0db9..f4c68b8 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp @@ -36,16 +36,17 @@ #endif //KAB_EMBEDDED #include <kabc/addressbook.h> #include "kabprefs.h" #include "viewmanager.h" #include "kaddressbookiconview.h" #include <qlayout.h> #include <qregexp.h> +#include <qapplication.h> #include <kglobal.h> /*US transfered to the headerfile class IconViewFactory : public ViewFactory { public: KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) { return new KAddressBookIconView( ab, parent, name ); @@ -206,16 +207,26 @@ KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, connect(mIconView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); } KAddressBookIconView::~KAddressBookIconView() { } +void KAddressBookIconView::scrollUP() +{ + QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); + QApplication::postEvent( mIconView, ev ); +} +void KAddressBookIconView::scrollDOWN() +{ + QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); + QApplication::postEvent( mIconView, ev ); +} void KAddressBookIconView::readConfig(KConfig *config) { KAddressBookView::readConfig(config); //US method executed is part of KIconView //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), //US this, SLOT(addresseeExecuted(QIconViewItem *))); disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), @@ -275,16 +286,22 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) { mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); continue; } } } } mIconView->arrangeItemsInGrid( true ); + if ( mIconView->firstItem() ) { + mIconView->setCurrentItem ( mIconView->firstItem() ); + mIconView->setSelected ( mIconView->firstItem() , true ); + } + else + emit selected(QString::null); } QStringList KAddressBookIconView::selectedUids() { QStringList uidList; QIconViewItem *item; AddresseeIconViewItem *aItem; for (item = mIconView->firstItem(); item; item = item->nextItem()) |