diff options
| author | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
| commit | f647d78463c1250ce9c99af664615fafccf5e959 (patch) | |
| tree | 5b00428cef68aef1c9d407e2d4535687422419b6 /item_delegates/MaidenheadLocatorDelegate.cpp | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'item_delegates/MaidenheadLocatorDelegate.cpp')
| -rw-r--r--[-rwxr-xr-x] | item_delegates/MaidenheadLocatorDelegate.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/item_delegates/MaidenheadLocatorDelegate.cpp b/item_delegates/MaidenheadLocatorDelegate.cpp index 44cc42ce..7768f2a8 100755..100644 --- a/item_delegates/MaidenheadLocatorDelegate.cpp +++ b/item_delegates/MaidenheadLocatorDelegate.cpp @@ -1,30 +1,30 @@ -#include "MaidenheadLocatorDelegate.hpp"
-
-#include <QLineEdit>
-
-#include "validators/MaidenheadLocatorValidator.hpp"
-
-MaidenheadLocatorDelegate::MaidenheadLocatorDelegate (QObject * parent)
- : QStyledItemDelegate {parent}
- , validator_ {new MaidenheadLocatorValidator}
-{
-}
-
-QWidget * MaidenheadLocatorDelegate::createEditor (QWidget * parent, QStyleOptionViewItem const&
- , QModelIndex const&) const
-{
- auto * editor = new QLineEdit {parent};
- editor->setFrame (false);
- editor->setValidator (validator_.data ());
- return editor;
-}
-
-void MaidenheadLocatorDelegate::setEditorData (QWidget * editor, QModelIndex const& index) const
-{
- static_cast<QLineEdit *> (editor)->setText (index.model ()->data (index, Qt::EditRole).toString ());
-}
-
-void MaidenheadLocatorDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const
-{
- model->setData (index, static_cast<QLineEdit *> (editor)->text (), Qt::EditRole);
-}
+#include "MaidenheadLocatorDelegate.hpp" + +#include <QLineEdit> + +#include "validators/MaidenheadLocatorValidator.hpp" + +MaidenheadLocatorDelegate::MaidenheadLocatorDelegate (QObject * parent) + : QStyledItemDelegate {parent} + , validator_ {new MaidenheadLocatorValidator} +{ +} + +QWidget * MaidenheadLocatorDelegate::createEditor (QWidget * parent, QStyleOptionViewItem const& + , QModelIndex const&) const +{ + auto * editor = new QLineEdit {parent}; + editor->setFrame (false); + editor->setValidator (validator_.data ()); + return editor; +} + +void MaidenheadLocatorDelegate::setEditorData (QWidget * editor, QModelIndex const& index) const +{ + static_cast<QLineEdit *> (editor)->setText (index.model ()->data (index, Qt::EditRole).toString ()); +} + +void MaidenheadLocatorDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const +{ + model->setData (index, static_cast<QLineEdit *> (editor)->text (), Qt::EditRole); +} |
