ui: basic search view
- Added a basic SearchView (+ controller and qt implementation) - SearchView can set the active element of other views by dispatching a message. - SearchView adjusts its text when the active element is changed by other views. - Added wrappers for Button and EditBox that allow the usage of simple callback functions.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#include "qt/element/QtEditBox.h"
|
||||
|
||||
QtEditBox::QtEditBox(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
, m_onReturnPressed(nullptr)
|
||||
{
|
||||
connect(this, SIGNAL(returnPressed()), this, SLOT(slotOnReturnPressed()));
|
||||
}
|
||||
|
||||
QtEditBox::~QtEditBox()
|
||||
{
|
||||
}
|
||||
|
||||
void QtEditBox::setCallbackOnReturnPressed(std::function<void(void)> callback)
|
||||
{
|
||||
m_onReturnPressed = callback;
|
||||
}
|
||||
|
||||
void QtEditBox::slotOnReturnPressed()
|
||||
{
|
||||
if (m_onReturnPressed)
|
||||
m_onReturnPressed();
|
||||
}
|
||||
Reference in New Issue
Block a user