ObserverWidget.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#pragma once
25
26// Qt
27#include <map>
28#include <string>
29
30#include <QAction>
31#include <QMainWindow>
32#include <QPointer>
33#include <QStandardItemModel>
34#include <QTimer>
35#include <QWidget>
36
37#include <ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ui_ObserverProperties.h>
38
39// ArmarX
41
43
45
46namespace armarx
47{
50 using ObserverList = std::vector<std::string>;
51
52 class ObserverWidget : public QWidget
53 {
54 Q_OBJECT
55
56 public:
58 signals:
59 void createFilterClicked(const std::string& datafieldStr, DatafieldFilterBasePtr filter);
60 public slots:
61 void createNewModel();
62 void treeView_selected(const QItemSelection& selected, const QItemSelection& deselected);
63 void treeView_contextMenu(const QPoint& point);
64 void updateObservers();
65 void toggleAutoUpdate(bool checked);
66 void filterSelected();
67 void clearDetailedView();
68 private slots:
69 void expandFilterSelection(QString filterStr);
70 void delayedFilterExpansion();
71
72 private:
73 Ui::ObserverProperties ui;
75 ObserverItemModel* model;
76 QPointer<QWidget> propertiesWidget;
77 QTimer* updateTimer;
78 QAction* autoUpdateAction;
79 std::string selectedFilterId;
80 InfixFilterModel* proxyModel;
81 QTimer filterExpansionTimer;
82 };
83} // namespace armarx
This proxy model reimplements the filterAcceptsRow function with a new behavior: All elements that fi...
ObserverWidget(ObserverWidgetController *controller)
void createFilterClicked(const std::string &datafieldStr, DatafieldFilterBasePtr filter)
void treeView_selected(const QItemSelection &selected, const QItemSelection &deselected)
void toggleAutoUpdate(bool checked)
void treeView_contextMenu(const QPoint &point)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::vector< std::string > ObserverList