mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -05:00
Add ProfileSelectionWidget
Refreshes list of profiles when widget becomes visible to support widget caching.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user