Add ProfileSelectionWidget

Refreshes list of profiles when widget becomes visible to support widget
caching.
This commit is contained in:
WarmUpTill
2025-05-22 21:38:07 +02:00
committed by WarmUpTill
parent 1c94a1ab44
commit 5e3ab19940
6 changed files with 50 additions and 45 deletions

View File

@@ -30,4 +30,23 @@ std::string GetPathInProfileDir(const char *filePath)
return result + "/" + filePath;
}
ProfileSelectionWidget::ProfileSelectionWidget(QWidget *parent)
: FilterComboBox(parent)
{
setEditable(true);
SetAllowUnmatchedSelection(true);
setMaxVisibleItems(20);
PopulateProfileSelection(this);
}
void ProfileSelectionWidget::showEvent(QShowEvent *event)
{
FilterComboBox::showEvent(event);
const QSignalBlocker b(this);
const auto text = currentText();
clear();
PopulateProfileSelection(this);
setCurrentText(text);
}
} // namespace advss