From 1c0edf002a50a765a66349d733cf170f4a4024ef Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 30 Mar 2015 09:45:44 +0200 Subject: Remove SpinBox SpinBox is a desktop centric control. It won't be provided in Qt Quick Controls 2.0, but maybe later when desktop support is re-considered. Qt Quick Controls 2.0 will focus on embedded and mobile. SpinBox is still available in 1.x Change-Id: I272b030734bad58de7e5b26c522189e0c520fca5 Reviewed-by: Jari-Pekka Nurmi --- src/imports/controls/SpinBox.qml | 132 ------------------------ src/imports/controls/controls.pro | 1 - src/imports/controls/qmldir | 1 - src/imports/controls/qtquickcontrols2plugin.cpp | 2 - 4 files changed, 136 deletions(-) delete mode 100644 src/imports/controls/SpinBox.qml (limited to 'src/imports/controls') diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml deleted file mode 100644 index 06b5629e..00000000 --- a/src/imports/controls/SpinBox.qml +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Quick Controls module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.6 -import QtQuick.Controls 2.0 - -AbstractSpinBox { - id: control - - implicitWidth: Math.max(background ? background.implicitWidth : 0, - (upButton ? upButton.implicitWidth : 0) + - (downButton ? downButton.implicitWidth : 0) + - (input ? input.implicitWidth : 0) + Style.padding * 2) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - (upButton ? upButton.implicitHeight : 0), - (downButton ? downButton.implicitHeight : 0), - (input ? input.implicitHeight : 0) + Style.padding * 2) - - Accessible.role: Accessible.SpinBox - - input: TextInput { - x: upButton.width - width: parent.width - upButton.width - downButton.width - height: parent.height - - color: control.Style.textColor - selectionColor: control.Style.selectionColor - selectedTextColor: control.Style.selectedTextColor - horizontalAlignment: Qt.AlignHCenter - verticalAlignment: Qt.AlignVCenter - Keys.forwardTo: control - } - - validator: IntValidator { } - - upButton: Item { - implicitWidth: 26 - height: parent.height - x: parent.width - width - - opacity: enabled ? 1.0 : control.Style.disabledOpacity - clip: true - Rectangle { - x: -radius - width: parent.width + radius - height: parent.height - radius: control.Style.roundness - color: Qt.tint(Qt.tint(control.Style.accentColor, - control.activeFocus ? control.Style.focusColor : "transparent"), - pressed === AbstractSpinBox.UpButton ? control.Style.pressColor : "transparent") - } - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 3 - height: 2 - color: control.Style.selectedTextColor - } - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: 2 - height: parent.height / 3 - color: control.Style.selectedTextColor - } - } - - downButton: Item { - implicitWidth: 26 - height: parent.height - - opacity: enabled ? 1.0 : control.Style.disabledOpacity - clip: true - Rectangle { - width: parent.width + radius - height: parent.height - radius: control.Style.roundness - color: Qt.tint(Qt.tint(control.Style.accentColor, - control.activeFocus ? control.Style.focusColor : "transparent"), - pressed === AbstractSpinBox.DownButton ? control.Style.pressColor : "transparent") - } - Rectangle { - x: (parent.width - width) / 2 - y: (parent.height - height) / 2 - width: parent.width / 3 - height: 2 - color: control.Style.selectedTextColor - } - } - - background: Rectangle { - implicitWidth: 120 - radius: control.Style.roundness - border.width: control.activeFocus ? 2 : 1 - border.color: control.activeFocus ? control.Style.focusColor : control.Style.frameColor - opacity: enabled ? 1.0 : control.Style.disabledOpacity - color: input.acceptableInput ? "white" : "lightpink" - } -} diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 98472d9f..06a947dd 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -22,7 +22,6 @@ QML_FILES = \ ScrollBar.qml \ ScrollIndicator.qml \ Slider.qml \ - SpinBox.qml \ StackView.js \ StackView.qml \ StackViewDelegate.qml \ diff --git a/src/imports/controls/qmldir b/src/imports/controls/qmldir index fcd8700d..b54df22c 100644 --- a/src/imports/controls/qmldir +++ b/src/imports/controls/qmldir @@ -14,7 +14,6 @@ RadioButton 2.0 RadioButton.qml ScrollBar 2.0 ScrollBar.qml ScrollIndicator 2.0 ScrollIndicator.qml Slider 2.0 Slider.qml -SpinBox 2.0 SpinBox.qml StackView 2.0 StackView.qml StackViewDelegate 2.0 StackViewDelegate.qml StackViewTransition 2.0 StackViewTransition.qml diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp index 22622c9f..9f232c55 100644 --- a/src/imports/controls/qtquickcontrols2plugin.cpp +++ b/src/imports/controls/qtquickcontrols2plugin.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -96,7 +95,6 @@ void QtQuickControls2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 0, "AbstractScrollBar"); qmlRegisterType(uri, 2, 0, "AbstractScrollIndicator"); qmlRegisterType(uri, 2, 0, "AbstractSlider"); - qmlRegisterType(uri, 2, 0, "AbstractSpinBox"); qmlRegisterType(uri, 2, 0, "AbstractStackView"); qmlRegisterType(uri, 2, 0, "AbstractSwitch"); qmlRegisterType(uri, 2, 0, "AbstractTabBar"); -- cgit v1.2.3