mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-16 20:58:40 -04:00
Improvements to models and delegates
Trying to find the sweet spot for completeness, usefulness, safety and, performance from the various custom item models and item delegates. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5474 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
@@ -42,17 +42,16 @@ auto LiveFrequencyValidator::validate (QString& input, int& pos) const -> State
|
||||
void LiveFrequencyValidator::fixup (QString& input) const
|
||||
{
|
||||
QRegExpValidator::fixup (input);
|
||||
auto const& out_of_band = bands_->out_of_band ();
|
||||
if (!QString {out_of_band->name_}.startsWith (input))
|
||||
if (!bands_->oob ().startsWith (input))
|
||||
{
|
||||
if (input.contains ('m', Qt::CaseInsensitive))
|
||||
{
|
||||
input = input.toLower ();
|
||||
|
||||
QVector<QVariant> frequencies;
|
||||
Q_FOREACH (auto const& item, frequencies_->frequency_list ())
|
||||
for (auto const& item : frequencies_->frequency_list ())
|
||||
{
|
||||
if (bands_->find (item.frequency_)->name_ == input)
|
||||
if (bands_->find (item.frequency_) == input)
|
||||
{
|
||||
frequencies << item.frequency_;
|
||||
}
|
||||
@@ -70,11 +69,11 @@ void LiveFrequencyValidator::fixup (QString& input) const
|
||||
{
|
||||
// frequency input
|
||||
auto f = Radio::frequency (input, 6);
|
||||
input = bands_->find (f)->name_;
|
||||
input = bands_->find (f);
|
||||
Q_EMIT valid (f);
|
||||
}
|
||||
|
||||
if (bands_->out_of_band ()->name_ == input)
|
||||
if (bands_->oob () == input)
|
||||
{
|
||||
combo_box_->lineEdit ()->setStyleSheet ("QLineEdit {color: yellow; background-color : red;}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user