diff options
| author | tony mancill <tmancill@debian.org> | 2026-04-12 08:46:47 -0700 |
|---|---|---|
| committer | tony mancill <tmancill@debian.org> | 2026-04-12 08:46:47 -0700 |
| commit | cd2dad3bc7ae0ee0a18b7b20a945009362ec3851 (patch) | |
| tree | 5a622ec4193e9bc899f6499f936848a661be29cb /item_delegates/MaidenheadLocatorDelegate.cpp | |
| parent | 558c0b9d6ecf70c5222e2069ece1fea3656c75d7 (diff) | |
| parent | 291b3817bf0c7a742e9e17d42c94fc8c9530e40d (diff) | |
Merge branch 'debian/latest' into debian/trixie-backports
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); +} |
