mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-23 13:09:28 +08:00
24 lines
568 B
QML
24 lines
568 B
QML
// Copyright (c) 2016 Ultimaker B.V.
|
|
// Uranium is released under the terms of the AGPLv3 or higher.
|
|
|
|
import QtQuick 2.1
|
|
import QtQuick.Controls 1.1
|
|
import QtQuick.Dialogs 1.2
|
|
|
|
// Provides a SpinBox with the same readOnly property as a TextField
|
|
SpinBox
|
|
{
|
|
id: base
|
|
property bool readOnly: false
|
|
|
|
Keys.enabled: !readOnly
|
|
MouseArea
|
|
{
|
|
acceptedButtons: Qt.AllButtons;
|
|
anchors.fill: parent;
|
|
enabled: parent.readOnly;
|
|
onWheel: wheel.accepted = true;
|
|
cursorShape: enabled ? Qt.ArrowCursor : Qt.IBeamCursor;
|
|
}
|
|
}
|