21#ifndef SEARCHABLEVIEW_H
22#define SEARCHABLEVIEW_H
24#include "Gui/Utils/Widgets/WidgetTemplate.h"
25#include "Gui/Utils/SearchableWidget/SelectionView.h"
26#include "Gui/Utils/SearchableWidget/SearchableModel.h"
27#include "Utils/Pimpl.h"
34class QAbstractItemView;
35class QItemSelectionModel;
53 bool isActive()
const;
55 bool handleKeyPress(QKeyEvent* e);
58 void lineEditChanged(
const QString& str);
60 void selectPrevious();
74 enum class SearchDirection :
unsigned char
85 QAbstractItemView* view()
const;
86 virtual int viewportHeight()
const;
87 virtual int viewportWidth()
const;
89 int setSearchstring(
const QString& str);
90 void selectNextMatch(
const QString& str);
91 void selectPreviousMatch(
const QString& str);
92 bool isMinisearcherActive()
const;
96 virtual QModelIndex matchIndex(
const QString& str, SearchDirection direction)
const;
97 virtual void selectMatch(
const QString& str, SearchDirection direction);
98 bool handleKeyPress(QKeyEvent* e)
override;
102template<
typename View,
typename Model>
108 using View::setModel;
109 using SearchableViewInterface::setSearchModel;
119 virtual void setSearchableModel(Model* model)
121 View::setModel(model);
122 SearchableViewInterface::setSearchModel(model);
127 return (View::model() ==
nullptr) ? 0 : View::model()->rowCount();
131 void keyPressEvent(QKeyEvent* e)
override
133 bool processed = handleKeyPress(e);
138 View::keyPressEvent(e);
The MiniSearcherViewConnector class @ingrou Searchable.
Definition: SearchableView.h:44
Definition: LanguageUtils.h:31
The SearchableModelInterface class.
Definition: SearchableModel.h:39
The SearchViewInterface class.
Definition: SearchableView.h:70
Definition: SearchableView.h:106
The SayonaraSelectionView class.
Definition: SelectionView.h:40