ui: search view autocompletion

- Implemented autocompletion for the QtSearchView.
- Added: MessageFinishedParsing that will be dispatched by the Project after the parsing step is done.
- Moved the initial MessageActivateToken from the Project to the Application.
- Added getNamesForNodesWithNamePrefix() to GraphAccess.
This commit is contained in:
malte_langkabel
2014-07-07 11:25:46 +02:00
parent a70a9009cc
commit c02767362f
18 changed files with 162 additions and 11 deletions
+18
View File
@@ -1,10 +1,13 @@
#include "qt/element/QtEditBox.h"
#include "utility/logging/logging.h"
QtEditBox::QtEditBox(QWidget *parent)
: QLineEdit(parent)
, m_onReturnPressed(nullptr)
, m_onTextEdited(nullptr)
{
connect(this, SIGNAL(returnPressed()), this, SLOT(slotOnReturnPressed()));
connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(slotOnTextEdited(const QString&)));
}
QtEditBox::~QtEditBox()
@@ -16,8 +19,23 @@ void QtEditBox::setCallbackOnReturnPressed(std::function<void(void)> callback)
m_onReturnPressed = callback;
}
void QtEditBox::setCallbackOnTextEdited(std::function<void(const std::string&)> callback)
{
m_onTextEdited = callback;
}
void QtEditBox::slotOnReturnPressed()
{
if (m_onReturnPressed)
{
m_onReturnPressed();
}
}
void QtEditBox::slotOnTextEdited(const QString& text)
{
if (m_onTextEdited)
{
m_onTextEdited(text.toStdString());
}
}