diff options
| author | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2018-12-19 22:58:32 +0100 |
| commit | e0737c56c1e384e05064a0c6e1ac46979371041b (patch) | |
| tree | a0123d694a2d36c43dabdf0a3907392fce11d457 /item_delegates/CallsignDelegate.hpp | |
| parent | b4aebf2d137b892f53503b13785ecae900062ff7 (diff) | |
New upstream version 2.0.0+repackupstream/2.0.0+repack
Diffstat (limited to 'item_delegates/CallsignDelegate.hpp')
| -rw-r--r-- | item_delegates/CallsignDelegate.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/item_delegates/CallsignDelegate.hpp b/item_delegates/CallsignDelegate.hpp new file mode 100644 index 00000000..b5bdce1c --- /dev/null +++ b/item_delegates/CallsignDelegate.hpp @@ -0,0 +1,30 @@ +#ifndef CALLSIGN_DELEGATE_HPP_ +#define CALLSIGN_DELEGATE_HPP_ + +#include <QStyledItemDelegate> + +class QValidator; + +// +// Class CallsignDelegate +// +// Item delegate for editing a callsign +// +class CallsignDelegate final + : public QStyledItemDelegate +{ +public: + explicit CallsignDelegate (QObject * parent = nullptr); + QWidget * createEditor (QWidget * parent, QStyleOptionViewItem const&, QModelIndex const&) const override; + void setEditorData (QWidget * editor, QModelIndex const&) const override; + void setModelData (QWidget * editor, QAbstractItemModel *, QModelIndex const&) const override; + void updateEditorGeometry (QWidget * editor, QStyleOptionViewItem const& option, QModelIndex const&) const override + { + editor->setGeometry (option.rect); + } + +private: + QScopedPointer<QValidator> validator_; +}; + +#endif |
