26 #ifndef TELEMETRYSCHEDULERGADGETWIDGET_H_
27 #define TELEMETRYSCHEDULERGADGETWIDGET_H_
32 #include <QStandardItemModel>
33 #include <QItemDelegate>
40 class Ui_TelemetryScheduler;
41 class Ui_Metadata_Dialog;
58 void saveTelemetryToFile();
59 void loadTelemetryFromFile();
65 void onSavedSchedule(
bool);
66 void onCompletedMetadataWrite(
bool);
67 void onCompletedMetadataSave(
int,
bool);
69 void dataModel_itemChanged(
int col);
70 void dataModel_itemChanged(QStandardItem *item);
71 void addTelemetryColumn();
72 void removeTelemetryColumn();
73 void changeVerticalHeader(
int);
74 void changeHorizontalHeader(
int);
75 void customMenuRequested(QPoint pos);
77 void onHideNotPresent(
bool);
80 int stripMs(QVariant rate_ms);
82 void importTelemetryConfiguration(
const QString &fileName);
86 Ui_TelemetryScheduler *m_telemetryeditor;
91 QMap<QString, UAVObject::Metadata> defaultMdata;
92 QMap<UAVDataObject *, int> uavoIndex;
94 QStringList columnHeaders;
98 QStandardItemModel *frozenModel;
109 : QStandardItemModel(rows, cols, parent)
116 Qt::ItemFlags
flags(
const QModelIndex &index)
const
118 if (index.column() == 0 || index.column() == 1)
121 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
143 bool removeColumns(
int column,
int count,
const QModelIndex &parent = QModelIndex());
151 void scrollTo(
const QModelIndex &index, ScrollHint hint = EnsureVisible);
154 void updateSectionWidth(
int logicalIndex,
int,
int newSize);
155 void updateSectionHeight(
int logicalIndex,
int,
int newSize);
162 void updateFrozenTableGeometry(
int verticalHeaderWidth);
164 QTableView *frozenTableView;
165 QStandardItemModel *frozenModel;
175 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
176 const QModelIndex &index)
const;
178 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
179 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const;
182 const QModelIndex &index)
const;
Qt::ItemFlags flags(const QModelIndex &index) const
virtual void keyPressEvent(QKeyEvent *event)
TelemetrySchedulerGadgetWidget(QWidget *parent=nullptr)
bool removeColumns(int column, int count, const QModelIndex &parent=QModelIndex())
QFrozenTableViewWithCopyPaste::removeColumns Ensures that the frozen table geometry is updated when c...
virtual void resizeEvent(QResizeEvent *event)
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
QFrozenTableViewWithCopyPaste(QAbstractItemModel *model)
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
QStandardItemModel * getFrozenModel()
QTableView * getFrozenTableView()
The QFrozenTableViewWithCopyPaste class QTableView with support for a frozen row as well as copy and ...
~QFrozenTableViewWithCopyPaste()
void fixGeometry(int value)
This class uses a tableview inside a table view to achieve the frozen row effect on the 1st row this ...
void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)
The SchedulerModel class Subclasses QStandardItemModel in order to reimplement the editable flags...
SpinBoxDelegate(QObject *parent=nullptr)
void setHorizontalHeaderItem(int column, QStandardItem *item)
QFrozenTableViewWithCopyPaste::setHorizontalHeaderItem Ensures that the frozen table geometry is upda...
~TelemetrySchedulerGadgetWidget()
SchedulerModel(int rows, int cols, QObject *parent=nullptr)
void setEditorData(QWidget *editor, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const