Skip to content

Commit

Permalink
fixes crash when the filter regex has no matches.
Browse files Browse the repository at this point in the history
  • Loading branch information
nholthaus committed Oct 18, 2016
1 parent ea9370a commit 2a04c29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ A Qt5 based automated test-runner and Graphical User Interface for Google Test u

![Path](resources/screenshots/path.png)

- Mousing over any of the test executables will show the full path to the test as a tooltip. This can be useful for disambiguating multiple tests with the same name. On Windows, `Debug` and `Release` builds
- Mousing over any of the test executables will show the full path to the test as a tooltip. This can be useful for disambiguating multiple tests with the same name. On Windows, `Debug` and `Release` builds are differentiated automatically.

# Test case window

## Detailed failure information
Expand Down
12 changes: 9 additions & 3 deletions src/mainwindow_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,23 @@ MainWindowPrivate::MainWindowPrivate(QStringList tests, bool reset, MainWindow*
if (QRegExp(text).isValid())
{
testCaseProxyModel->setFilterRegExp(text);
testCaseTreeView->expandAll();
for (int i = 0; i < testCaseProxyModel->columnCount(); ++i)
if(testCaseProxyModel->rowCount())
{
testCaseTreeView->resizeColumnToContents(i);
testCaseTreeView->expandAll();
for (int i = 0; i < testCaseProxyModel->columnCount(); ++i)
{
testCaseTreeView->resizeColumnToContents(i);
}
}
}
});

// create a failure model when a test is clicked
connect(testCaseTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, [this](const QItemSelection& selected, const QItemSelection& deselected)
{
if (selected.indexes().size() == 0)
return;

auto index = testCaseProxyModel->mapToSource(selected.indexes().first());
DomItem* item = static_cast<DomItem*>(index.internalPointer());

Expand Down

0 comments on commit 2a04c29

Please sign in to comment.