1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include "window-selection.hpp"
#include "selection-helpers.hpp"
namespace advss {
WindowSelectionWidget::WindowSelectionWidget(QWidget *parent)
: FilterComboBox(parent)
{
setEditable(true);
SetAllowUnmatchedSelection(true);
setMaxVisibleItems(20);
PopulateWindowSelection(this);
}
void WindowSelectionWidget::showEvent(QShowEvent *event)
{
FilterComboBox::showEvent(event);
const QSignalBlocker b(this);
const auto text = currentText();
clear();
PopulateWindowSelection(this);
setCurrentText(text);
}
} // namespace advss
|