logic: fixed Searchbutton not searching and wrong destruction order in ComponentManager

This commit is contained in:
Eberhard Graether
2015-02-10 10:31:14 +01:00
parent 229c7a763b
commit 53eab0a517
4 changed files with 12 additions and 9 deletions
+6 -6
View File
@@ -28,6 +28,12 @@ void QtQueryElement::onChecked(bool)
}
void QtSmartSearchBox::search()
{
editTextToElement();
MessageSearch(utility::join(m_tokens, "") + text().toStdString()).dispatch();
}
QtSmartSearchBox::QtSmartSearchBox(QWidget* parent)
: QLineEdit(parent)
, m_allowTextChange(false)
@@ -82,12 +88,6 @@ void QtSmartSearchBox::setFocus()
layoutElements();
}
void QtSmartSearchBox::search()
{
editTextToElement();
MessageSearch(utility::join(m_tokens, "") + text().toStdString()).dispatch();
}
bool QtSmartSearchBox::event(QEvent *event)
{
if (event->type() == QEvent::KeyPress)
+3 -1
View File
@@ -31,6 +31,9 @@ class QtSmartSearchBox
{
Q_OBJECT
public slots:
void search();
public:
QtSmartSearchBox(QWidget* parent);
virtual ~QtSmartSearchBox();
@@ -38,7 +41,6 @@ public:
void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList);
void setQuery(const std::string& text);
void setFocus();
void search();
protected:
virtual bool event(QEvent *event);
+1 -1
View File
@@ -32,7 +32,7 @@ void ComponentManager::setup(ViewLayout* viewLayout)
std::shared_ptr<CompositeView> compositeView =
m_componentFactory->getViewFactory()->createCompositeView(viewLayout, CompositeView::DIRECTION_HORIZONTAL);
m_views.push_back(compositeView);
m_compositeViews.push_back(compositeView);
std::shared_ptr<Component> undoRedoComponent = m_componentFactory->createUndoRedoComponent(compositeView.get());
m_components.push_back(undoRedoComponent);
+2 -1
View File
@@ -9,6 +9,7 @@
#include "data/access/LocationAccess.h"
#include "data/access/GraphAccess.h"
class CompositeView;
class View;
class ViewFactory;
class ViewLayout;
@@ -30,8 +31,8 @@ private:
std::shared_ptr<ComponentFactory> m_componentFactory;
std::vector<std::shared_ptr<CompositeView>> m_compositeViews;
std::vector<std::shared_ptr<Component>> m_components;
std::vector<std::shared_ptr<View>> m_views;
};
#endif // COMPONENT_MANAGER_H