mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-07-13 14:24:08 -04:00
Improve frequency input validation
Allow group separators as well as decimal points in MHz input fields git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7462 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+11
-3
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "pimpl_impl.hpp"
|
||||
|
||||
#include "Radio.hpp"
|
||||
#include "Bands.hpp"
|
||||
#include "FrequencyList.hpp"
|
||||
|
||||
@@ -403,9 +404,16 @@ bool StationList::impl::setData (QModelIndex const& model_index, QVariant const&
|
||||
|
||||
case offset_column:
|
||||
{
|
||||
stations_[row].offset_ = value.value<FrequencyDelta> ();
|
||||
Q_EMIT dataChanged (model_index, model_index, roles);
|
||||
changed = true;
|
||||
if (value.canConvert<FrequencyDelta> ())
|
||||
{
|
||||
FrequencyDelta offset {qvariant_cast<Radio::FrequencyDelta> (value)};
|
||||
if (offset != stations_[row].offset_)
|
||||
{
|
||||
stations_[row].offset_ = offset;
|
||||
Q_EMIT dataChanged (model_index, model_index, roles);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user