mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 00:05:41 -05:00
Add helpers which also update the lineEdit text of FilterComboBox
This commit is contained in:
@@ -62,6 +62,23 @@ void FilterComboBox::SetFilterBehaviourEnabled(bool value)
|
||||
FilterComboBox::_filteringEnabled = value;
|
||||
}
|
||||
|
||||
void FilterComboBox::setCurrentText(const QString &text)
|
||||
{
|
||||
if (_filteringEnabled) {
|
||||
lineEdit()->setText(text);
|
||||
}
|
||||
QComboBox::setCurrentText(text);
|
||||
}
|
||||
|
||||
void FilterComboBox::setItemText(int index, const QString &text)
|
||||
{
|
||||
QComboBox::setItemText(index, text);
|
||||
if (_filteringEnabled && index == currentIndex()) {
|
||||
const QSignalBlocker b(this);
|
||||
lineEdit()->setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
void FilterComboBox::focusOutEvent(QFocusEvent *event)
|
||||
{
|
||||
// Reset on invalid selection
|
||||
|
||||
Reference in New Issue
Block a user