Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AmazonItemTreeView::dataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight )
- {
- qDebug() << "dataChanged";
- int i = 0;
- QModelIndex index = model()->index( i, 1 );
- // show only albums with price, hide the rest
- while( index.isValid() )
- {
- qDebug() << "another one";
- if( index.data() == QString() )
- {
- qDebug() << "let's hide";
- setRowHidden( i, QModelIndex(), true );
- }
- i++;
- index = model()->index( i, 1 );
- }
- QTreeView::dataChanged( topLeft, bottomRight );
- header()->setResizeMode( 1, QHeaderView::ResizeToContents );
- header()->setResizeMode( 0, QHeaderView::Stretch );
- }
Add Comment
Please, Sign In to add comment