Disable row expansion on new file load and turn off row expansion when row count gets too high
This commit is contained in:
+17
-2
@@ -473,8 +473,21 @@ void MainWindow::expandAllRows()
|
|||||||
|
|
||||||
void MainWindow::manageRowExpansion()
|
void MainWindow::manageRowExpansion()
|
||||||
{
|
{
|
||||||
if(rowExpansionActive && model->getInterpretMode())
|
int numRows = ui->canFramesView->model()->rowCount();
|
||||||
ui->canFramesView->resizeRowsToContents();
|
if(numRows < 20000)
|
||||||
|
{
|
||||||
|
if(rowExpansionActive && model->getInterpretMode())
|
||||||
|
ui->canFramesView->resizeRowsToContents();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
disableAutoRowExpansion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::disableAutoRowExpansion()
|
||||||
|
{
|
||||||
|
rowExpansionActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::collapseAllRows()
|
void MainWindow::collapseAllRows()
|
||||||
@@ -869,6 +882,7 @@ void MainWindow::handleLoadFile()
|
|||||||
|
|
||||||
if (loadResult)
|
if (loadResult)
|
||||||
{
|
{
|
||||||
|
disableAutoRowExpansion();
|
||||||
ui->canFramesView->scrollToTop();
|
ui->canFramesView->scrollToTop();
|
||||||
model->clearFrames();
|
model->clearFrames();
|
||||||
model->insertFrames(tempFrames);
|
model->insertFrames(tempFrames);
|
||||||
@@ -912,6 +926,7 @@ void MainWindow::handleDroppedFile(const QString &filename)
|
|||||||
|
|
||||||
if (loadResult)
|
if (loadResult)
|
||||||
{
|
{
|
||||||
|
disableAutoRowExpansion();
|
||||||
ui->canFramesView->scrollToTop();
|
ui->canFramesView->scrollToTop();
|
||||||
model->clearFrames();
|
model->clearFrames();
|
||||||
model->insertFrames(loadedFrames);
|
model->insertFrames(loadedFrames);
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ private:
|
|||||||
void writeSettings();
|
void writeSettings();
|
||||||
bool eventFilter(QObject *obj, QEvent *event);
|
bool eventFilter(QObject *obj, QEvent *event);
|
||||||
void manageRowExpansion();
|
void manageRowExpansion();
|
||||||
|
void disableAutoRowExpansion();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user