summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/kaddressbooktableview.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index fbfddba..2412170 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -48,13 +48,22 @@ KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab,
mListView = 0;
}
KAddressBookTableView::~KAddressBookTableView()
{
}
-
+void KAddressBookTableView::scrollUP()
+{
+ QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 );
+ QApplication::postEvent( mListView, ev );
+}
+void KAddressBookTableView::scrollDOWN()
+{
+ QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
+ QApplication::postEvent( mListView, ev );
+}
void KAddressBookTableView::reconstructListView()
{
if (mListView)
{
disconnect(mListView, SIGNAL(selectionChanged()),
this, SLOT(addresseeSelected()));
@@ -156,13 +165,18 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
}
}
}
// Sometimes the background pixmap gets messed up when we add lots
// of items.
mListView->repaint();
- emit selected(QString::null);
+ if ( mListView->firstChild() ) {
+ mListView->setCurrentItem ( mListView->firstChild() );
+ mListView->setSelected ( mListView->firstChild(), true );
+ }
+ else
+ emit selected(QString::null);
}
void KAddressBookTableView::writeConfig(KConfig *config)
{
KAddressBookView::writeConfig(config);