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;
|
QtMaterialFlatButton *widget;
|
||||||
if ((widget = static_cast<QtMaterialFlatButton *>(watched))) {
|
if ((widget = static_cast<QtMaterialFlatButton *>(watched))) {
|
||||||
setText(widget->text());
|
QString text(widget->text());
|
||||||
|
setText(text);
|
||||||
|
emit itemSelected(text);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@ public:
|
||||||
|
|
||||||
void setDataSource(const QStringList &data);
|
void setDataSource(const QStringList &data);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void itemSelected(QString);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void updateResults(QString text);
|
void updateResults(QString text);
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ AutoCompleteSettingsEditor::AutoCompleteSettingsEditor(QWidget *parent)
|
||||||
canvas->setStyleSheet("QWidget { background: white; }");
|
canvas->setStyleSheet("QWidget { background: white; }");
|
||||||
layout->addWidget(canvas);
|
layout->addWidget(canvas);
|
||||||
|
|
||||||
|
canvas->setMinimumHeight(900); //
|
||||||
|
|
||||||
//ui->setupUi(widget);
|
//ui->setupUi(widget);
|
||||||
layout->setContentsMargins(20, 20, 20, 20);
|
layout->setContentsMargins(20, 20, 20, 20);
|
||||||
|
|
||||||
|
@ -86,6 +88,7 @@ AutoCompleteSettingsEditor::AutoCompleteSettingsEditor(QWidget *parent)
|
||||||
m_autocomplete->setDataSource(states);
|
m_autocomplete->setDataSource(states);
|
||||||
|
|
||||||
layout->addWidget(m_autocomplete);
|
layout->addWidget(m_autocomplete);
|
||||||
|
layout->addSpacing(600);
|
||||||
layout->setAlignment(m_autocomplete, Qt::AlignCenter);
|
layout->setAlignment(m_autocomplete, Qt::AlignCenter);
|
||||||
|
|
||||||
setupForm();
|
setupForm();
|
||||||
|
|
Loading…
Reference in New Issue