FloatValidator.qml 332 B

123456789101112
  1. // Copyright (c) 2022 UltiMaker
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.15
  4. RegularExpressionValidator
  5. {
  6. property int maxBeforeDecimal: 11
  7. property int maxAfterDecimal: 3
  8. regularExpression: new RegExp("^-?[0-9]{0,%0}[.,]?[0-9]{0,%1}$".arg(maxBeforeDecimal).arg(maxAfterDecimal))
  9. }