Advertisement
rnort

SAMPLE_SEARCH

May 27th, 2012
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // search button
  2. void MainWindow::on_pushButton_released()
  3. {
  4.  
  5.     QString info = ui->info->text();
  6.     int column = ui->column->text().toInt(); // manual column num input
  7.     int rowcount = ui->tableNew->rowCount();
  8.  
  9.     on_pushButton_2_released();
  10.  
  11.     for (int i = 0; i < rowcount; ++i)
  12.     {
  13.         if ( ui->tableNew->item(i, column)->text() == info )
  14.             continue;
  15.         ui->tableNew->hideRow(i);
  16.     }
  17.  
  18. }
  19. // clear search button
  20. void MainWindow::on_pushButton_2_released()
  21. {
  22.     int rowcount = ui->tableNew->rowCount();
  23.     for (int i = 0; i < rowcount; ++i)
  24.     {
  25.         ui->tableNew->showRow(i);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement