Add itemSelected signal to Auto Complete
This commit is contained in:
parent
46eeb4f063
commit
837762c647
|
@ -180,7 +180,9 @@ bool QtMaterialAutoComplete::eventFilter(QObject *watched, QEvent *event)
|
|||
});
|
||||
QtMaterialFlatButton *widget;
|
||||
if ((widget = static_cast<QtMaterialFlatButton *>(watched))) {
|
||||
setText(widget->text());
|
||||
QString text(widget->text());
|
||||
setText(text);
|
||||
emit itemSelected(text);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,9 @@ public:
|
|||
|
||||
void setDataSource(const QStringList &data);
|
||||
|
||||
signals:
|
||||
void itemSelected(QString);
|
||||
|
||||
protected slots:
|
||||
void updateResults(QString text);
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ AutoCompleteSettingsEditor::AutoCompleteSettingsEditor(QWidget *parent)
|
|||
canvas->setStyleSheet("QWidget { background: white; }");
|
||||
layout->addWidget(canvas);
|
||||
|
||||
canvas->setMinimumHeight(900); //
|
||||
|
||||
//ui->setupUi(widget);
|
||||
layout->setContentsMargins(20, 20, 20, 20);
|
||||
|
||||
|
@ -86,6 +88,7 @@ AutoCompleteSettingsEditor::AutoCompleteSettingsEditor(QWidget *parent)
|
|||
m_autocomplete->setDataSource(states);
|
||||
|
||||
layout->addWidget(m_autocomplete);
|
||||
layout->addSpacing(600);
|
||||
layout->setAlignment(m_autocomplete, Qt::AlignCenter);
|
||||
|
||||
setupForm();
|
||||
|
|
Loading…
Reference in New Issue