Guest User

Untitled

a guest
Feb 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. void AmazonItemTreeView::dataChanged( const QModelIndex &topLeft, const QModelIndex &bottomRight )
  2. {
  3. qDebug() << "dataChanged";
  4.  
  5. int i = 0;
  6. QModelIndex index = model()->index( i, 1 );
  7.  
  8. // show only albums with price, hide the rest
  9. while( index.isValid() )
  10. {
  11. qDebug() << "another one";
  12. if( index.data() == QString() )
  13. {
  14. qDebug() << "let's hide";
  15. setRowHidden( i, QModelIndex(), true );
  16. }
  17. i++;
  18. index = model()->index( i, 1 );
  19. }
  20.  
  21. QTreeView::dataChanged( topLeft, bottomRight );
  22.  
  23. header()->setResizeMode( 1, QHeaderView::ResizeToContents );
  24. header()->setResizeMode( 0, QHeaderView::Stretch );
  25. }
Add Comment
Please, Sign In to add comment