QHeaderView* header = ui->tableView->verticalHeader();
QWidget* viewport = header->viewport();
int i1 = header->logicalIndexAt(0);
int i2 = header->logicalIndexAt(viewport->height() - 1);
if (i2 < 0)
i2 = header->count() - 1;
QString s = QString::number(i1) + " - " + QString::number(i2);
ui->lbResult->setText(s);
return m_tableView->viewport()->height() / m_tableView->rowHeight(0);