Mercurial > octave-nkf
diff libgui/src/workspace-view.h @ 19572:e4b25475ef3d gui-release
provide a filter for the workspace view (bug #41222)
* workspace_view.cc (constructor): new combo-box for filter expressions,
new check box for enable/disable filter, connect related signals, get
last state of filter and check box from settings file;
(destructor): write state of filter and check box into settings file;
(setModel): use a filter proxy model between model and table view;
(filter_update): new slot for updating the filter expression;
(filter_activate): new slot enabling or disabling the filter;
(update_filter_history): new slot for saving the filter expression when
its edtitign has finished;
(handle_model_changed): actual row count is now taken from the filter model
* workspace_view.h: new slots filter_activate, filter_update, and
update_filter_history; new class variables for check box, filter combo box,
and filter model
author | Torsten <ttl@justmail.de> |
---|---|
date | Wed, 07 Jan 2015 18:16:28 +0100 |
parents | 2f0c21339e9d |
children | 010cef260698 |
line wrap: on
line diff
--- a/libgui/src/workspace-view.h Mon Jan 05 06:52:49 2015 +0100 +++ b/libgui/src/workspace-view.h Wed Jan 07 18:16:28 2015 +0100 @@ -27,6 +27,9 @@ #include <QItemDelegate> #include <QTableView> #include <QSemaphore> +#include <QComboBox> +#include <QSortFilterProxyModel> +#include <QCheckBox> #include "octave-dock-widget.h" #include "workspace-model.h" @@ -73,6 +76,10 @@ void copyClipboard (); void selectAll (); + void filter_update (const QString& expression); + void filter_activate (bool enable); + void update_filter_history (); + private: void relay_contextmenu_command (const QString& cmdname); @@ -81,6 +88,11 @@ QTableView *view; int view_previous_row_count; workspace_model *_model; + + QSortFilterProxyModel *_filter_model; + QCheckBox *_filter_checkbox; + QComboBox *_filter; + enum { MaxFilterHistory = 10 }; }; #endif