void MainWindow::setupKernelValidators() { auto inputCells = findChildren<QLineEdit*>(); for(auto cell : inputCells) { auto validator = new QDoubleValidator(KERNEL_VALIDATOR_MIN_VALUE, KERNEL_VALIDATOR_MAX_VALUE, KERNEL_VALIDATOR_DECIMALS, this); validator->setNotation(QDoubleValidator::StandardNotation); cell->setValidator(validator); } }
int QDoubleValidator::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QValidator::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< double*>(_v) = bottom(); break; case 1: *reinterpret_cast< double*>(_v) = top(); break; case 2: *reinterpret_cast< int*>(_v) = decimals(); break; case 3: *reinterpret_cast< Notation*>(_v) = notation(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setBottom(*reinterpret_cast< double*>(_v)); break; case 1: setTop(*reinterpret_cast< double*>(_v)); break; case 2: setDecimals(*reinterpret_cast< int*>(_v)); break; case 3: setNotation(*reinterpret_cast< Notation*>(_v)); break; } _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; }