| 49 | unsigned int SpinBoxA::current_id(0); |
| 50 | |
| 51 | SpinBoxA::SpinBoxA(QWidget *parent) |
| 52 | : QWidget(parent) |
| 53 | , ui(new Ui::SpinBoxA) |
| 54 | , m_value(0.0) |
| 55 | , m_min_value(0.0) |
| 56 | , m_max_value(0.0) |
| 57 | , m_decimal_count(3) |
| 58 | , m_validator(new QRegExpValidator(this)) |
| 59 | #ifdef SPINBOX_API |
| 60 | , m_sba_api(new SpinBoxA_API(this)) |
| 61 | #endif |
| 62 | { |
| 63 | ui->setupUi(this); |
| 64 | ui->SBA_LineEdit->setValidator(m_validator); |
| 65 | |
| 66 | ui->SBA_LineEdit->installEventFilter(this); |
| 67 | ui->SBA_CompletionCircle->installEventFilter(this); |
| 68 | |
| 69 | connect(ui->SBA_Combobox, SIGNAL(currentIndexChanged(int)), SLOT(onComboboxIndexChanged(int))); |
| 70 | connect(ui->SBA_LineEdit, SIGNAL(editingFinished()), SLOT(onLineEditTextEdited())); |
| 71 | connect(ui->SBA_UpButton, SIGNAL(clicked()), SLOT(onUpButtonPressed())); |
| 72 | connect(ui->SBA_DownButton, SIGNAL(clicked()), SLOT(onDownButtonPressed())); |
| 73 | int size = Style::getDimension(json::global::unit_3); |
| 74 | |
| 75 | Style::setStyle(ui->SBA_Combobox, style::properties::widget::noBorder); |
| 76 | |
| 77 | ui->SBA_UpButton->setIcon( |
| 78 | Style::getPixmap(":/gui/icons/plus.svg", Style::getColor(json::theme::content_inverse))); |
| 79 | Style::setStyle(ui->SBA_UpButton, style::properties::button::spinboxButton, true, true); |
| 80 | ui->SBA_UpButton->setFixedSize(size, size); |
| 81 | |
| 82 | ui->SBA_DownButton->setIcon( |
| 83 | Style::getPixmap(":/gui/icons/minus.svg", Style::getColor(json::theme::content_inverse))); |
| 84 | Style::setStyle(ui->SBA_DownButton, style::properties::button::spinboxButton, true, true); |
| 85 | ui->SBA_DownButton->setFixedSize(size, size); |
| 86 | |
| 87 | connect(this, SIGNAL(valueChanged(double)), ui->SBA_CompletionCircle, SLOT(setValueDouble(double))); |
| 88 | connect(ui->SBA_CompletionCircle, SIGNAL(toggled(bool)), SLOT(setFineMode(bool))); |
| 89 | |
| 90 | m_displayScale = 1; |
| 91 | } |
| 92 | |
| 93 | SpinBoxA::SpinBoxA(vector<pair<QString, double>> units, const QString &name, double min_value, double max_value, |
| 94 | bool hasProgressWidget, bool invertCircle, QWidget *parent) |