Qt → Выпуск Qt Creator 4.8.1
Qt Company анонсировала выпуск Qt Creator 4.8.1
Дмитрий Черновол
QML SpinBox не сохраняет нормально значения
Всем привет!
Имеется у меня SpinBox в QML приложении. С ним всё в порядке, за исключением того, что если свойство editable присваивается true, и сменить значение на (например) 0.06, то значение автоматически будет 0.00
Если будет editable: false, то при изменении значение таким же и останется. Если я напишу 0.06, то 0.06 таким и будет и автоматически не будет меняться на 0.00.
А мне нужно, чтобы пользователь смог вводить значения с клавиатуры
В чем может быть проблема? Как такое происходит и подскажите, как решить. Буду сильно благодарен.
Код:
SpinBox { id: spBox_AccelerationTime from: 0 value: 0 to: 10 * 10 stepSize: 1 anchors.centerIn: parent editable: true wrap: true wheelEnabled: true property int decimals: 1 property real realValue: value / 1 anchors.verticalCenterOffset: -152 anchors.horizontalCenterOffset: 37 validator: DoubleValidator { bottom: Math.min(spBox_AccelerationTime.from, spBox_AccelerationTime.to) top: Math.max(spBox_AccelerationTime.from, spBox_AccelerationTime.to) } textFromValue: function(value, locale) { return Number(value / 10).toLocaleString(locale, 'f', spBox_AccelerationTime.decimals) } }
QML → QML - Lesson 001. TextEdit IP Address Validation
ip address, ip адрес, lineedit, qlineedit, QLineEdit example, QLineEdit IP Address, qt, qtcreator, qml
Available similar articles on Qt/С++ and PyQt5/Python
For the full set of lessons on Qt, on validation of IP-addresses to add Article also option to Qt/QML.
There is also a data entry field, in which we will enter the IP-address. Will be used to validate RegExpValidator . One unpleasant aspect in this case is that the slip a few variables in this line RegExpValidator is rather trivial task, therefore, confine ourselves to writing directly in the regular season regExp property of this object.
Qt → Qt/C++ - Lesson 001. QLineEdit IP Address
ip address, ip адрес, lineedit, qlineedit, QLineEdit example, QLineEdit IP Address, qt, qtcreator
Available similar articles in Qt/QML and PyQt5/Python
When you will develop network applications, you may need to create form for input ip-address, but the use of a simple method setInputMask ( "000.000.000.000; _"); of QLineEdit does not provide the proper result as this mask allows to enter the values of 999, 657, etc., while the IP-address of the limited number of 255.
One way to solve this problem is to use Validator .
Кристина Афанасьева
- Result:70points,
- Rating points1
Кристина Афанасьева
C ++ - Test 004. Pointers, Arrays and Loops
- Result:60points,
- Rating points-1
- Popular publications in the last 90 Days
- Qt/C++ - Tutorial 088. Text search with highlighting in QTextEdit1.3K
- Django - Tutorial 041. Display images in the admin panel on the example of a user profile1.2K
- Qt/C++ Tutorial 087. Get the maximum number of multiple input fields QLineEdit977
- Django - Tutorial 043. template tags to form breadcrumb with shema.org support836
- Django - Tutorial 042. Caching templates for different types of content787

Евгений Легоцкой
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion
RandyGallup
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion

BlinCT
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion

BlinCT
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion
RandyGallup
Qt/C++ - Tutorial 068. Hello World using the CMAKE build system in CLion

Евгений Легоцкой

Евгений Легоцкой
как получить свойство базового класса?
Maciej Urmański

Евгений Легоцкой
QSqlTableModel + QTableView + кастомный делегат в виде чекбокса

Евгений Легоцкой
For registered users on the site there is a minimum amount of advertising