mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-05 07:24:38 -04:00
Moving toward multiplier and dupe detection for contest modes
There's not much to show for this so far but some of the necessary infrastructure is in place.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "FrequencyDelegate.hpp"
|
||||
|
||||
#include "widgets/FrequencyLineEdit.hpp"
|
||||
|
||||
FrequencyDelegate::FrequencyDelegate (QObject * parent)
|
||||
: QStyledItemDelegate {parent}
|
||||
{
|
||||
}
|
||||
|
||||
QWidget * FrequencyDelegate::createEditor (QWidget * parent, QStyleOptionViewItem const&
|
||||
, QModelIndex const&) const
|
||||
{
|
||||
auto * editor = new FrequencyLineEdit {parent};
|
||||
editor->setFrame (false);
|
||||
return editor;
|
||||
}
|
||||
|
||||
void FrequencyDelegate::setEditorData (QWidget * editor, QModelIndex const& index) const
|
||||
{
|
||||
static_cast<FrequencyLineEdit *> (editor)->frequency (index.model ()->data (index, Qt::EditRole).value<Radio::Frequency> ());
|
||||
}
|
||||
|
||||
void FrequencyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const
|
||||
{
|
||||
model->setData (index, static_cast<FrequencyLineEdit *> (editor)->frequency (), Qt::EditRole);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user