27 #ifndef WAYPOINTDELEGATE_H
28 #define WAYPOINTDELEGATE_H
30 #include <QStyledItemDelegate>
46 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
47 const QModelIndex &index)
const;
53 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
56 void setModelData(QWidget *editor, QAbstractItemModel *model,
const QModelIndex &index)
const;
60 const QModelIndex &index)
const;
63 QString
displayText(
const QVariant &value,
const QLocale &locale)
const;
69 #endif // WAYPOINTDELEGATE_H
void loadComboBox(QComboBox *combo) const
Populate the selections in the mode combo box.
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
Update the size of the editor widget.
The WaypointDelegate class is used to handle updating the values in the mode combo box to the data mo...
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Set data in the model when the UI is changed.
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Create the QComboxBox for the mode or pass to the default implementation.
WaypointDelegate(QObject *parent=nullptr)
bool eventFilter(QObject *object, QEvent *event)
This filter is required to make combo boxes work.
void setEditorData(QWidget *editor, const QModelIndex &index) const
Set data in the UI when the model is changed.
QString displayText(const QVariant &value, const QLocale &locale) const
Convert the variant to a string value.