[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/nepomuk-kde/annotation/lib/gui
From: Sebastian Trueg <sebastian () trueg ! de>
Date: 2011-02-24 12:50:22
Message-ID: 20110224125022.BAEFDAC8C0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1222510 by trueg:
Fixed sorting of annotations
M +1 -0 annotationrelevancefiltermodel.cpp
M +5 -6 annotationwidget.cpp
--- trunk/playground/base/nepomuk-kde/annotation/lib/gui/annotationrelevancefiltermodel.cpp \
#1222509:1222510 @@ -68,6 +68,7 @@
void Nepomuk::AnnotationRelevanceFilterModel::setFilterResource( const \
Nepomuk::Resource& res ) {
d->filterResource = res;
+ invalidateFilter();
}
--- trunk/playground/base/nepomuk-kde/annotation/lib/gui/annotationwidget.cpp \
#1222509:1222510 @@ -23,7 +23,7 @@
#include <kpixmapsequenceoverlaypainter.h>
#include <kpixmapsequence.h>
-#include <QtGui/QTreeView>
+#include <QtGui/QListView>
#include <QtGui/QVBoxLayout>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QKeyEvent>
@@ -43,7 +43,7 @@
class Nepomuk::AnnotationWidget::Private
{
public:
- QTreeView* m_annotationsView;
+ QListView* m_annotationsView;
KLineEdit* m_filterEdit;
Nepomuk::ResourceAnnotationModel* m_model;
@@ -88,6 +88,7 @@
if ( !navigationPerformed )
m_annotationsView->selectionModel()->select( m_sortModel->index( 0, 0 ),
\
QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent ); + \
m_sortModel->sort(0, Qt::DescendingOrder); }
@@ -136,12 +137,10 @@
d->m_sortModel = new AnnotationRelevanceFilterModel( d->m_model );
d->m_sortModel->setSourceModel( d->m_model );
d->m_sortModel->setSortRole( Nepomuk::AnnotationModel::RelevanceRole );
+ d->m_sortModel->setMinRelevance(0.1);
- d->m_annotationsView = new QTreeView( this );
+ d->m_annotationsView = new QListView( this );
d->m_annotationsView->setModel( d->m_sortModel );
- d->m_annotationsView->setSortingEnabled( true );
- d->m_annotationsView->setHeaderHidden( true );
- d->m_annotationsView->setRootIsDecorated( false );
d->m_annotationsView->setFocusPolicy(Qt::NoFocus);
d->m_annotationsView->setSelectionMode( QAbstractItemView::SingleSelection );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic