28 #ifndef UAVOBJECTBROWSERWIDGET_H_
29 #define UAVOBJECTBROWSERWIDGET_H_
31 #include <QModelIndex>
35 #include <QSortFilterProxyModel>
36 #include "objectpersistence.h"
41 class Ui_UAVObjectBrowser;
50 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent)
const;
60 void updateView(
const QModelIndex &topLeft,
const QModelIndex &bottomRight);
63 virtual void setModel(QAbstractItemModel *model)
65 QTreeView::setModel(model);
75 virtual void dataChanged(
const QModelIndex &topLeft,
const QModelIndex &bottomRight,
76 const QVector<int> &roles = QVector<int>());
79 void onTimeout_updateView();
82 bool m_updateTreeViewFlag;
85 QTimer m_updateViewTimer;
97 m_recentlyUpdatedColor = color;
102 m_manuallyChangedColor = color;
107 m_notPresentOnHwColor = color;
112 m_onlyHighlightChangedValues = highlight;
115 void setViewOptions(
bool scientific,
bool metadata,
bool hideNotPresent);
124 void requestUpdate();
128 void toggleUAVOButtons(
const QModelIndex ¤t,
const QModelIndex &previous);
130 void viewOptionsChangedSlot();
132 void onTreeItemCollapsed(QModelIndex);
133 void onTreeItemExpanded(QModelIndex);
135 void searchTextChanged(QString searchText);
136 void searchTextCleared();
142 QPushButton *m_requestUpdate;
143 QPushButton *m_sendUpdate;
144 Ui_UAVObjectBrowser *m_browser;
145 Ui_viewoptions *m_viewoptions;
146 QDialog *m_viewoptionsDialog;
150 int m_recentlyUpdatedTimeout;
151 QColor m_recentlyUpdatedColor;
152 QColor m_manuallyChangedColor;
153 QColor m_notPresentOnHwColor;
154 bool m_onlyHighlightChangedValues;
156 void updateObjectPersistance(ObjectPersistence::OperationOptions op,
UAVObject *obj);
157 void enableUAVOBrowserButtons(
bool enableState);
160 void keyPressEvent(QKeyEvent *
e);
161 void keyReleaseEvent(QKeyEvent *
e);
165 QMap<QString, unsigned int> expandedUavoItems;
167 unsigned int updatePeriod;
168 void refreshViewOptions();
bool hasAcceptedChildren(int source_row, const QModelIndex &source_parent) const
void setRecentlyUpdatedColor(QColor color)
~UAVObjectBrowserWidget()
void setManuallyChangedColor(QColor color)
void setViewOptions(bool scientific, bool metadata, bool hideNotPresent)
UAVObjectBrowserWidget::setViewOptions Sets the viewing options.
UAVObjectBrowserWidget(QWidget *parent=nullptr)
void setNotPresentOnHwColor(QColor color)
void doRefreshHiddenObjects()
TreeSortFilterProxyModel(QObject *parent)
void initialize()
Initializes the model and makes the necessary signal/slot connections.
void updateView(const QModelIndex &topLeft, const QModelIndex &bottomRight)
UAVOBrowserTreeView::updateView Determines if a view updates lies outside the range of updates queued...
void setOnlyHighlightChangedValues(bool highlight)
void setNotPresentOnHwColor(QColor color)
void showNotPresent(bool show)
UAVObjectBrowserWidget::showNotPresent Shows or hides object not present on the hardware.
void setOnlyHighlightChangedValues(bool highlight)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
TreeSortFilterProxyModel::filterAcceptsRow Taken from http://qt-project.org/forums/viewthread/7782. This proxy model will accept rows:
bool filterAcceptsRowItself(int source_row, const QModelIndex &source_parent) const
virtual void setModel(QAbstractItemModel *model)
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >())
dataChanged Reimplements QTreeView::dataChanged signal
void showMetaData(bool show)
UAVObjectBrowserWidget::showMetaData Shows UAVO metadata.
void refreshHiddenObjects()
Refreshes the hidden object display.
UAVOBrowserTreeView(unsigned int updateTimerPeriod)
UAVOBrowserTreeView::UAVOBrowserTreeView Constructor for reimplementation of QTreeView.
void setManuallyChangedColor(QColor color)
void setRecentlyUpdatedColor(QColor color)
void viewOptionsChanged(bool scientific, bool metadata, bool hideNotPresent)
void updateTimerPeriod(unsigned int val)