smooth scrolling++

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=729565
This commit is contained in:
Rafael Fernández López 2007-10-26 07:58:12 +00:00
parent 96accbd236
commit e1868db200

View File

@ -53,6 +53,7 @@ KCategorizedItemsView::KCategorizedItemsView(QWidget * parent, Qt::WindowFlags f
itemsView->header()->setVisible(false); itemsView->header()->setVisible(false);
itemsView->setItemDelegate(m_delegate = new KCategorizedItemsViewDelegate(this)); itemsView->setItemDelegate(m_delegate = new KCategorizedItemsViewDelegate(this));
itemsView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
comboFilters->setItemDelegate(new KCategorizedItemsViewFilterDelegate(this)); comboFilters->setItemDelegate(new KCategorizedItemsViewFilterDelegate(this));
@ -95,6 +96,10 @@ void KCategorizedItemsView::setItemModel(QStandardItemModel * model)
m_modelFilterItems->setSourceModel(m_modelItems); m_modelFilterItems->setSourceModel(m_modelItems);
itemsView->setModel(m_modelFilterItems); itemsView->setModel(m_modelFilterItems);
if (m_modelFilterItems->rowCount()) {
itemsView->verticalScrollBar()->setSingleStep(itemsView->sizeHintForRow(0));
}
} }
void KCategorizedItemsView::searchTermChanged(const QString & text) void KCategorizedItemsView::searchTermChanged(const QString & text)