Fix invalid use of freed object in settings dialog test

This commit is contained in:
Martchus 2022-06-09 21:01:58 +02:00
parent 9dd375abe9
commit 29b2267711
1 changed files with 1 additions and 0 deletions

View File

@ -25,6 +25,7 @@ void DialogsTests::testSettingsDialog()
auto *const testCategory = new OptionCategory();
testCategory->setDisplayName(QStringLiteral("Test category"));
testCategory->setIcon(QIcon::fromTheme(QStringLiteral("preferences")));
settingsDlg.showCategory(nullptr); // ensure no current category is shown anymore
settingsDlg.setSingleCategory(nullptr);
auto *const qtCategory = qtSettings.category();
settingsDlg.categoryModel()->setCategories(QList<OptionCategory *>({testCategory, qtCategory}));