Browse Source

Little workaround

v0.9.0
Ulrich Van Den Hekke 12 years ago
parent
commit
623fccb1ca
  1. 8
      framework/contentview2/contentview2completionmodel.cpp
  2. 1
      framework/contentview2/contentview2completionmodel.h
  3. 3
      unittest/testcontentview2/testcontentview2.cpp

8
framework/contentview2/contentview2completionmodel.cpp

@ -53,6 +53,14 @@ QVariant CompletionModel::data( const QModelIndex &idx, int role ) const {
return QSqlQueryModel::data( idx, role );
}
bool CompletionModel::setHeaderData( int section, Qt::Orientation orientation, const QVariant & value, int role ) {
Q_UNUSED( section );
Q_UNUSED( orientation );
Q_UNUSED( value );
Q_UNUSED( role );
return false;
}
int CompletionModel::columnCount( const QModelIndex & parent ) const {
Q_UNUSED( parent );
return 1;

1
framework/contentview2/contentview2completionmodel.h

@ -38,6 +38,7 @@ public:
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual int columnCount( const QModelIndex & parent = QModelIndex() ) const;
virtual bool setHeaderData( int section, Qt::Orientation orientation, const QVariant & value, int role = Qt::EditRole );
void addWhereClause( const QString & whereClause );
void addFile( uint file );

3
unittest/testcontentview2/testcontentview2.cpp

@ -194,12 +194,11 @@ void TestContentView2::testListModel() {
list->show();
ContentView2::CompletionModel * model = new ContentView2::CompletionModel( XINXProjectManager::self()->session()->database(), this );
new ModelTest( model, model );
list->setModel( model );
model->addFile( m_rootId );
model->addWhereClause( "cv_node.type = 'XslTemplate'" );
new ModelTest( model, model );
model->select();
qApp->processEvents();

Loading…
Cancel
Save