Telemetry refactoring - Fixes #1634

This commit is contained in:
bsongis
2014-11-08 12:06:42 +01:00
parent 7d8ca6931b
commit 88d9691d16
105 changed files with 5789 additions and 3449 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "hexspinbox.h"
HexSpinBox::HexSpinBox(QWidget *parent):
QSpinBox(parent)
{
validator = new QRegExpValidator(QRegExp("[0-9A-Fa-f]{1,8}"), this);
}
QValidator::State HexSpinBox::validate(QString &text, int &pos) const
{
return validator->validate(text, pos);
}
int HexSpinBox::valueFromText(const QString &text) const
{
return text.toInt(0, 16);
}
QString HexSpinBox::textFromValue(int value) const
{
QString text;
text.sprintf("%04X", value);
return text;
}