summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2013-10-01 18:03:41 +0200
committerEike Ziller <eike.ziller@digia.com>2013-10-02 11:39:23 +0200
commit0b82b54c248eebcf87a01fc72d4089787848b7a2 (patch)
treedd64349301f893c4d9f8b98c3685a6c6cf984b9c
parentc148f4fe4f7f98d5bac425e98f0bd3875eaeaf84 (diff)
downloadqt-creator-0b82b54c248eebcf87a01fc72d4089787848b7a2.tar.gz
Remove remaining usages of Qt Quick 1 / Declarative
Qml editor widgets were still linking against declarative for qml type registering. Registering is no longer necessary since they are no longer used in QML. Also removes the unused qtcomponents. qmlpuppet of course still links against declarative, but that's not run in the same process. Task-number: QTCREATORBUG-10273 Change-Id: Ied12d38d58da5ff3bc694905b84dcd76cbce03af Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
-rw-r--r--lib/qtcreator/qtcomponents/Button.qml92
-rw-r--r--lib/qtcreator/qtcomponents/ButtonRow.qml34
-rw-r--r--lib/qtcreator/qtcomponents/CheckBox.qml54
-rw-r--r--lib/qtcreator/qtcomponents/ChoiceList.qml89
-rw-r--r--lib/qtcreator/qtcomponents/ContextMenu.qml37
-rw-r--r--lib/qtcreator/qtcomponents/Dial.qml141
-rw-r--r--lib/qtcreator/qtcomponents/Frame.qml53
-rw-r--r--lib/qtcreator/qtcomponents/GroupBox.qml50
-rw-r--r--lib/qtcreator/qtcomponents/Menu.qml34
-rw-r--r--lib/qtcreator/qtcomponents/MenuItem.qml34
-rw-r--r--lib/qtcreator/qtcomponents/ProgressBar.qml57
-rw-r--r--lib/qtcreator/qtcomponents/RadioButton.qml54
-rw-r--r--lib/qtcreator/qtcomponents/ScrollArea.qml171
-rw-r--r--lib/qtcreator/qtcomponents/ScrollBar.qml194
-rw-r--r--lib/qtcreator/qtcomponents/Slider.qml88
-rw-r--r--lib/qtcreator/qtcomponents/SpinBox.qml124
-rw-r--r--lib/qtcreator/qtcomponents/SplitterRow.qml53
-rw-r--r--lib/qtcreator/qtcomponents/Switch.qml50
-rw-r--r--lib/qtcreator/qtcomponents/Tab.qml37
-rw-r--r--lib/qtcreator/qtcomponents/TabBar.qml139
-rw-r--r--lib/qtcreator/qtcomponents/TabFrame.qml105
-rw-r--r--lib/qtcreator/qtcomponents/TableColumn.qml38
-rw-r--r--lib/qtcreator/qtcomponents/TableView.qml601
-rw-r--r--lib/qtcreator/qtcomponents/TextArea.qml79
-rw-r--r--lib/qtcreator/qtcomponents/TextField.qml73
-rw-r--r--lib/qtcreator/qtcomponents/ToolBar.qml39
-rw-r--r--lib/qtcreator/qtcomponents/ToolButton.qml62
-rw-r--r--lib/qtcreator/qtcomponents/custom/BasicButton.qml80
-rw-r--r--lib/qtcreator/qtcomponents/custom/Button.qml50
-rw-r--r--lib/qtcreator/qtcomponents/custom/ButtonColumn.qml73
-rw-r--r--lib/qtcreator/qtcomponents/custom/ButtonGroup.js137
-rw-r--r--lib/qtcreator/qtcomponents/custom/ButtonRow.qml72
-rw-r--r--lib/qtcreator/qtcomponents/custom/CheckBox.qml61
-rw-r--r--lib/qtcreator/qtcomponents/custom/ChoiceList.qml78
-rw-r--r--lib/qtcreator/qtcomponents/custom/GroupBox.qml83
-rw-r--r--lib/qtcreator/qtcomponents/custom/ProgressBar.qml82
-rw-r--r--lib/qtcreator/qtcomponents/custom/Slider.qml289
-rw-r--r--lib/qtcreator/qtcomponents/custom/SpinBox.qml193
-rw-r--r--lib/qtcreator/qtcomponents/custom/SplitterRow.qml357
-rw-r--r--lib/qtcreator/qtcomponents/custom/TextField.qml155
-rw-r--r--lib/qtcreator/qtcomponents/custom/behaviors/ButtonBehavior.qml62
-rw-r--r--lib/qtcreator/qtcomponents/custom/behaviors/ModalPopupBehavior.qml119
-rw-r--r--lib/qtcreator/qtcomponents/custom/components.pro41
-rw-r--r--lib/qtcreator/qtcomponents/custom/private/ChoiceListPopup.qml352
-rw-r--r--lib/qtcreator/qtcomponents/custom/qmldir14
-rw-r--r--lib/qtcreator/qtcomponents/images/folder_new.pngbin1199 -> 0 bytes
-rw-r--r--lib/qtcreator/qtcomponents/plugins.qmltypes428
-rw-r--r--lib/qtcreator/qtcomponents/qmldir27
-rw-r--r--lib/qtcreator/qtcomponents/qtcomponents.pro57
-rw-r--r--lib/qtcreator/qtcomponents/qtcomponents.qbs18
-rw-r--r--qtcreator.pro2
-rw-r--r--qtcreator.qbs1
-rw-r--r--src/libs/libs.pro3
-rw-r--r--src/libs/libs.qbs1
-rw-r--r--src/libs/qmleditorwidgets/colorbox.h3
-rw-r--r--src/libs/qmleditorwidgets/colorbutton.h4
-rw-r--r--src/libs/qmleditorwidgets/colorwidgets.cpp47
-rw-r--r--src/libs/qmleditorwidgets/colorwidgets.h45
-rw-r--r--src/libs/qmleditorwidgets/easingpane/easingpane.pri2
-rw-r--r--src/libs/qmleditorwidgets/huecontrol.h3
-rw-r--r--src/libs/qmleditorwidgets/qmleditorwidgets-lib.pri4
-rw-r--r--src/libs/qmleditorwidgets/qmleditorwidgets.qbs3
-rw-r--r--src/libs/qmleditorwidgets/qmleditorwidgets_dependencies.pri1
-rw-r--r--src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.cpp471
-rw-r--r--src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.h144
-rw-r--r--src/libs/qtcomponents/styleitem/qrangemodel.cpp523
-rw-r--r--src/libs/qtcomponents/styleitem/qrangemodel.h114
-rw-r--r--src/libs/qtcomponents/styleitem/qrangemodel_p.h95
-rw-r--r--src/libs/qtcomponents/styleitem/qstyleitem.cpp1067
-rw-r--r--src/libs/qtcomponents/styleitem/qstyleitem.h247
-rw-r--r--src/libs/qtcomponents/styleitem/qstyleplugin.cpp99
-rw-r--r--src/libs/qtcomponents/styleitem/qstyleplugin.h63
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenu.cpp76
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenu.h62
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenubar.cpp56
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenubar.h63
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenuitem.cpp59
-rw-r--r--src/libs/qtcomponents/styleitem/qtmenuitem.h63
-rw-r--r--src/libs/qtcomponents/styleitem/qwheelarea.cpp186
-rw-r--r--src/libs/qtcomponents/styleitem/qwheelarea.h107
-rw-r--r--src/libs/qtcomponents/styleitem/styleitem.json1
-rw-r--r--src/libs/qtcomponents/styleitem/styleitem.pro33
-rw-r--r--src/libs/qtcomponents/styleitem/styleitem.qbs37
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/fontwidget.h3
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp3
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectmanager.qbs2
-rw-r--r--src/plugins/welcome/welcome.pro2
89 files changed, 10 insertions, 9099 deletions
diff --git a/lib/qtcreator/qtcomponents/Button.qml b/lib/qtcreator/qtcomponents/Button.qml
deleted file mode 100644
index 4ffb7dd72f..0000000000
--- a/lib/qtcreator/qtcomponents/Button.qml
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.Button {
- id:button
-
- // dm: this is wrong
- width: Math.max(sizehint.width, button.iconSource !== "" ? labelItem.contentsWidth + 8 : 0 )
- height: Math.max(22, sizehint.height)
-
- property variant sizehint: backgroundItem.sizeFromContents(80, 6)
- property bool defaultbutton
- property string hint
-
- background: QStyleItem {
- id: styleitem
- anchors.fill: parent
- elementType: "button"
- sunken: pressed || checked
- raised: !(pressed || checked)
- hover: containsMouse
- text: button.iconSource === "" ? button.text : ""
- focus: button.focus
- hint: button.hint
-
- // If no icon, let the style do the drawing
- activeControl: focus ? "default" : ""
- Connections{
- target: button
- onToolTipTriggered: styleitem.showTip()
- }
- function showTip(){
- showToolTip(tooltip);
- }
- }
-
- label: Item {
- // Used as a fallback since I can't pass the imageURL
- // directly to the style object
- visible: button.iconSource !== ""
- property int contentsWidth : row.width
- Row {
- id: row
- anchors.centerIn: parent
- anchors.verticalCenterOffset: -1
- spacing: 4
- Image {
- source: iconSource
- anchors.verticalCenter: parent.verticalCenter
- fillMode: Image.Stretch //mm Image should shrink if button is too small, depends on QTBUG-14957
- }
- Text {
- id:text
- color: textColor
- anchors.verticalCenter: parent.verticalCenter
- text: button.text
- horizontalAlignment: Text.Center
- }
- }
- }
- Keys.onSpacePressed:clicked()
-}
-
diff --git a/lib/qtcreator/qtcomponents/ButtonRow.qml b/lib/qtcreator/qtcomponents/ButtonRow.qml
deleted file mode 100644
index 9a752f4380..0000000000
--- a/lib/qtcreator/qtcomponents/ButtonRow.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.ButtonRow {
-}
diff --git a/lib/qtcreator/qtcomponents/CheckBox.qml b/lib/qtcreator/qtcomponents/CheckBox.qml
deleted file mode 100644
index c414e521a1..0000000000
--- a/lib/qtcreator/qtcomponents/CheckBox.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-// jb : Size should not depend on background, we should make it consistent
-
-Components.CheckBox{
- id:checkbox
- property string text
- property string hint
- height:20
- width: Math.max(110, backgroundItem.textWidth(text) + 40)
-
- background: QStyleItem {
- elementType:"checkbox"
- sunken:pressed
- on:checked || pressed
- hover:containsMouse
- text:checkbox.text
- enabled:checkbox.enabled
- focus:checkbox.focus
- hint:checkbox.hint
- }
- Keys.onSpacePressed:checked = !checked
-}
-
diff --git a/lib/qtcreator/qtcomponents/ChoiceList.qml b/lib/qtcreator/qtcomponents/ChoiceList.qml
deleted file mode 100644
index bad3556658..0000000000
--- a/lib/qtcreator/qtcomponents/ChoiceList.qml
+++ /dev/null
@@ -1,89 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.ChoiceList {
-
- id: choicelist
-
- property int buttonHeight: backgroundItem.sizeFromContents(100, 18).height
- property int buttonWidth: backgroundItem.sizeFromContents(100, 18).width
-
- property string hint
-
- height: buttonHeight
- width: buttonWidth
- topMargin: 4
- bottomMargin: 4
-
- background: QStyleItem {
- anchors.fill: parent
- elementType: "combobox"
- sunken: pressed
- raised: !pressed
- hover: containsMouse
- enabled: choicelist.enabled
- text: currentItemText
- focus: choicelist.focus
- hint: choicelist.hint
- }
-
- listItem: Item {
- id:item
-
- height: 22
- anchors.left: parent.left
- width: choicelist.width
- QStyleItem {
- anchors.fill: parent
- elementType: "comboboxitem"
- text: itemText
- selected: highlighted
-
- }
- }
- popupFrame: QStyleItem {
- property string popupLocation: backgroundItem.styleHint("comboboxpopup") ? "center" : "below"
- property int fw: backgroundItem.pixelMetric("menupanelwidth");
- anchors.leftMargin: backgroundItem.pixelMetric("menuhmargin") + fw
- anchors.rightMargin: backgroundItem.pixelMetric("menuhmargin") + fw
- anchors.topMargin: backgroundItem.pixelMetric("menuvmargin") + fw
- anchors.bottomMargin: backgroundItem.pixelMetric("menuvmargin") + fw
- elementType: "menu"
-
- effect: DropShadow {
- blurRadius: 18
- color: "#90000000"
- xOffset: 1
- yOffset: 1
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/ContextMenu.qml b/lib/qtcreator/qtcomponents/ContextMenu.qml
deleted file mode 100644
index f377740640..0000000000
--- a/lib/qtcreator/qtcomponents/ContextMenu.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-MenuBase {
- id: choiceList
-
- property ListModel model
-}
diff --git a/lib/qtcreator/qtcomponents/Dial.qml b/lib/qtcreator/qtcomponents/Dial.qml
deleted file mode 100644
index 9ba8edd49c..0000000000
--- a/lib/qtcreator/qtcomponents/Dial.qml
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-// jens: ContainsMouse breaks drag functionality
-
-QStyleItem {
- id: dial
-
- width:100
- height:100
-
- property alias maximumValue: range.maximumValue
- property alias minimumValue: range.minimumValue
- property alias containsMouse: mouseArea.containsMouse
- property alias value: range.value
-
- property bool wrapping: false
- property bool tickmarks: true // not implemented
-
- RangeModel {
- id: range
- minimumValue: 0.0
- maximumValue: 1.0
- stepSize: 0.0
- value: 0
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill:parent
- property bool inDrag
- hoverEnabled:true
-
- onPositionChanged: {
- if (pressed) {
- value = valueFromPoint(mouseX, mouseY)
- inDrag = true
- }
- }
- onPressed: {
- value = valueFromPoint(mouseX, mouseY)
- dial.focus = true
- }
-
- onReleased:inDrag = false;
- function bound(val) { return Math.max(minimumValue, Math.min(maximumValue, val)); }
-
- function valueFromPoint(x, y)
- {
- var yy = height/2.0 - y;
- var xx = x - width/2.0;
- var a = (xx || yy) ? Math.atan2(yy, xx) : 0;
-
- if (a < Math.PI/ -2)
- a = a + Math.PI * 2;
-
- var dist = 0;
- var minv = minimumValue*100, maxv = maximumValue*100;
-
- if (minimumValue < 0) {
- dist = -minimumValue;
- minv = 0;
- maxv = maximumValue + dist;
- }
-
- var r = maxv - minv;
- var v;
- if (wrapping)
- v = (0.5 + minv + r * (Math.PI * 3 / 2 - a) / (2 * Math.PI));
- else
- v = (0.5 + minv + r* (Math.PI * 4 / 3 - a) / (Math.PI * 10 / 6));
-
- if (dist > 0)
- v -= dist;
- return maximumValue - bound(v/100)
- }
- }
-
- WheelArea {
- id: wheelarea
- anchors.fill: parent
- horizontalMinimumValue: dial.minimumValue
- horizontalMaximumValue: dial.maximumValue
- verticalMinimumValue: dial.minimumValue
- verticalMaximumValue: dial.maximumValue
- property double step: (dial.maximumValue - dial.minimumValue)/100
-
- onVerticalWheelMoved: {
- value += verticalDelta/4*step
- }
-
- onHorizontalWheelMoved: {
- value += horizontalDelta/4*step
- }
- }
-
- elementType:"dial"
- sunken: mouseArea.pressed
- maximum: range.maximumValue*90
- minimum: range.minimumValue*90
- focus:dial.focus
- value: visualPos*90
- enabled: dial.enabled
- property double visualPos : range.value
- Behavior on visualPos {
- enabled: !mouseArea.inDrag
- NumberAnimation {
- duration: 300
- easing.type: Easing.OutSine
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/Frame.qml b/lib/qtcreator/qtcomponents/Frame.qml
deleted file mode 100644
index 9b825b6deb..0000000000
--- a/lib/qtcreator/qtcomponents/Frame.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-
-QStyleBackground {
-
- width: 100
- height: 100
-
- default property alias children: content.children
-
- style: QStyleItem {
- id: styleitem
- elementType: "frame"
- }
-
- Item {
- id: content
- anchors.fill: parent
- anchors.margins: frameWidth
- property int frameWidth: styleitem.pixelMetric("defaultframewidth");
- }
-}
-
diff --git a/lib/qtcreator/qtcomponents/GroupBox.qml b/lib/qtcreator/qtcomponents/GroupBox.qml
deleted file mode 100644
index 0adf4c6885..0000000000
--- a/lib/qtcreator/qtcomponents/GroupBox.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.GroupBox {
- id: groupbox
- width: Math.max(200, contentWidth + sizeHint.width)
- height: contentHeight + sizeHint.height + 4
- property variant sizeHint: backgroundItem.sizeFromContents(0, 24)
- property bool flat: false
- background : QStyleItem {
- id: styleitem
- elementType: "groupbox"
- anchors.fill: parent
- text: groupbox.title
- hover: checkbox.containsMouse
- on: checkbox.checked
- focus: checkbox.activeFocus
- activeControl: checkable ? "checkbox" : ""
- sunken: !flat
- }
-}
diff --git a/lib/qtcreator/qtcomponents/Menu.qml b/lib/qtcreator/qtcomponents/Menu.qml
deleted file mode 100644
index 8d8b758f53..0000000000
--- a/lib/qtcreator/qtcomponents/Menu.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-MenuBase {
-
-}
diff --git a/lib/qtcreator/qtcomponents/MenuItem.qml b/lib/qtcreator/qtcomponents/MenuItem.qml
deleted file mode 100644
index eb5a144123..0000000000
--- a/lib/qtcreator/qtcomponents/MenuItem.qml
+++ /dev/null
@@ -1,34 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-MenuItemBase {
-
-}
diff --git a/lib/qtcreator/qtcomponents/ProgressBar.qml b/lib/qtcreator/qtcomponents/ProgressBar.qml
deleted file mode 100644
index d30fdafbfe..0000000000
--- a/lib/qtcreator/qtcomponents/ProgressBar.qml
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.ProgressBar {
- id:progressbar
-
- property variant sizehint: backgroundItem.sizeFromContents(23, 23)
- property int orientation: Qt.Horizontal
- property string hint
-
- height: orientation === Qt.Horizontal ? sizehint.height : 200
- width: orientation === Qt.Horizontal ? 200 : sizehint.height
-
- background: QStyleItem {
- anchors.fill: parent
- elementType: "progressbar"
- // XXX: since desktop uses int instead of real, the progressbar
- // range [0..1] must be stretched to a good precision
- property int factor : 1000
- value: indeterminate ? 0 : progressbar.value * factor // does indeterminate value need to be 1 on windows?
- minimum: indeterminate ? 0 : progressbar.minimumValue * factor
- maximum: indeterminate ? 0 : progressbar.maximumValue * factor
- enabled: progressbar.enabled
- horizontal: progressbar.orientation == Qt.Horizontal
- hint: progressbar.hint
- }
-}
-
diff --git a/lib/qtcreator/qtcomponents/RadioButton.qml b/lib/qtcreator/qtcomponents/RadioButton.qml
deleted file mode 100644
index 90853b1018..0000000000
--- a/lib/qtcreator/qtcomponents/RadioButton.qml
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-// jb : Size should not depend on background, we should make it consistent
-
-Components.CheckBox {
- id:radiobutton
- property string text
- property string hint
- width:110
- height:20
-
- background: QStyleItem {
- elementType:"radiobutton"
- sunken:pressed
- on:checked || pressed
- hover:containsMouse
- text:radiobutton.text
- enabled:radiobutton.enabled
- focus:radiobutton.focus
- hint:radiobutton.hint
- }
- Keys.onSpacePressed:clicked()
-}
-
diff --git a/lib/qtcreator/qtcomponents/ScrollArea.qml b/lib/qtcreator/qtcomponents/ScrollArea.qml
deleted file mode 100644
index 9c43991558..0000000000
--- a/lib/qtcreator/qtcomponents/ScrollArea.qml
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-FocusScope {
- id: scrollarea
- width: 100
- height: 100
-
- property int frameWidth: frame ? styleitem.pixelMetric("defaultframewidth") : 0;
- property int contentHeight : content.childrenRect.height
- property int contentWidth: content.childrenRect.width
- property alias color: colorRect.color
- property bool frame: true
- property bool highlightOnFocus: false
- property bool frameAroundContents: styleitem.styleHint("framearoundcontents")
- property alias verticalValue: vscrollbar.value
- property alias horizontalValue: hscrollbar.value
-
- property alias horizontalScrollBar: hscrollbar
- property alias verticalScrollBar: vscrollbar
-
- default property alias data: content.data
-
- property int contentY
- property int contentX
-
- onContentYChanged: {
- vscrollbar.value = contentY
- wheelarea.verticalValue = contentY
- }
- onContentXChanged: {
- hscrollbar.value = contentX
- wheelarea.horizontalValue = contentX
- }
-
- Rectangle {
- id: colorRect
- color: "transparent"
- anchors.fill:styleitem
- anchors.margins: frameWidth
- }
-
- QStyleItem {
- id: styleitem
- elementType: "frame"
- onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth");
- sunken: true
- visible: frame
- anchors.fill: parent
- anchors.rightMargin: frame ? (frameAroundContents ? (vscrollbar.visible ? vscrollbar.width + 2 * frameMargins : 0) : -frameWidth) : 0
- anchors.bottomMargin: frame ? (frameAroundContents ? (hscrollbar.visible ? hscrollbar.height + 2 * frameMargins : 0) : -frameWidth) : 0
- anchors.topMargin: frame ? (frameAroundContents ? 0 : -frameWidth) : 0
- property int scrollbarspacing: styleitem.pixelMetric("scrollbarspacing");
- property int frameMargins : frame ? scrollbarspacing : 0
- property int frameoffset: style === "mac" ? -1 : 0
- }
-
- Item {
- id: flickable
- anchors.fill: styleitem
- anchors.margins: frameWidth
- clip: true
-
- Item {
- id: content
- x: -scrollarea.contentX
- y: -scrollarea.contentY
- }
- }
-
- WheelArea {
- id: wheelarea
- anchors.fill: parent
- horizontalMinimumValue: hscrollbar.minimumValue
- horizontalMaximumValue: hscrollbar.maximumValue
- verticalMinimumValue: vscrollbar.minimumValue
- verticalMaximumValue: vscrollbar.maximumValue
-
- onVerticalValueChanged: {
- contentY = verticalValue
- }
-
- onHorizontalValueChanged: {
- contentX = horizontalValue
- }
- }
-
- ScrollBar {
- id: hscrollbar
- orientation: Qt.Horizontal
- property int availableWidth : scrollarea.width - (frame ? (vscrollbar.width) : 0)
- visible: contentWidth > availableWidth
- maximumValue: contentWidth > availableWidth ? scrollarea.contentWidth - availableWidth: 0
- minimumValue: 0
- anchors.bottom: parent.bottom
- anchors.bottomMargin: styleitem.frameoffset
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.leftMargin: (frame ? frameWidth : 0)
- anchors.rightMargin: { vscrollbar.visible ? scrollbarExtent : (frame ? 1 : 0) }
- onValueChanged: contentX = value
- property int scrollbarExtent : styleitem.pixelMetric("scrollbarExtent");
- }
-
- ScrollBar {
- id: vscrollbar
- orientation: Qt.Vertical
- property int availableHeight : scrollarea.height - (frame ? (hscrollbar.height) : 0)
- visible: contentHeight > availableHeight
- maximumValue: contentHeight > availableHeight ? scrollarea.contentHeight - availableHeight : 0
- minimumValue: 0
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.topMargin: styleitem.style == "mac" ? 1 : 0
- onValueChanged: contentY = value
- anchors.rightMargin: styleitem.frameoffset
- anchors.bottomMargin: hscrollbar.visible ? hscrollbar.height : styleitem.frameoffset
- }
-
- Rectangle {
- // This is the filled corner between scrollbars
- id: cornerFill
- anchors.left: vscrollbar.left
- anchors.right: vscrollbar.right
- anchors.top: hscrollbar.top
- anchors.bottom: hscrollbar.bottom
- visible: hscrollbar.visible && vscrollbar.visible
- SystemPalette { id: syspal }
- color: syspal.window
- }
-
- QStyleItem {
- z: 2
- anchors.fill: parent
- anchors.margins: -3
- anchors.rightMargin: -4
- anchors.bottomMargin: -4
- visible: highlightOnFocus && parent.activeFocus && styleitem.styleHint("focuswidget")
- elementType: "focusframe"
- }
-}
diff --git a/lib/qtcreator/qtcomponents/ScrollBar.qml b/lib/qtcreator/qtcomponents/ScrollBar.qml
deleted file mode 100644
index 6d42393f4e..0000000000
--- a/lib/qtcreator/qtcomponents/ScrollBar.qml
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Item {
- id: scrollbar
-
- property int orientation : Qt.Horizontal
- property alias minimumValue: slider.minimumValue
- property alias maximumValue: slider.maximumValue
- property int pageStep: styleitem.horizontal ? width : height
- property int singleStep: 20
- property alias value: slider.value
- property bool scrollToClickposition: styleitem.styleHint("scrollToClickPosition")
-
- width: orientation == Qt.Horizontal ? 200 : internal.scrollbarExtent
- height: orientation == Qt.Horizontal ? internal.scrollbarExtent : 200
-
- onValueChanged: internal.updateHandle()
-
- MouseArea {
- id: internal
-
- anchors.fill: parent
- property bool upPressed
- property bool downPressed
- property bool pageUpPressed
- property bool pageDownPressed
-
- property bool autoincrement: false
- property int scrollbarExtent : styleitem.pixelMetric("scrollbarExtent");
- property bool handlePressed
-
- // Update hover item
- onEntered: styleitem.activeControl = styleitem.hitTest(mouseX, mouseY)
- onExited: styleitem.activeControl = "none"
- onMouseXChanged: styleitem.activeControl = styleitem.hitTest(mouseX, mouseY)
- hoverEnabled: true
-
- property variant control
- property variant pressedX
- property variant pressedY
- property int oldPosition
- property int grooveSize
-
- Timer {
- running: internal.upPressed || internal.downPressed || internal.pageUpPressed || internal.pageDownPressed
- interval: 350
- onTriggered: internal.autoincrement = true
- }
-
- Timer {
- running: internal.autoincrement
- interval: 60
- repeat: true
- onTriggered: internal.upPressed ? internal.decrement() : internal.downPressed ? internal.increment() :
- internal.pageUpPressed ? internal.decrementPage() :
- internal.incrementPage()
- }
-
- onMousePositionChanged: {
- if (pressed && control === "handle") {
- //slider.positionAtMaximum = grooveSize
- if (!styleitem.horizontal)
- slider.position = oldPosition + (mouseY - pressedY)
- else
- slider.position = oldPosition + (mouseX - pressedX)
- }
- }
-
- onPressed: {
- control = styleitem.hitTest(mouseX,mouseY)
- scrollToClickposition = styleitem.styleHint("scrollToClickPosition")
- grooveSize = styleitem.horizontal? styleitem.subControlRect("groove").width -
- styleitem.subControlRect("handle").width:
- styleitem.subControlRect("groove").height -
- styleitem.subControlRect("handle").height;
- if (control == "handle") {
- pressedX = mouseX
- pressedY = mouseY
- oldPosition = slider.position
- } else if (control == "up") {
- decrement();
- upPressed = true
- } else if (control == "down") {
- increment();
- downPressed = true
- } else if (!scrollToClickposition){
- if (control == "upPage") {
- decrementPage();
- pageUpPressed = true
- } else if (control == "downPage") {
- incrementPage();
- pageDownPressed = true
- }
- } else {
- slider.position = styleitem.horizontal ? mouseX - handleRect.width/2
- : mouseY - handleRect.height/2
- }
- }
-
- onReleased: {
- autoincrement = false;
- upPressed = false;
- downPressed = false;
- pageUpPressed = false
- pageDownPressed = false
- control = ""
- }
-
- function incrementPage() {
- value += pageStep
- if (value > maximumValue)
- value = maximumValue
- }
-
- function decrementPage() {
- value -= pageStep
- if (value < minimumValue)
- value = minimumValue
- }
-
- function increment() {
- value += singleStep
- if (value > maximumValue)
- value = maximumValue
- }
-
- function decrement() {
- value -= singleStep
- if (value < minimumValue)
- value = minimumValue
- }
-
- QStyleItem {
- id: styleitem
- anchors.fill:parent
- elementType: "scrollbar"
- hover: activeControl != "none"
- activeControl: "none"
- sunken: internal.upPressed | internal.downPressed
- minimum: slider.minimumValue
- maximum: slider.maximumValue
- value: slider.value
- horizontal: orientation == Qt.Horizontal
- enabled: parent.enabled
- }
-
- property variant handleRect: Qt.rect(0,0,0,0)
- property variant grooveRect: Qt.rect(0,0,0,0)
- function updateHandle() {
- internal.handleRect = styleitem.subControlRect("handle")
- grooveRect = styleitem.subControlRect("groove");
- }
-
- RangeModel {
- id: slider
- minimumValue: 0.0
- maximumValue: 1.0
- value: 0
- stepSize: 0.0
- inverted: false
- positionAtMaximum: internal.grooveSize
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/Slider.qml b/lib/qtcreator/qtcomponents/Slider.qml
deleted file mode 100644
index 72306e209f..0000000000
--- a/lib/qtcreator/qtcomponents/Slider.qml
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-// jens: ContainsMouse breaks drag functionality
-
-Components.Slider{
- id: slider
-
- property bool tickmarksEnabled: true
- property string tickPosition: "Below" // "Top", "Below", "BothSides"
-
- QStyleItem { id:buttonitem; elementType: "slider" }
-
- property variant sizehint: buttonitem.sizeFromContents(23, 23)
- property int orientation: Qt.Horizontal
-
- height: orientation === Qt.Horizontal ? sizehint.height : 200
- width: orientation === Qt.Horizontal ? 200 : sizehint.height
- property string hint;
-
- groove: QStyleItem {
- anchors.fill:parent
- elementType: "slider"
- sunken: pressed
- maximum: slider.maximumValue*100
- minimum: slider.minimumValue*100
- value: slider.value*100
- horizontal: slider.orientation == Qt.Horizontal
- enabled: slider.enabled
- focus: slider.focus
- hint: slider.hint
- activeControl: tickmarksEnabled ? tickPosition.toLowerCase() : ""
- }
-
- handle: null
- valueIndicator: null
-
- Keys.onRightPressed: value += (maximumValue - minimumValue)/10.0
- Keys.onLeftPressed: value -= (maximumValue - minimumValue)/10.0
-
- WheelArea {
- id: wheelarea
- anchors.fill: parent
- horizontalMinimumValue: slider.minimumValue
- horizontalMaximumValue: slider.maximumValue
- verticalMinimumValue: slider.minimumValue
- verticalMaximumValue: slider.maximumValue
- property double step: (slider.maximumValue - slider.minimumValue)/100
-
- onVerticalWheelMoved: {
- value += verticalDelta/4*step
- }
-
- onHorizontalWheelMoved: {
- value += horizontalDelta/4*step
- }
- }
-
-}
diff --git a/lib/qtcreator/qtcomponents/SpinBox.qml b/lib/qtcreator/qtcomponents/SpinBox.qml
deleted file mode 100644
index 6ff6f529ef..0000000000
--- a/lib/qtcreator/qtcomponents/SpinBox.qml
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.SpinBox {
- id:spinbox
-
- property variant __upRect;
- property variant __downRect;
- property int __margin: (height -16)/2
- property string hint
-
- // Align height with button
- topMargin:__margin
- bottomMargin:__margin
-
- leftMargin:6
- rightMargin:6
-
- QStyleItem { id:edititem ; elementType:"edit" ; visible:false }
- property int buttonHeight: edititem.sizeFromContents(70, 20).height
- property int buttonWidth: edititem.sizeFromContents(70, 20).width
-
- height: buttonHeight
- width: buttonWidth
- clip:false
-
- background: Item {
- anchors.fill: parent
- property variant __editRect
-
- Rectangle {
- id: editBackground
- x: __editRect.x - 1
- y: __editRect.y
- width: __editRect.width + 1
- height: __editRect.height
- }
-
- Item {
- id: focusFrame
- anchors.fill: editBackground
- visible: frameitem.styleHint("focuswidget")
- QStyleItem {
- id: frameitem
- anchors.margins: -6
- anchors.leftMargin: -6
- anchors.rightMargin: -7
- anchors.fill: parent
- visible: spinbox.activeFocus
- elementType: "focusframe"
- }
- }
-
- function updateRect() {
- __upRect = styleitem.subControlRect("up");
- __downRect = styleitem.subControlRect("down");
- __editRect = styleitem.subControlRect("edit");
- spinbox.leftMargin = __editRect.x + 2
- spinbox.rightMargin = spinbox.width -__editRect.width - __editRect.x
- }
-
- Component.onCompleted: updateRect()
- onWidthChanged: updateRect()
- onHeightChanged: updateRect()
-
- QStyleItem {
- id: styleitem
- anchors.fill: parent
- elementType: "spinbox"
- sunken: (downEnabled && downPressed) | (upEnabled && upPressed)
- hover: containsMouse
- focus: spinbox.focus
- enabled: spinbox.enabled
- value: (upPressed ? 1 : 0) |
- (downPressed == 1 ? 1<<1 : 0) |
- (upEnabled ? (1<<2) : 0) |
- (downEnabled == 1 ? (1<<3) : 0)
- hint: spinbox.hint
- }
- }
-
- up: Item {
- x: __upRect.x
- y: __upRect.y
- width: __upRect.width
- height: __upRect.height
- }
-
- down: Item {
- x: __downRect.x
- y: __downRect.y
- width: __downRect.width
- height: __downRect.height
- }
-}
diff --git a/lib/qtcreator/qtcomponents/SplitterRow.qml b/lib/qtcreator/qtcomponents/SplitterRow.qml
deleted file mode 100644
index 404b310178..0000000000
--- a/lib/qtcreator/qtcomponents/SplitterRow.qml
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.SplitterRow {
- handleBackground: QStyleItem {
- id: styleitem
- elementType: "splitter"
- width: pixelMetric("splitterwidth")
-
- MouseArea {
- anchors.fill: parent
- anchors.leftMargin: (parent.width <= 1) ? -2 : 0
- anchors.rightMargin: (parent.width <= 1) ? -2 : 0
- drag.axis: Qt.YAxis
- drag.target: handleDragTarget
- onMouseXChanged: handleDragged(handleIndex)
-
- QStyleItem {
- anchors.fill: parent
- cursor: "splithcursor"
- }
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/Switch.qml b/lib/qtcreator/qtcomponents/Switch.qml
deleted file mode 100644
index 6eae3fb753..0000000000
--- a/lib/qtcreator/qtcomponents/Switch.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.Switch {
- id:widget
- minimumWidth:100
- minimumHeight:30
-
- groove:QStyleItem {
- elementType:"edit"
- sunken: true
- }
-
- handle: QStyleItem {
- elementType:"button"
- width:widget.width/2
- height:widget.height-4
- hover:containsMouse
- }
-}
-
diff --git a/lib/qtcreator/qtcomponents/Tab.qml b/lib/qtcreator/qtcomponents/Tab.qml
deleted file mode 100644
index fa1aea6ea5..0000000000
--- a/lib/qtcreator/qtcomponents/Tab.qml
+++ /dev/null
@@ -1,37 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import Qt 4.7
-
-Item {
- id:tab
- anchors.fill: parent
- property string title
- property int contentMargin
-}
diff --git a/lib/qtcreator/qtcomponents/TabBar.qml b/lib/qtcreator/qtcomponents/TabBar.qml
deleted file mode 100644
index c824ab1ea9..0000000000
--- a/lib/qtcreator/qtcomponents/TabBar.qml
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-
-Item {
- id: tabbar
- property int tabHeight: tabrow.height
- property int tabWidth: tabrow.width
-
- Keys.onRightPressed: {
- if (tabFrame && tabFrame.current < tabFrame.count - 1)
- tabFrame.current = tabFrame.current + 1
- }
- Keys.onLeftPressed: {
- if (tabFrame && tabFrame.current > 0)
- tabFrame.current = tabFrame.current - 1
- }
-
- height: tabHeight
-
- property Item tabFrame
- onTabFrameChanged:parent = tabFrame
- visible: tabFrame ? tabFrame.tabsVisible : true
- property int __overlap : styleitem.pixelMetric("tabvshift");
- property string position: tabFrame ? tabFrame.position : "North"
- property string tabBarAlignment: styleitem.styleHint("tabbaralignment");
- property int tabOverlap: styleitem.pixelMetric("taboverlap");
- property int tabBaseOverlap: styleitem.pixelMetric("tabbaseoverlap");
- property int tabHSpace: styleitem.pixelMetric("tabhspace");
- property int tabVSpace: styleitem.pixelMetric("tabvspace");
-
- function tab(index) {
- for (var i = 0; i < tabrow.children.length; ++i) {
- if (tabrow.children[i].tabindex == index) {
- return tabrow.children[i]
- }
- }
- return null;
- }
-
- QStyleItem {
- visible:false
- id:styleitem
- elementType: "tab"
- text: "generic"
- }
-
- Row {
- id: tabrow
- focus: true
- property int paintMargins: 1
- states:
- State {
- when: tabBarAlignment == "center"
- name: "centered"
- AnchorChanges {
- target:tabrow
- anchors.horizontalCenter: tabbar.horizontalCenter
- }
- }
-
- Repeater {
- id:repeater
- focus:true
- model: tabFrame ? tabFrame.tabs.length : null
- delegate: Item {
- id:tab
- focus:true
- property int tabindex: index
- property bool selected : tabFrame.current == index
- z: selected ? 1 : -1
- function updateRect() {
- var rect = style.sizeFromContents(textitem.width + tabHSpace + 2, Math.max(style.fontHeight + tabVSpace + 6, 0))
- width = rect.width
- height = rect.height
- }
- // Component.onCompleted: print("taboverlap" + tabOverlap + " tabbaseoverlap " + tabBaseOverlap + " overlap " +__overlap + " hspace " + tabHSpace)
- QStyleItem {
- id: style
- elementType: "tab"
- selected: tab.selected
- info: tabbar.position
- text: tabFrame.tabs[index].title
- hover: mousearea.containsMouse
- focus: tabbar.focus && selected
- property bool first: index === 0
- paintMargins: tabrow.paintMargins
- activeControl: tabFrame.count == 1 ? "only" : index === 0 ? "beginning" :
- index == tabFrame.count-1 ? "end" : "middle"
- anchors.fill: parent
- anchors.margins: -paintMargins
- Text {
- id: textitem
- // Used for size hint
- visible: false
- onWidthChanged: updateRect()
- onHeightChanged: updateRect()
- text: tabFrame.tabs[index].title
- }
- }
- MouseArea {
- id: mousearea
- anchors.fill: parent
- hoverEnabled: true
- onPressed: tabFrame.current = index
- }
- }
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/TabFrame.qml b/lib/qtcreator/qtcomponents/TabFrame.qml
deleted file mode 100644
index 6e5f1f88bc..0000000000
--- a/lib/qtcreator/qtcomponents/TabFrame.qml
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Item {
- id: tabWidget
- width: 100
- height: 100
- focus: true
- property TabBar tabbar
- property int current: 0
- property int count: stack.children.length
- property bool frame:true
- property bool tabsVisible: true
- property string position: "North"
- default property alias tabs : stack.children
-
- onCurrentChanged: __setOpacities()
- Component.onCompleted: __setOpacities()
- onTabbarChanged: {
- tabbar.tabFrame = tabWidget
- tabbar.anchors.top = tabWidget.top
- tabbar.anchors.left = tabWidget.left
- tabbar.anchors.right = tabWidget.right
- }
-
- property int __baseOverlap : frameitem.pixelMetric("tabbaseoverlap")// add paintmargins;
- function __setOpacities() {
- for (var i = 0; i < stack.children.length; ++i) {
- stack.children[i].visible = (i == current ? true : false)
- }
- }
-
- QStyleItem {
- id: frameitem
- z: style == "oxygen" ? 1 : 0
- elementType: "tabframe"
- info: position
- value: tabbar && tabsVisible && tabbar.tab(current) ? tabbar.tab(current).x : 0
- minimum: tabbar && tabsVisible && tabbar.tab(current) ? tabbar.tab(current).width : 0
- maximum: tabbar && tabsVisible ? tabbar.tabWidth : width
- anchors.fill: parent
-
- property int frameWidth: pixelMetric("defaultframewidth")
-
- Item {
- id: stack
- anchors.fill: parent
- anchors.margins: (frame ? frameitem.frameWidth : 0)
- anchors.topMargin: anchors.margins + (frameitem.style =="mac" ? 6 : 0)
- anchors.bottomMargin: anchors.margins + (frameitem.style =="mac" ? 6 : 0)
- }
-
- anchors.topMargin: tabbar && tabsVisible && position == "North" ? tabbar.height - __baseOverlap : 0
-
- states: [
- State {
- name: "South"
- when: position == "South" && tabbar!= undefined
- PropertyChanges {
- target: frameitem
- anchors.topMargin: 0
- anchors.bottomMargin: tabbar ? tabbar.height - __baseOverlap: 0
- }
- PropertyChanges {
- target: tabbar
- anchors.topMargin: -__baseOverlap
- }
- AnchorChanges {
- target: tabbar
- anchors.top: frameitem.bottom
- anchors.bottom: undefined
- }
- }
- ]
- }
-}
diff --git a/lib/qtcreator/qtcomponents/TableColumn.qml b/lib/qtcreator/qtcomponents/TableColumn.qml
deleted file mode 100644
index 5587390c59..0000000000
--- a/lib/qtcreator/qtcomponents/TableColumn.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-QtObject {
- property string caption
- property string property
- property int width: 160
- property bool visible: true
- property int elideMode: Text.ElideRight
-}
diff --git a/lib/qtcreator/qtcomponents/TableView.qml b/lib/qtcreator/qtcomponents/TableView.qml
deleted file mode 100644
index 613088739b..0000000000
--- a/lib/qtcreator/qtcomponents/TableView.qml
+++ /dev/null
@@ -1,601 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-/*
-*
-* TableView
-*
-* This component provides an item-view with resizable
-* header sections.
-*
-* You can style the drawn delegate by overriding the itemDelegate
-* property. The following properties are supported for custom
-* delegates:
-*
-* Note: Currently only row selection is available for this component
-*
-* itemheight - default platform size of item
-* itemwidth - default platform width of item
-* itemselected - if the row is currently selected
-* itemvalue - The text for this item
-* itemforeground - The default text color for an item
-*
-* For example:
-* itemDelegate: Item {
-* Text {
-* anchors.verticalCenter: parent.verticalCenter
-* color: itemForeground
-* elide: Text.ElideRight
-* text: itemValue
-* }
-* }
-*
-* Data for each row is provided through a model:
-*
-* ListModel {
-* ListElement{ column1: "value 1"; column2: "value 2"}
-* ListElement{ column1: "value 3"; column2: "value 4"}
-* }
-*
-* You provide title and size properties on TableColumns
-* by setting the default header property :
-*
-* TableView {
-* TableColumn{ property: "column1" ; caption: "Column 1" ; width:100}
-* TableColumn{ property: "column2" ; caption: "Column 2" ; width:200}
-* model: datamodel
-* }
-*
-* The header sections are attached to values in the datamodel by defining
-* the listmodel property they attach to. Each property in the model, will
-* then be shown in each column section.
-*
-* The view itself does not provide sorting. This has to
-* be done on the model itself. However you can provide sorting
-* on the model and enable sort indicators on headers.
-*
-* sortColumn - The index of the currently selected sort header
-* sortIndicatorVisible - If sort indicators should be enabled
-* sortIndicatorDirection - "up" or "down" depending on state
-*
-*/
-
-FocusScope{
- id: root
- property variant model
- property int frameWidth: frame ? styleitem.pixelMetric("defaultframewidth") : 0;
- property alias contentHeight : tree.contentHeight
- property alias contentWidth: tree.contentWidth
- property bool frame: true
- property bool highlightOnFocus: false
- property bool frameAroundContents: styleitem.styleHint("framearoundcontents")
- property int sortColumn // Index of currently selected sort column
-
- property bool sortIndicatorVisible: false // enables or disables sort indicator
- property string sortIndicatorDirection: "down" // "up" or "down" depending on current state
-
- property bool alternateRowColor: true
- property alias contentX: tree.contentX
- property alias contentY: tree.contentY
-
- property alias currentIndex: tree.currentIndex // Should this be currentRowIndex?
-
- property int headerHeight: headerrow.height
-
- property Component itemDelegate: standardDelegate
- property Component rowDelegate: rowDelegate
- property Component headerDelegate: headerDelegate
- property alias cacheBuffer: tree.cacheBuffer
-
- property bool headerVisible: true
-
- default property alias header: tree.header
-
- signal activated
-
- Component {
- id: standardDelegate
- Item {
- property int implicitWidth: sizehint.paintedWidth + 4
- Text {
- width: parent.width
- anchors.margins: 4
- anchors.left: parent.left
- anchors.verticalCenter: parent.verticalCenter
- elide: itemElideMode
- text: itemValue ? itemValue : ""
- color: itemForeground
- }
- Text {
- id: sizehint
- text: itemValue ? itemValue : ""
- visible:false
- }
- }
- }
-
- Component {
- id: nativeDelegate
- // This gives more native styling, but might be less performant
- QStyleItem {
- elementType: "item"
- text: itemValue
- selected: itemSelected
- }
- }
-
- Component {
- id: headerDelegate
- QStyleItem {
- elementType: "header"
- activeControl: itemSort
- raised: true
- sunken: itemPressed
- text: itemValue
- hover: itemContainsMouse
- }
- }
-
- Component {
- id: rowDelegate
- QStyleItem {
- id: rowstyle
- elementType: "itemrow"
- activeControl: itemAlternateBackground ? "alternate" : ""
- selected: itemSelected ? "true" : "false"
- }
- }
-
- Rectangle {
- id: colorRect
- color: "white"
- anchors.fill: frameitem
- anchors.margins: frameWidth
- anchors.rightMargin: (!frameAroundContents && vscrollbar.visible ? vscrollbar.width : 0) + frameWidth
- anchors.bottomMargin: (!frameAroundContents && hscrollbar.visible ? hscrollbar.height : 0) +frameWidth
- }
-
- QStyleItem {
- id: frameitem
- elementType: "frame"
- onElementTypeChanged: scrollarea.frameWidth = styleitem.pixelMetric("defaultframewidth");
- sunken: true
- visible: frame
- anchors.fill: parent
- anchors.rightMargin: frame ? (frameAroundContents ? (vscrollbar.visible ? vscrollbar.width + 2 * frameMargins : 0) : -frameWidth) : 0
- anchors.bottomMargin: frame ? (frameAroundContents ? (hscrollbar.visible ? hscrollbar.height + 2 * frameMargins : 0) : -frameWidth) : 0
- anchors.topMargin: frame ? (frameAroundContents ? 0 : -frameWidth) : 0
- property int scrollbarspacing: styleitem.pixelMetric("scrollbarspacing");
- property int frameMargins : frame ? scrollbarspacing : 0
- }
- MouseArea {
- id: mousearea
-
- anchors.fill: tree
-
- property bool autoincrement: false
- property bool autodecrement: false
-
- onReleased: {
- autoincrement = false
- autodecrement = false
- }
-
- // Handle vertical scrolling whem dragging mouse outside boundraries
-
- Timer { running: mousearea.autoincrement; repeat: true; interval: 30 ; onTriggered: tree.incrementCurrentIndex()}
- Timer { running: mousearea.autodecrement; repeat: true; interval: 30 ; onTriggered: tree.decrementCurrentIndex()}
-
- onMousePositionChanged: {
- if (mouseY > tree.height) {
- autodecrement = false
- autoincrement = true
- } else if (mouseY < 0) {
- autoincrement = false
- autodecrement = true
- } else {
- autoincrement = false
- autodecrement = false
- }
-
- var y = Math.min(contentY + tree.height - 5, Math.max(mouseY + contentY, contentY))
-
- var newIndex = tree.indexAt(0, y)
- if (newIndex > 0)
- tree.currentIndex = tree.indexAt(0, y)
- }
- onPressed: {
- tree.forceActiveFocus()
- var x = Math.min(contentWidth - 5, Math.max(mouseX + contentX, 0))
- var y = Math.min(contentHeight - 5, Math.max(mouseY + contentY, 0))
- tree.currentIndex = tree.indexAt(x, y)
- }
-
- onDoubleClicked: {
- parent.activated()
- }
- }
-
- ListView {
- id: tree
- property list<TableColumn> header
- property bool blockUpdates: false
- highlightFollowsCurrentItem: true
- model: root.model
-
- interactive: false
- anchors.top: tableColumn.bottom
- anchors.topMargin: -frameWidth
- anchors.left: frameitem.left
- anchors.right: frameitem.right
- anchors.bottom: frameitem.bottom
- anchors.margins: frameWidth
-
- anchors.rightMargin: (!frameAroundContents && vscrollbar.visible ? vscrollbar.width: 0) + frameWidth
- anchors.bottomMargin: (!frameAroundContents && hscrollbar.visible ? hscrollbar.height : 0) + frameWidth
-
- focus: true
- clip: true
-
- Keys.onUpPressed: {
- blockUpdates = true
- if (currentIndex > 0) currentIndex = currentIndex - 1
- wheelarea.verticalValue = contentY/wheelarea.scale
- blockUpdates = false
- }
- Keys.onDownPressed: {
- blockUpdates = true
- if (currentIndex< count - 1) currentIndex = currentIndex + 1
- wheelarea.verticalValue = contentY/wheelarea.scale
- blockUpdates = false
- }
- Keys.onPressed: {
- if (event.key == Qt.Key_PageUp) {
- vscrollbar.value = vscrollbar.value - tree.height
- } else if (event.key == Qt.Key_PageDown)
- vscrollbar.value = vscrollbar.value + tree.height
- }
-
- onContentYChanged: {
- // positionViewAtIndex(currentIndex, ListView.Visible)
- // highlight follows item
- blockUpdates = true
- vscrollbar.value = tree.contentY
- blockUpdates = false
- }
-
- delegate: Item {
- id: rowitem
- width: row.width
- height: row.height
- anchors.margins: frameWidth
- property int rowIndex: model.index
- property bool itemAlternateBackground: alternateRowColor && rowIndex % 2 == 1
- Loader {
- id: rowstyle
- // row delegate
- sourceComponent: root.rowDelegate
- // Row fills the tree width regardless of item size
- // But scrollbar should not adjust to it
- width: frameitem.width
- height: row.height
- x: contentX
-
- property bool itemAlternateBackground: rowitem.itemAlternateBackground
- property bool itemSelected: rowitem.ListView.isCurrentItem
- }
- Row {
- id: row
- anchors.left: parent.left
-
- Repeater {
- id: repeater
- model: root.header.length
- Loader {
- id: itemDelegateLoader
- visible: header[index].visible
- sourceComponent: itemDelegate
- property variant model: tree.model
- property variant itemProperty: header[index].property
-
- width: header[index].width
- height: item ? item.height : Math.max(16, styleitem.sizeFromContents(16, 16).height)
-
- function getValue() {
- if (index < header.length &&
- root.model.get(rowIndex).hasOwnProperty(header[index].property))
- return root.model.get(rowIndex)[ header[index].property]
- }
- property variant itemValue: root.model.get(rowIndex)[ header[index].property]
- property bool itemSelected: rowitem.ListView.isCurrentItem
- property color itemForeground: itemSelected ? rowstyleitem.highlightedTextColor : rowstyleitem.textColor
- property int rowIndex: rowitem.rowIndex
- property int columnIndex: index
- property int itemElideMode: header[index].elideMode
- }
- }
- onWidthChanged: tree.contentWidth = width
- }
- }
- }
- Text{ id:text }
-
- Item {
- id: tableColumn
- clip: true
- anchors.top: frameitem.top
- anchors.left: frameitem.left
- anchors.right: frameitem.right
- anchors.margins: frameWidth
- visible: headerVisible
- Behavior on height { NumberAnimation{duration:80}}
- height: headerVisible ? styleitem.sizeFromContents(text.font.pixelSize, styleitem.fontHeight).height : frameWidth
-
- Row {
- id: headerrow
-
- anchors.top: parent.top
- height:parent.height
- x: -tree.contentX
-
- Repeater {
- id: repeater
- model: header.length
- property int targetIndex: -1
- property int dragIndex: -1
- delegate: Item {
- z:-index
- width: header[index].width
- visible: header[index].visible
- height: headerrow.height
-
- Loader {
- sourceComponent: root.headerDelegate
- anchors.fill: parent
- property string itemValue: header[index].caption
- property string itemSort: (sortIndicatorVisible && index == sortColumn) ? (sortIndicatorDirection == "up" ? "up" : "down") : "";
- property bool itemPressed: headerClickArea.pressed
- property bool itemContainsMouse: headerClickArea.containsMouse
- }
- Rectangle{
- id: targetmark
- width: parent.width
- height:parent.height
- opacity: (index == repeater.targetIndex && repeater.targetIndex != repeater.dragIndex) ? 0.5 : 0
- Behavior on opacity { NumberAnimation{duration:160}}
- color: palette.highlight
- }
-
- MouseArea{
- id: headerClickArea
- drag.axis: Qt.YAxis
- hoverEnabled: true
- anchors.fill: parent
- onClicked: {
- if (sortColumn == index)
- sortIndicatorDirection = sortIndicatorDirection === "up" ? "down" : "up"
- sortColumn = index
- }
- // Here we handle moving header sections
- onMousePositionChanged: {
- if (pressed) { // only do this while dragging
- for (var h = 0 ; h < header.length ; ++h) {
- if (drag.target.x > headerrow.children[h].x - 10) {
- repeater.targetIndex = header.length - h - 1
- break
- }
- }
- }
- }
-
- onPressed: {
- repeater.dragIndex = index
- draghandle.x = parent.x
- }
-
- onReleased: {
- if (repeater.targetIndex >= 0 && repeater.targetIndex != index ) {
- // Rearrange the header sections
- var items = new Array
- for (var i = 0 ; i< header.length ; ++i)
- items.push(header[i])
- items.splice(index, 1);
- items.splice(repeater.targetIndex, 0, header[index]);
- header = items
- if (sortColumn == index)
- sortColumn = repeater.targetIndex
- }
- repeater.targetIndex = -1
- }
- drag.maximumX: 1000
- drag.minimumX: -1000
- drag.target: draghandle
- }
-
- Loader {
- id: draghandle
- parent: tableColumn
- sourceComponent: root.headerDelegate
- width: header[index].width
- height: parent.height
- property string itemValue: header[index].caption
- property string itemSort: (sortIndicatorVisible && index == sortColumn) ? (sortIndicatorDirection == "up" ? "up" : "down") : "";
- property bool itemPressed: headerClickArea.pressed
- property bool itemContainsMouse: headerClickArea.containsMouse
- visible: headerClickArea.pressed
- opacity: 0.5
- }
-
-
- MouseArea {
- id: headerResizeHandle
- property int offset: 0
- property int minimumSize: 20
- anchors.rightMargin: -width/2
- width: 16 ; height: parent.height
- anchors.right: parent.right
- onPositionChanged: {
- var newHeaderWidth = header[index].width + (mouseX - offset)
- header[index].width = Math.max(minimumSize, newHeaderWidth)
- }
- property bool found:false
-
- onDoubleClicked: {
- var row
- var minWidth = 0
- var listdata = tree.children[0]
- for (row = 0 ; row < listdata.children.length ; ++row){
- var item = listdata.children[row+1]
- if (item && item.children[1] && item.children[1].children[index] &&
- item.children[1].children[index].children[0].hasOwnProperty("implicitWidth"))
- minWidth = Math.max(minWidth, item.children[1].children[index].children[0].implicitWidth)
- }
- if (minWidth)
- header[index].width = minWidth
- }
- onPressedChanged: if(pressed)offset=mouseX
- QStyleItem {
- anchors.fill: parent
- cursor: "splithcursor"
- }
- }
- }
- }
- }
- Loader {
- id: loader
- z:-1
- sourceComponent: root.headerDelegate
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.bottom: headerrow.bottom
- anchors.rightMargin: -2
- width: root.width - headerrow.width
- property string itemValue
- property string itemSort
- property bool itemPressed
- property bool itemContainsMouse
- }
- }
-
- WheelArea {
- id: wheelarea
- anchors.fill: parent
- property int scale: 5
- horizontalMinimumValue: hscrollbar.minimumValue/scale
- horizontalMaximumValue: hscrollbar.maximumValue/scale
- verticalMinimumValue: vscrollbar.minimumValue/scale
- verticalMaximumValue: vscrollbar.maximumValue/scale
-
- verticalValue: contentY/scale
- horizontalValue: contentX/scale
-
- onVerticalValueChanged: {
- if(!tree.blockUpdates) {
- contentY = verticalValue * scale
- vscrollbar.value = contentY
- }
- }
-
- onHorizontalValueChanged: {
- if(!tree.blockUpdates) {
- contentX = horizontalValue * scale
- hscrollbar.value = contentX
- }
- }
- }
-
- ScrollBar {
- id: hscrollbar
- orientation: Qt.Horizontal
- property int availableWidth: root.width - vscrollbar.width
- visible: contentWidth > availableWidth
- maximumValue: contentWidth > availableWidth ? tree.contentWidth - availableWidth : 0
- minimumValue: 0
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.leftMargin: frameWidth
- anchors.bottomMargin: styleitem.frameoffset
- anchors.rightMargin: vscrollbar.visible ? scrollbarExtent : (frame ? 1 : 0)
- onValueChanged: {
- if (!tree.blockUpdates)
- contentX = value
- }
- property int scrollbarExtent : styleitem.pixelMetric("scrollbarExtent");
- }
-
- ScrollBar {
- id: vscrollbar
- orientation: Qt.Vertical
- // We cannot bind directly to tree.height due to binding loops so we have to redo the calculation here
- property int availableHeight : root.height - (hscrollbar.visible ? hscrollbar.height : 0) - tableColumn.height
- visible: contentHeight > availableHeight
- maximumValue: contentHeight > availableHeight ? tree.contentHeight - availableHeight : 0
- minimumValue: 0
- anchors.rightMargin: styleitem.frameoffset
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- anchors.topMargin: styleitem.style == "mac" ? tableColumn.height : 0
- onValueChanged: {
- if(!tree.blockUpdates)
- contentY = value
- }
- anchors.bottomMargin: hscrollbar.visible ? hscrollbar.height : styleitem.frameoffset
-
- Keys.onUpPressed: if (tree.currentIndex > 0) tree.currentIndex = tree.currentIndex - 1
- Keys.onDownPressed: if (tree.currentIndex< tree.count - 1) tree.currentIndex = tree.currentIndex + 1
- }
-
- QStyleItem {
- z: 2
- anchors.fill: parent
- anchors.margins: -4
- visible: highlightOnFocus && parent.activeFocus && styleitem.styleHint("focuswidget")
- elementType: "focusframe"
- }
-
- QStyleItem {
- id: styleitem
- elementType: "header"
- visible:false
- property int frameoffset: style === "mac" ? -1 : 0
- }
- QStyleItem {
- id: rowstyleitem
- elementType: "item"
- visible:false
- property color textColor: styleHint("textColor")
- property color highlightedTextColor: styleHint("highlightedTextColor")
- }
- SystemPalette{id:palette}
-}
diff --git a/lib/qtcreator/qtcomponents/TextArea.qml b/lib/qtcreator/qtcomponents/TextArea.qml
deleted file mode 100644
index de4565e89f..0000000000
--- a/lib/qtcreator/qtcomponents/TextArea.qml
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-ScrollArea {
- id:area
- color: "white"
- width: 280
- height: 120
- contentWidth: 200
-
- property alias text: edit.text
- property alias wrapMode: edit.wrapMode
- property alias readOnly: edit.readOnly
-
- highlightOnFocus: true
- property int documentMargins: 4
- frame: true
-
- Item {
- anchors.left: parent.left
- anchors.top: parent.top
- height: edit.height - 8
- anchors.margins: documentMargins
-
- TextEdit {
- id: edit
- text: loremIpsum + loremIpsum;
- wrapMode: TextEdit.WordWrap;
- width: area.contentWidth
- selectByMouse: true
- readOnly: false
- focus: true
-
- // keep textcursor within scrollarea
- onCursorPositionChanged: {
- if (cursorRectangle.y >= area.contentY + area.height - 1.5*cursorRectangle.height)
- area.contentY = cursorRectangle.y - area.height + 1.5*cursorRectangle.height
- else if (cursorRectangle.y < area.contentY)
- area.contentY = cursorRectangle.y
- }
- }
- }
-
- Keys.onPressed: {
- if (event.key == Qt.Key_PageUp) {
- verticalValue = verticalValue - area.height
- } else if (event.key == Qt.Key_PageDown)
- verticalValue = verticalValue + area.height
- }
-}
diff --git a/lib/qtcreator/qtcomponents/TextField.qml b/lib/qtcreator/qtcomponents/TextField.qml
deleted file mode 100644
index 7740e6a65f..0000000000
--- a/lib/qtcreator/qtcomponents/TextField.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.TextField {
- id: textfield
- minimumWidth: 200
-
- placeholderText: ""
- topMargin: 2
- bottomMargin: 2
- leftMargin: 6
- rightMargin: 6
-
- property string hint
-
- height: backgroundItem.sizeFromContents(200, 25).height
- width: 200
- clip: false
-
- background: QStyleItem {
- anchors.fill: parent
- elementType: "edit"
- sunken: true
- focus: textfield.activeFocus
- hover: containsMouse
- hint: textfield.hint
- }
-
- Item{
- id: focusFrame
- anchors.fill: textfield
- parent: textfield
- visible: framestyle.styleHint("focuswidget")
- QStyleItem {
- id: framestyle
- anchors.margins: -2
- anchors.rightMargin:-4
- anchors.bottomMargin:-4
- anchors.fill: parent
- visible: textfield.activeFocus
- elementType: "focusframe"
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/ToolBar.qml b/lib/qtcreator/qtcomponents/ToolBar.qml
deleted file mode 100644
index 9492c505a4..0000000000
--- a/lib/qtcreator/qtcomponents/ToolBar.qml
+++ /dev/null
@@ -1,39 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-QStyleItem{
- id: toolbar
- width: 200
- height: sizeFromContents(32, 32).height
- elementType: "toolbar"
-}
-
diff --git a/lib/qtcreator/qtcomponents/ToolButton.qml b/lib/qtcreator/qtcomponents/ToolButton.qml
deleted file mode 100644
index 64b236059e..0000000000
--- a/lib/qtcreator/qtcomponents/ToolButton.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "custom" as Components
-
-Components.Button {
- id:button
-
- height: 40; //styleitem.sizeFromContents(32, 32).height
- width: 40; //styleitem.sizeFromContents(32, 32).width
-
- QStyleItem {elementType: "toolbutton"; id:styleitem }
-
- background: QStyleItem {
- anchors.fill: parent
- id: styleitem
- elementType: "toolbutton"
- on: pressed | checked
- sunken: pressed
- raised: containsMouse
- hover: containsMouse
-
- Text {
- text: button.text
- anchors.centerIn: parent
- visible: button.iconSource == ""
- }
-
- Image {
- source: button.iconSource
- anchors.centerIn: parent
- opacity: enabled ? 1 : 0.5
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/BasicButton.qml b/lib/qtcreator/qtcomponents/custom/BasicButton.qml
deleted file mode 100644
index 3b09fe3551..0000000000
--- a/lib/qtcreator/qtcomponents/custom/BasicButton.qml
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "./behaviors" // ButtonBehavior
-
-Item {
- id: button
-
- signal clicked
- property alias pressed: behavior.pressed
- property alias containsMouse: behavior.containsMouse
- property alias checkable: behavior.checkable // button toggles between checked and !checked
- property alias checked: behavior.checked
-
- property Component background: null
- property Item backgroundItem: backgroundLoader.item
-
- property color textColor: syspal.text;
- property bool activeFocusOnPress: true
- property string tooltip
-
- signal toolTipTriggered
-
- // implementation
-
- property string __position: "only"
- width: backgroundLoader.item.width
- height: backgroundLoader.item.height
-
- Loader {
- id: backgroundLoader
- anchors.fill: parent
- sourceComponent: background
- property alias styledItem: button
- property alias position: button.__position
- }
-
- ButtonBehavior {
- id: behavior
- anchors.fill: parent
- onClicked: button.clicked()
- onPressedChanged: if (activeFocusOnPress) button.focus = true
- onMouseMoved: {tiptimer.restart()}
- Timer{
- id: tiptimer
- interval:1000
- running:containsMouse && tooltip.length
- onTriggered: button.toolTipTriggered()
- }
- }
-
- SystemPalette { id: syspal }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/Button.qml b/lib/qtcreator/qtcomponents/custom/Button.qml
deleted file mode 100644
index 45a1445d26..0000000000
--- a/lib/qtcreator/qtcomponents/custom/Button.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-BasicButton {
- id: button
-
- property string text
- property url iconSource
- property Component label: null
-
- // implementation
-
- background: defaultStyle.background
- property Item labelItem: labelLoader.item
-
- Loader {
- id: labelLoader
- anchors.fill: parent
- property alias styledItem: button
- sourceComponent: label
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/ButtonColumn.qml b/lib/qtcreator/qtcomponents/custom/ButtonColumn.qml
deleted file mode 100644
index b205a586b1..0000000000
--- a/lib/qtcreator/qtcomponents/custom/ButtonColumn.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import Qt 4.7
-import "ButtonGroup.js" as Behavior
-
-/*
- Class: ButtonColumn
- A ButtonColumn allows you to group Buttons in a column. It provides a selection-behavior as well.
-
- Note: This component don't support the enabled property.
- If you need to disable it you should disable all the buttons inside it.
-
- <code>
- ButtonColumn {
- Button { text: "Top" }
- Button { text: "Bottom" }
- }
- </code>
-*/
-Column {
- id: root
-
- /*
- * Property: exclusive
- * [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
- * in the group will be exclusive.
- *
- * Note that a button in an exclusive group will always be checkable
- */
- property bool exclusive: true
-
- /*
- * Property: checkedButton
- * [string] Contains the last checked Button.
- */
- property Item checkedButton;
-
- Component.onCompleted: {
- Behavior.create(root, {direction: Qt.Vertical});
- }
-
- Component.onDestruction: {
- Behavior.destroy();
- }
-
-}
diff --git a/lib/qtcreator/qtcomponents/custom/ButtonGroup.js b/lib/qtcreator/qtcomponents/custom/ButtonGroup.js
deleted file mode 100644
index 0a56b3cd06..0000000000
--- a/lib/qtcreator/qtcomponents/custom/ButtonGroup.js
+++ /dev/null
@@ -1,137 +0,0 @@
-var self;
-var checkHandlers = [];
-var visibleButtons = [];
-var nonVisibleButtons = [];
-var direction;
-
-function create(that, options) {
- self = that;
- direction = options.direction || Qt.Horizontal;
- self.childrenChanged.connect(rebuild);
-// self.widthChanged.connect(resizeChildren);
- build();
-}
-
-function isButton(item) {
- if (item && item.hasOwnProperty("__position"))
- return true;
- return false;
-}
-
-function hasChecked(item) {
- return (item && item.hasOwnProperty("checked"));
-}
-
-function destroy() {
- self.childrenChanged.disconnect(rebuild);
-// self.widthChanged.disconnect(resizeChildren);
- cleanup();
-}
-
-function build() {
- visibleButtons = [];
- nonVisibleButtons = [];
-
- for (var i = 0, item; (item = self.children[i]); i++) {
- if (!hasChecked(item))
- continue;
-
- item.visibleChanged.connect(rebuild); // Not optimal, but hardly a bottleneck in your app
- if (!item.visible) {
- nonVisibleButtons.push(item);
- continue;
- }
- visibleButtons.push(item);
-
- if (self.exclusive && item.hasOwnProperty("checkable"))
- item.checkable = true;
-
- if (self.exclusive) {
- item.checked = false;
- checkHandlers.push(checkExclusive(item));
- item.checkedChanged.connect(checkHandlers[checkHandlers.length - 1]);
- }
- }
-
- var nrButtons = visibleButtons.length;
- if (nrButtons == 0)
- return;
-
- if (self.checkedButton) {
- self.checkedButton.checked = true;
- } else if (self.exclusive) {
- self.checkedButton = visibleButtons[0];
- self.checkedButton.checked = true;
- }
-
- if (nrButtons == 1) {
- finishButton(visibleButtons[0], "only");
- } else {
- finishButton(visibleButtons[0], direction == Qt.Horizontal ? "leftmost" : "top");
- for (var i = 1; i < nrButtons - 1; i++)
- finishButton(visibleButtons[i], direction == Qt.Horizontal ? "h_middle": "v_middle");
- finishButton(visibleButtons[nrButtons - 1], direction == Qt.Horizontal ? "rightmost" : "bottom");
- }
-}
-
-function finishButton(button, position) {
- if (isButton(button)) {
- button.__position = position;
- if (direction == Qt.Vertical) {
- button.anchors.left = self.left //mm How to make this not cause binding loops? see QTBUG-17162
- button.anchors.right = self.right
- }
- }
-}
-
-function cleanup() {
- visibleButtons.forEach(function(item, i) {
- if (checkHandlers[i])
- item.checkedChanged.disconnect(checkHandlers[i]);
- item.visibleChanged.disconnect(rebuild);
- });
- checkHandlers = [];
-
- nonVisibleButtons.forEach(function(item, i) {
- item.visibleChanged.disconnect(rebuild);
- });
-}
-
-function rebuild() {
- if (self == undefined)
- return;
-
- cleanup();
- build();
-}
-
-function resizeChildren() {
- if (direction != Qt.Horizontal)
- return;
-
- var extraPixels = self.width % visibleButtons;
- var buttonSize = (self.width - extraPixels) / visibleButtons;
- visibleButtons.forEach(function(item, i) {
- if (!item || !item.visible)
- return;
- item.width = buttonSize + (extraPixels > 0 ? 1 : 0);
- if (extraPixels > 0)
- extraPixels--;
- });
-}
-
-function checkExclusive(item) {
- var button = item;
- return function() {
- for (var i = 0, ref; (ref = visibleButtons[i]); i++) {
- if (ref.checked == (button === ref))
- continue;
-
- // Disconnect the signal to avoid recursive calls
- ref.checkedChanged.disconnect(checkHandlers[i]);
- ref.checked = !ref.checked;
- ref.checkedChanged.connect(checkHandlers[i]);
- }
- self.checkedButton = button;
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/ButtonRow.qml b/lib/qtcreator/qtcomponents/custom/ButtonRow.qml
deleted file mode 100644
index aa4fd323af..0000000000
--- a/lib/qtcreator/qtcomponents/custom/ButtonRow.qml
+++ /dev/null
@@ -1,72 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import Qt 4.7
-import "ButtonGroup.js" as Behavior
-
-/*
- Class: ButtonRow
- A ButtonRow allows you to group Buttons in a row. It provides a selection-behavior as well.
-
- Note: This component don't support the enabled property.
- If you need to disable it you should disable all the buttons inside it.
-
- <code>
- ButtonRow {
- Button { text: "Left" }
- Button { text: "Right" }
- }
- </code>
-*/
-Row {
- id: root
-
- /*
- * Property: exclusive
- * [bool=true] Specifies the grouping behavior. If enabled, the checked property on buttons contained
- * in the group will be exclusive.
- *
- * Note that a button in an exclusive group will always be checkable
- */
- property bool exclusive: true
-
- /*
- * Property: checkedButton
- * [string] Contains the last checked Button.
- */
- property Item checkedButton;
-
- Component.onCompleted: {
- Behavior.create(root, {direction: Qt.Horizontal});
- }
-
- Component.onDestruction: {
- Behavior.destroy();
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/CheckBox.qml b/lib/qtcreator/qtcomponents/custom/CheckBox.qml
deleted file mode 100644
index 93449014d6..0000000000
--- a/lib/qtcreator/qtcomponents/custom/CheckBox.qml
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "./behaviors"
-
-Item {
- id: checkBox
-
- signal clicked
- property alias pressed: behavior.pressed
- property alias checked: behavior.checked
- property alias containsMouse: behavior.containsMouse
- property bool activeFocusOnPress: true
- property Component background: null
- property Item backgroundItem: backgroundLoader.item
-
- // implementation
-
- Loader {
- id: backgroundLoader
- anchors.fill: parent
- property alias styledItem: checkBox
- sourceComponent: background
- }
-
- ButtonBehavior {
- id: behavior
- anchors.fill: parent
- checkable: true
- onClicked: {if (activeFocusOnPress)checkBox.focus = true; checkBox.clicked()}
- }
-
- SystemPalette { id: syspal }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/ChoiceList.qml b/lib/qtcreator/qtcomponents/custom/ChoiceList.qml
deleted file mode 100644
index 571ce5fc70..0000000000
--- a/lib/qtcreator/qtcomponents/custom/ChoiceList.qml
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "./private" as Private
-
-Item {
- id: choiceList
-
- property alias model: popup.model
- property alias currentIndex: popup.currentIndex
- property alias currentText: popup.currentText
- property alias popupOpen: popup.popupOpen
- property alias containsMouse: popup.containsMouse
- property alias pressed: popup.buttonPressed
-
- property Component background: null
- property Item backgroundItem: backgroundLoader.item
- property Component listItem: null
- property Component popupFrame: null
-
- property int leftMargin: 0
- property int topMargin: 0
- property int rightMargin: 0
- property int bottomMargin: 0
-
- property string popupBehavior
- width: 0
- height: 0
-
- property bool activeFocusOnPress: true
-
- Loader {
- id: backgroundLoader
- property alias styledItem: choiceList
- sourceComponent: background
- anchors.fill: parent
- property string currentItemText: model.get(currentIndex)
- }
-
- Private.ChoiceListPopup {
- // NB: This ChoiceListPopup is also the mouse area
- // for the component (to enable drag'n'release)
- id: popup
- listItem: choiceList.listItem
- popupFrame: choiceList.popupFrame
- }
-
- Keys.onSpacePressed: { choiceList.popupOpen = !choiceList.popupOpen }
- Keys.onUpPressed: { if (currentIndex < model.count - 1) currentIndex++ }
- Keys.onDownPressed: {if (currentIndex > 0) currentIndex-- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/GroupBox.qml b/lib/qtcreator/qtcomponents/custom/GroupBox.qml
deleted file mode 100644
index db4250bdfe..0000000000
--- a/lib/qtcreator/qtcomponents/custom/GroupBox.qml
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-FocusScope {
- id: groupbox
-
- width: Math.max(200, contentWidth + loader.leftMargin + loader.rightMargin)
- height: contentHeight + loader.topMargin + loader.bottomMargin
-
- default property alias children: content.children
-
- property string title
- property bool checkable: false
- property int contentWidth: content.childrenRect.width
- property int contentHeight: content.childrenRect.height
- property double contentOpacity: 1
-
- property Component background: null
- property Item backgroundItem: loader.item
-
- property CheckBox checkbox: check
- property alias checked: check.checked
-
- Loader {
- id: loader
- anchors.fill: parent
- property int topMargin: 22
- property int bottomMargin: 4
- property int leftMargin: 4
- property int rightMargin: 4
-
- property alias styledItem: groupbox
- sourceComponent: background
-
- Item {
- id:content
- z: 1
- opacity: contentOpacity
- anchors.topMargin: loader.topMargin
- anchors.leftMargin: 8
- anchors.top:parent.top
- anchors.left:parent.left
- enabled: (!checkable || checkbox.checked)
- }
-
- CheckBox {
- id: check
- checked: true
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- height: loader.topMargin
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/ProgressBar.qml b/lib/qtcreator/qtcomponents/custom/ProgressBar.qml
deleted file mode 100644
index 73323993cd..0000000000
--- a/lib/qtcreator/qtcomponents/custom/ProgressBar.qml
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-Item {
- id: progressBar
-
- property real value: 0
- property real minimumValue: 0
- property real maximumValue: 1
- property bool indeterminate: false
- property bool containsMouse: mouseArea.containsMouse
-
- property int leftMargin: 0
- property int topMargin: 0
- property int rightMargin: 0
- property int bottomMargin: 0
-
- property int minimumWidth: 0
- property int minimumHeight: 0
-
- width: minimumWidth
- height: minimumHeight
-
- property Component background: null
- property Item backgroundItem: groove.item
-
- property color backgroundColor: syspal.base
- property color progressColor: syspal.highlight
-
- Loader {
- id: groove
- property alias indeterminate:progressBar.indeterminate
- property alias value:progressBar.value
- property alias maximumValue:progressBar.maximumValue
- property alias minimumValue:progressBar.minimumValue
-
- sourceComponent: background
- anchors.fill: parent
- }
-
- Item {
- anchors.fill: parent
- anchors.leftMargin: leftMargin
- anchors.rightMargin: rightMargin
- anchors.topMargin: topMargin
- anchors.bottomMargin: bottomMargin
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/Slider.qml b/lib/qtcreator/qtcomponents/custom/Slider.qml
deleted file mode 100644
index 1f6d94660a..0000000000
--- a/lib/qtcreator/qtcomponents/custom/Slider.qml
+++ /dev/null
@@ -1,289 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "../"
-
-Item {
- id: slider
-
- // COMMON API
- property int orientation: Qt.Horizontal
- property alias minimumValue: range.minimumValue
- property alias maximumValue: range.maximumValue
- property alias inverted: range.inverted
- property bool updateValueWhileDragging: true
- property alias pressed: mouseArea.pressed
- property alias stepSize: range.stepSize
- property alias hoverEnabled: mouseArea.hoverEnabled
-
- // NOTE: this property is in/out, the user can set it, create bindings to it, and
- // at the same time the slider wants to update. There's no way in QML to do this kind
- // of updates AND allow the user bind it (without a Binding object). That's the
- // reason this is an alias to a C++ property in range model.
- property alias value: range.value
- property bool containsMouse: mouseArea.containsMouse
-
- // CONVENIENCE TO BE USED BY STYLES
-
- property int leftMargin: 0
- property int rightMargin: 0
-
- // EXTENSIONS
- // Indicate that we want animations in the Slider, people customizing should
- // look at it to decide whether or not active animations.
- property bool animated: true
- property bool activeFocusOnPress: true
-
- // Value indicator displays the current value near the slider
- property bool valueIndicatorVisible: true
- property int valueIndicatorMargin: 10
- property string valueIndicatorPosition: _isVertical ? "Left" : "Top"
-
- // Reimplement this function to control how the value is shown in the
- // indicator.
- function formatValue(v) {
- return Math.round(v);
- }
-
- // Hooks for customizing the pieces of the slider
- property Component groove: null
- property Component handle: null
- property Component valueIndicator: null
-
- // PRIVATE/CONVENIENCE
- property bool _isVertical: orientation == Qt.Vertical
-
- // This is a template slider, so every piece can be modified by passing a
- // different Component. The main elements in the implementation are
- //
- // - the 'range' does the calculations to map position to/from value,
- // it also serves as a data storage for both properties;
- //
- // - the 'fakeHandle' is what the mouse area drags on the screen, it feeds
- // the 'range' position and also reads it when convenient;
- //
- // - the real 'handle' it is the visual representation of the handle, that
- // just follows the 'fakeHandle' position.
- //
- // When the 'updateValueWhileDragging' is false and we are dragging, we stop
- // feeding the range with position information, delaying until the next
- // mouse release.
- //
- // Everything is encapsulated in a contents Item, so for the
- // vertical slider, we just swap the height/width, make it
- // horizontal, and then use rotation to make it vertical again.
-
- Item {
- id: contents
-
- width: _isVertical ? slider.height : slider.width
- height: _isVertical ? slider.width : slider.height
- rotation: _isVertical ? -90 : 0
-
- anchors.centerIn: slider
-
- RangeModel {
- id: range
- minimumValue: 0.0
- maximumValue: 1.0
- value: 0
- stepSize: 0.0
- inverted: false
-
- positionAtMinimum: leftMargin
- positionAtMaximum: contents.width - rightMargin
- }
-
- Loader {
- id: grooveLoader
- anchors.fill: parent
- sourceComponent: groove
-
- property real handlePosition : handleLoader.x
- function positionForValue(value) {
- return range.positionForValue(value) - leftMargin;
- }
- }
-
- Loader {
- id: handleLoader
- transform: Translate { x: - handleLoader.width / 2 }
-
- anchors.verticalCenter: grooveLoader.verticalCenter
-
- sourceComponent: handle
-
- x: fakeHandle.x
- Behavior on x {
- id: behavior
- enabled: !mouseArea.drag.active && slider.animated
-
- PropertyAnimation {
- duration: behavior.enabled ? 150 : 0
- easing.type: Easing.OutSine
- }
- }
- }
-
- Item {
- id: fakeHandle
- width: handleLoader.width
- height: handleLoader.height
- transform: Translate { x: - handleLoader.width / 2 }
- }
-
- MouseArea {
- id: mouseArea
- hoverEnabled: true
- anchors.centerIn: parent
- anchors.horizontalCenterOffset: (slider.leftMargin - slider.rightMargin) / 2
-
- width: parent.width + handleLoader.width - slider.rightMargin - slider.leftMargin
- height: parent.height
-
- drag.target: fakeHandle
- drag.axis: Drag.XAxis
- drag.minimumX: range.positionAtMinimum
- drag.maximumX: range.positionAtMaximum
-
- onPressed: {
-
- if (activeFocusOnPress)
- slider.focus = true;
-
- // Clamp the value
- var newX = Math.max(mouse.x, drag.minimumX);
- newX = Math.min(newX, drag.maximumX);
-
- // Debounce the press: a press event inside the handler will not
- // change its position, the user needs to drag it.
-
- // Note this really messes up things for scrollbar
- // if (Math.abs(newX - fakeHandle.x) > handleLoader.width / 2)
- range.position = newX;
- }
-
- onReleased: {
- // If we don't update while dragging, this is the only
- // moment that the range is updated.
- if (!slider.updateValueWhileDragging)
- range.position = fakeHandle.x;
- }
- }
-
- Loader {
- id: valueIndicatorLoader
-
- transform: Translate { x: - handleLoader.width / 2 }
- rotation: _isVertical ? 90 : 0
- visible: valueIndicatorVisible
-
- // Properties available for the delegate component. Note that the indicatorText
- // shows the value for the position the handle is, which is not necessarily the
- // available as the current slider.value, since updateValueWhileDragging can
- // be set to 'false'.
- property string indicatorText: slider.formatValue(range.valueForPosition(handleLoader.x))
- property bool dragging: mouseArea.drag.active
-
- sourceComponent: valueIndicator
-
- state: {
- if (!_isVertical)
- return slider.valueIndicatorPosition;
-
- if (valueIndicatorPosition == "Right")
- return "Bottom";
- if (valueIndicatorPosition == "Top")
- return "Right";
- if (valueIndicatorPosition == "Bottom")
- return "Left";
-
- return "Top";
- }
-
- anchors.margins: valueIndicatorMargin
-
- states: [
- State {
- name: "Top"
- AnchorChanges {
- target: valueIndicatorLoader
- anchors.bottom: handleLoader.top
- anchors.horizontalCenter: handleLoader.horizontalCenter
- }
- },
- State {
- name: "Bottom"
- AnchorChanges {
- target: valueIndicatorLoader
- anchors.top: handleLoader.bottom
- anchors.horizontalCenter: handleLoader.horizontalCenter
- }
- },
- State {
- name: "Right"
- AnchorChanges {
- target: valueIndicatorLoader
- anchors.left: handleLoader.right
- anchors.verticalCenter: handleLoader.verticalCenter
- }
- },
- State {
- name: "Left"
- AnchorChanges {
- target: valueIndicatorLoader
- anchors.right: handleLoader.left
- anchors.verticalCenter: handleLoader.verticalCenter
- }
- }
- ]
- }
- }
-
- // Range position normally follow fakeHandle, except when
- // 'updateValueWhileDragging' is false. In this case it will only follow
- // if the user is not pressing the handle.
- Binding {
- when: updateValueWhileDragging || !mouseArea.pressed
- target: range
- property: "position"
- value: fakeHandle.x
- }
-
- // During the drag, we simply ignore position set from the range, this
- // means that setting a value while dragging will not "interrupt" the
- // dragging activity.
- Binding {
- when: !mouseArea.drag.active
- target: fakeHandle
- property: "x"
- value: range.position
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/SpinBox.qml b/lib/qtcreator/qtcomponents/custom/SpinBox.qml
deleted file mode 100644
index aa67c6e8ed..0000000000
--- a/lib/qtcreator/qtcomponents/custom/SpinBox.qml
+++ /dev/null
@@ -1,193 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-FocusScope {
- id: spinbox
- SystemPalette{id:syspal}
-
- property int minimumWidth: 0
- property int minimumHeight: 0
-
- property int leftMargin: 0
- property int topMargin: 0
- property int rightMargin: 0
- property int bottomMargin: 0
-
- width: Math.max(minimumWidth,
- input.width + leftMargin + rightMargin)
-
- height: Math.max(minimumHeight,
- input.height + topMargin + bottomMargin)
-
- property real value: 0.0
- property real maximumValue: 99
- property real minimumValue: 0
- property real singleStep: 1
- property string postfix
-
- property bool upEnabled: value != maximumValue;
- property bool downEnabled: value != minimumValue;
- property alias upPressed: mouseUp.pressed
- property alias downPressed: mouseDown.pressed
- property alias upHovered: mouseUp.containsMouse
- property alias downHovered: mouseDown.containsMouse
- property alias containsMouse: mouseArea.containsMouse
- property color textColor: syspal.text
- property alias font: input.font
-
- property Component background: null
- property Item backgroundItem: backgroundComponent.item
- property Component up: null
- property Component down: null
-
- QtObject {
- id: componentPrivate
- property bool valueUpdate: false
- }
-
- function increment() {
- setValue(input.text)
- value += singleStep
- if (value > maximumValue)
- value = maximumValue
- input.text = value
- }
-
- function decrement() {
- setValue(input.text)
- value -= singleStep
- if (value < minimumValue)
- value = minimumValue
- input.text = value
- }
-
- function setValue(v) {
- var newval = parseFloat(v)
- if (newval > maximumValue)
- newval = maximumValue
- else if (v < minimumValue)
- newval = minimumValue
- value = newval
- input.text = value
- }
-
- Component.onCompleted: setValue(value)
-
- onValueChanged: {
- componentPrivate.valueUpdate = true
- input.text = value
- componentPrivate.valueUpdate = false
- }
-
- // background
- Loader {
- id: backgroundComponent
- anchors.fill: parent
- sourceComponent: background
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- }
-
- TextInput {
- id: input
-
- font.pixelSize: 14
- anchors.margins: 5
- anchors.leftMargin: leftMargin
- anchors.topMargin: topMargin
- anchors.rightMargin: rightMargin
- anchors.bottomMargin: bottomMargin
- anchors.fill: parent
- selectByMouse: true
-
- // validator: DoubleValidator { bottom: minimumValue; top: maximumValue; }
- onAccepted: {setValue(input.text)}
- onActiveFocusChanged: setValue(input.text)
- color: textColor
- opacity: parent.enabled ? 1 : 0.5
- Text {
- text: postfix
- anchors.rightMargin: 4
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- }
- }
-
- Loader {
- id: upButton
- property alias pressed : spinbox.upPressed
- property alias hover : spinbox.upHovered
- property alias enabled : spinbox.upEnabled
- sourceComponent: up
- MouseArea {
- id: mouseUp
- anchors.fill: upButton.item
- onClicked: increment()
-
- property bool autoincrement: false;
- onReleased: autoincrement = false
- Timer { running: mouseUp.pressed; interval: 350 ; onTriggered: mouseUp.autoincrement = true }
- Timer { running: mouseUp.autoincrement; interval: 60 ; repeat: true ; onTriggered: increment() }
- }
- onLoaded: {
- item.parent = spinbox
- mouseUp.parent = item
- }
- }
-
- Loader {
- id: downButton
- property alias pressed : spinbox.downPressed
- property alias hover : spinbox.downHovered
- property alias enabled : spinbox.downEnabled
- sourceComponent: down
- MouseArea {
- id: mouseDown
- anchors.fill: downButton.item
- onClicked: decrement()
-
- property bool autoincrement: false;
- onReleased: autoincrement = false
- Timer { running: mouseDown.pressed; interval: 350 ; onTriggered: mouseDown.autoincrement = true }
- Timer { running: mouseDown.autoincrement; interval: 60 ; repeat: true ; onTriggered: decrement() }
- }
- onLoaded: {
- item.parent = spinbox
- mouseDown.parent = item
- }
- }
- Keys.onUpPressed: increment()
- Keys.onDownPressed: decrement()
-}
diff --git a/lib/qtcreator/qtcomponents/custom/SplitterRow.qml b/lib/qtcreator/qtcomponents/custom/SplitterRow.qml
deleted file mode 100644
index f0ac9838fe..0000000000
--- a/lib/qtcreator/qtcomponents/custom/SplitterRow.qml
+++ /dev/null
@@ -1,357 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "private"
-
-/*
-*
-* SplitterRow
-*
-* SplitterRow is a component that provides a way to layout items horisontally with
-* a draggable splitter added in-between each item.
-*
-* Add items to the SplitterRow by inserting them as child items. The splitter handle
-* is outsourced as a delegate (handleBackground). For this delegate to work properly,
-* it will need to contain a mouse area that communicates with the SplitterRow by binding
-* 'onMouseXChanged: handleDragged(handleIndex)', and 'drag.target: dragTarget'.
-*
-* The SplitterRow contains the followin API:
-*
-* Component handleBackground - delegate that will be instanciated between each
-* child item. Inside the delegate, the following properties are available:
-* int handleIndex - specifies the index of the splitter handle. The handle
-* between the first and the second item will get index 0, the next handle index 1 etc.
-* Item handleDragTarget - convenience property that tells which drag target any
-* inner mouse areas that controls the handle should bind to.
-* function handleDragged(handleIndex) - function that should be called whenever
-* the handle is dragged to a new position
-*
-* The following properties can optionally be added for each direct child item of SplitterRow:
-*
-* real minimumWidth - if present, ensures that the item cannot be resized below the
-* given value. A value of -1 will disable it.
-* real maximumWidth - if present, ensures that the item cannot be resized above the
-* given value. A value of -1 will disable it.
-* real percentageWidth - if present, should be a value between 0-100. This value specifies
-* a percentage of the width of the SplitterRow width. If the width of the SplitterRow
-* change, the width of the item will change as well. 'percentageWidth' have precedence
-* over 'width', which means that SplitterRow will ignore any assignments done to 'width'.
-* A value of -1 disables it.
-* bool expanding - if present, the item will consume all extra space in the SplitterRow, down to
-* minimumWidth. This means that that 'width', 'percentageWidth' and 'maximumWidth' will be ignored.
-* There will always be one (and only one) item in the SplitterRow that has this behaviour, and by
-* default, it will be the last child item of the SplitterRow. Also note that which item that gets
-* resized upon dragging a handle depends on whether the expanding item is located towards the left
-* or the right of the handle.
-*
-* Example:
-*
-* To create a SplitterRow with three items, and let
-* the center item be the one that should be expanding, one
-* could do the following:
-*
-* SplitterRow {
-* anchors.fill: parent
-*
-* handleBackground: Rectangle {
-* width: 1
-* color: "black"
-*
-* MouseArea {
-* anchors.fill: parent
-* anchors.leftMargin: -2
-* anchors.rightMargin: -2
-* drag.axis: Qt.YAxis
-* drag.target: handleDragTarget
-* onMouseXChanged: handleDragged(handleIndex)
-* }
-* }
-*
-* Rectangle {
-* color: "gray"
-* width: 200
-* }
-* Rectangle {
-* property real minimumWidth: 50
-* property real maximumWidth: 400
-* property bool expanding: true
-* color: "darkgray"
-* }
-* Rectangle {
-* color: "gray"
-* width: 200
-* }
-* }
-*/
-
-Item {
- id: root
- default property alias items: splitterItems.children
- property alias handles: splitterHandles.children
- property Component handleBackground: Rectangle { width:3; color: "black" }
- clip: true
-
- Component.onCompleted: d.init();
- onWidthChanged: d.updateLayout();
-
- QtObject {
- id: d
- property int expandingIndex: items.length-1
- property bool updateOptimizationBlock: true
- property bool bindingRecursionGuard: false
-
- function init()
- {
- for (var i=0; i<items.length-1; ++i) {
- // Anchor each item to fill out all space vertically:
- var item = items[i];
- item.anchors.top = splitterItems.top
- item.anchors.bottom = splitterItems.bottom
- // Listen for changes to width and expanding:
- propertyChangeListener.createObject(item);
- // Create a handle for the item:
- var handle = handleBackgroundLoader.createObject(splitterHandles, {"handleIndex":i});
- handle.anchors.top = splitterHandles.top
- handle.anchors.bottom = splitterHandles.bottom
- }
- item = items[i]
- if (item) {
- // Do the same for the last item as well, since
- // the for-loop skipped the last item:
- items[i].anchors.top = splitterItems.top
- items[i].anchors.bottom = splitterItems.bottom
- propertyChangeListener.createObject(items[i]);
- }
- d.updateOptimizationBlock = false
- d.updateLayout()
- }
-
- function accumulatedWidth(firstIndex, lastIndex, includeExpandingMinimum)
- {
- // Go through items and handles, and
- // calculate their acummulated width.
- var w = 0
- for (var i=firstIndex; i<lastIndex; ++i) {
- var item = items[i]
- if (i !== d.expandingIndex)
- w += item.width;
- else if (includeExpandingMinimum && item.minimumWidth != undefined && item.minimumWidth != -1)
- w += item.minimumWidth
- if (handles[i] && (i !== d.expandingIndex || includeExpandingMinimum === false))
- w += handles[i].width
- }
- return w
- }
-
- function updateLayout()
- {
- if (items.length === 0)
- return;
- if (d.updateOptimizationBlock === true)
- return
- d.updateOptimizationBlock = true
-
- // This function will reposition both handles and
- // items according to the _width of the each item_
- var item, prevItem
- var handle, prevHandle
- var newValue
-
- // Ensure all items within min/max:
- for (var i=0; i<items.length; ++i) {
- if (i !== d.expandingIndex) {
- item = items[i];
- // If the item is using percentage width, convert
- // that number to real width now:
- if (item.percentageWidth != undefined && item.percentageWidth !== -1) {
- newValue = item.percentageWidth * (root.width / 100)
- if (newValue !== item.width)
- item.width = newValue
- }
- // Ensure item width is not more than maximumWidth:
- if (item.maximumWidth != undefined && item.maximumWidth != -1) {
- newValue = Math.min(item.width, item.maximumWidth)
- if (newValue !== item.width)
- item.width = newValue
- }
- // Ensure item width is not more less minimumWidth:
- if (item.minimumWidth != undefined && item.minimumWidth != -1) {
- newValue = Math.max(item.width, item.minimumWidth)
- if (newValue !== item.width)
- item.width = newValue
- }
- }
- }
-
- // Special case: set width of expanding item to available space:
- newValue = root.width - d.accumulatedWidth(0, items.length, false);
- var expandingItem = items[d.expandingIndex]
- if (expandingItem.minimumWidth != undefined && expandingItem.minimumWidth != -1)
- newValue = Math.max(newValue, expandingItem.minimumWidth)
- if (expandingItem.width !== newValue)
- expandingItem.width = newValue
-
- // Then, position items and handles according to their width:
- for (i=0; i<items.length; ++i) {
- item = items[i];
- handle = handles[i]
-
- // Position item to the right of the previus handle:
- if (prevHandle) {
- newValue = prevHandle.x + prevHandle.width
- if (newValue !== item.x)
- item.x = newValue
- }
-
- // Position handle to the right of item:
- if (handle) {
- newValue = item.x + Math.max(0, item.width)
- if (newValue !== handle.x)
- handle.x = newValue
- }
-
- prevItem = item
- prevHandle = handle
- }
-
- d.updateOptimizationBlock = false
- }
- }
-
- Component {
- id: handleBackgroundLoader
- Loader {
- id: loader
- property int handleIndex: 0
- property Item handleDragTarget: loader
- sourceComponent: handleBackground
-
- function handleDragged(handleIndex)
- {
- // Moving the handle means resizing an item. Which one,
- // left or right, depends on where the expanding item is.
- // 'updateLayout' will override in case new width violates max/min.
- // And 'updateLayout will be triggered when an item changes width.
-
- var leftHandle, leftItem, handle, rightItem, rightHandle
- var leftEdge, rightEdge, newWidth
-
- handle = handles[handleIndex]
-
- if (d.expandingIndex > handleIndex) {
- // Resize item to the left.
- // Ensure that the handle is not crossing other handles:
- leftHandle = handles[handleIndex-1]
- leftItem = items[handleIndex]
- leftEdge = leftHandle ? (leftHandle.x + leftHandle.width) : 0
- handle.x = Math.max(leftEdge, handle.x)
- newWidth = handle.x - leftEdge
- if (root.width != 0 && leftItem.percentageWidth != undefined && leftItem.percentageWidth !== -1)
- leftItem.percentageWidth = newWidth * (100 / root.width)
- // The next line will trigger 'updateLayout' inside 'propertyChangeListener':
- leftItem.width = newWidth
- } else {
- // Resize item to the right:
- // Since the first item in the splitter always will have x=0, we need
- // to ensure that the user cannot drag the handle more left than what
- // we got space for:
- var min = d.accumulatedWidth(0, handleIndex+1, true)
- // Ensure that the handle is not crossing other handles:
- rightItem = items[handleIndex+1]
- rightHandle = handles[handleIndex+1]
- rightEdge = (rightHandle ? rightHandle.x : root.width)
- handle.x = Math.max(min, Math.max(Math.min((rightEdge - handle.width), handle.x)))
- newWidth = rightEdge - (handle.x + handle.width)
- if (root.width != 0 && rightItem.percentageWidth != undefined && rightItem.percentageWidth !== -1)
- rightItem.percentageWidth = newWidth * (100 / root.width)
- // The next line will trigger 'updateLayout' inside 'propertyChangeListener':
- rightItem.width = newWidth
- }
- }
- }
- }
-
- Item {
- id: splitterItems
- anchors.fill: parent
- }
- Item {
- id: splitterHandles
- anchors.fill: parent
- }
-
- Component {
- // This dummy item becomes a child of all
- // items it the splitter, just to provide a way
- // to listed for changes to their width, expanding etc.
- id: propertyChangeListener
- Item {
- id: target
- width: parent.width
- property bool expanding: (parent.expanding != undefined) ? parent.expanding : false
- property real percentageWidth: (parent.percentageWidth != undefined) ? parent.percentageWidth : -1
- property real minimumWidth: (parent.minimumWidth != undefined) ? parent.minimumWidth : -1
- property real maximumWidth: (parent.maximumWidth != undefined) ? parent.maximumWidth : -1
-
- onPercentageWidthChanged: d.updateLayout();
- onMinimumWidthChanged: d.updateLayout();
- onMaximumWidthChanged: d.updateLayout();
-
- onExpandingChanged: {
- // Find out which item that has the expanding flag:
- for (var i=0; i<items.length; ++i) {
- var item = items[i]
- if (item.expanding && item.expanding === true) {
- d.expandingIndex = i
- d.updateLayout();
- return
- }
- }
- d.expandingIndex = i-1
- updateLayout();
- }
-
- onWidthChanged: {
- // We need to update the layout:
- if (d.bindingRecursionGuard === true)
- return
- d.bindingRecursionGuard = true
-
- // Break binding:
- width = 0
- d.updateLayout()
- // Restablish binding:
- width = function() { return parent.width; }
-
- d.bindingRecursionGuard = false
- }
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/TextField.qml b/lib/qtcreator/qtcomponents/custom/TextField.qml
deleted file mode 100644
index 473cb5db1a..0000000000
--- a/lib/qtcreator/qtcomponents/custom/TextField.qml
+++ /dev/null
@@ -1,155 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-import "./behaviors" // TextEditMouseBehavior
-
-// KNOWN ISSUES
-// 1) TextField does not loose focus when !enabled if it is a FocusScope (see QTBUG-16161)
-
-FocusScope {
- id: textField
-
- property alias text: textInput.text
- property alias font: textInput.font
-
- property int inputHint // values tbd
- property bool acceptableInput: textInput.acceptableInput // read only
- property bool readOnly: textInput.readOnly // read only
- property alias placeholderText: placeholderTextComponent.text
- property bool passwordMode: false
- property alias selectedText: textInput.selectedText
- property alias selectionEnd: textInput.selectionEnd
- property alias selectionStart: textInput.selectionStart
- property alias validator: textInput.validator
- property alias inputMask: textInput.inputMask
- property alias horizontalalignment: textInput.horizontalAlignment
- property alias echoMode: textInput.echoMode
- property alias cursorPosition: textInput.cursorPosition
- property alias inputMethodHints: textInput.inputMethodHints
-
- property color textColor: syspal.text
- property color backgroundColor: syspal.base
- property alias containsMouse: mouseArea.containsMouse
-
- property Component background: null
- property Component hints: null
- property Item backgroundItem: backgroundLoader.item
-
- property int minimumWidth: 0
- property int minimumHeight: 0
-
- property int leftMargin: 0
- property int topMargin: 0
- property int rightMargin: 0
- property int bottomMargin: 0
-
- function copy() {
- textInput.copy()
- }
-
- function paste() {
- textInput.paste()
- }
-
- function cut() {
- textInput.cut()
- }
-
- function select(start, end) {
- textInput.select(start, end)
- }
-
- function selectAll() {
- textInput.selectAll()
- }
-
- function selectWord() {
- textInput.selectWord()
- }
-
- function positionAt(x) {
- var p = mapToItem(textInput, x, 0);
- return textInput.positionAt(p.x);
- }
-
- function positionToRectangle(pos) {
- var p = mapToItem(textInput, pos.x, pos.y);
- return textInput.positionToRectangle(p);
- }
-
- width: Math.max(minimumWidth,
- textInput.width + leftMargin + rightMargin)
-
- height: Math.max(minimumHeight,
- textInput.height + topMargin + bottomMargin)
-
- // Implementation
- clip: true
-
- SystemPalette { id: syspal }
- Loader { id: hintsLoader; sourceComponent: hints }
- Loader { id: backgroundLoader; sourceComponent: background; anchors.fill:parent}
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- }
-
- TextInput { // see QTBUG-14936
- id: textInput
- selectByMouse:true
- font.pixelSize: hintsLoader.item != null ? hintsLoader.item.fontPixelSize: 14
- font.bold: hintsLoader.item != null ? hintsLoader.item.fontBold : false
-
- anchors.leftMargin: leftMargin
- anchors.topMargin: topMargin
- anchors.rightMargin: rightMargin
- anchors.bottomMargin: bottomMargin
-
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
-
- color: enabled ? textColor : Qt.tint(textColor, "#80ffffff")
- echoMode: passwordMode ? _hints.passwordEchoMode : TextInput.Normal
- }
-
- Text {
- id: placeholderTextComponent
- anchors.fill: textInput
- font: textInput.font
- opacity: !textInput.text.length && !textInput.activeFocus ? 1 : 0
- color: "gray"
- text: "Enter text"
- elide: Text.ElideRight
- Behavior on opacity { NumberAnimation { duration: 90 } }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/behaviors/ButtonBehavior.qml b/lib/qtcreator/qtcomponents/custom/behaviors/ButtonBehavior.qml
deleted file mode 100644
index 10d959466d..0000000000
--- a/lib/qtcreator/qtcomponents/custom/behaviors/ButtonBehavior.qml
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-Item {
- id: behavior
-
- signal clicked
- property bool pressed: false // Can't be alias of mouseArea.pressed because the latter is read-only
- property alias containsMouse: mouseArea.containsMouse
- property bool checkable: false
- property bool checked: false
- property bool triState: false
- signal mouseMoved
-
- onCheckableChanged: { if(!checkable) checked = false }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- hoverEnabled: true
- onPositionChanged: behavior.mouseMoved()
- onPressed: behavior.pressed = true // needed when hover is enabled
- onEntered: if(pressed && enabled) behavior.pressed = true
- onExited: behavior.pressed = false
- onCanceled: behavior.pressed = false // mouse stolen e.g. by Flickable
- onReleased: {
- if(behavior.pressed && behavior.enabled) { // No click if release outside area
- behavior.pressed = false
- if(behavior.checkable)
- behavior.checked = !behavior.checked;
- behavior.clicked()
- }
- }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/custom/behaviors/ModalPopupBehavior.qml b/lib/qtcreator/qtcomponents/custom/behaviors/ModalPopupBehavior.qml
deleted file mode 100644
index 9e32d70a1b..0000000000
--- a/lib/qtcreator/qtcomponents/custom/behaviors/ModalPopupBehavior.qml
+++ /dev/null
@@ -1,119 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-// KNOWN ISSUES
-// none
-
-Item {
- id: popupBehavior
-
- property bool showing: false
- property bool whenAlso: true // modifier to the "showing" property
- property bool consumeCancelClick: true
- property int delay: 0 // delay before popout becomes visible
- property int deallocationDelay: 3000 // 3 seconds
-
- property Component popupComponent
-
- property alias popup: popupLoader.item // read-only
- property alias window: popupBehavior.root // read-only
-
- signal prepareToShow
- signal prepareToHide
- signal cancelledByClick
-
- // implementation
-
- anchors.fill: parent
-
- onShowingChanged: notifyChange()
- onWhenAlsoChanged: notifyChange()
- function notifyChange() {
- if(showing && whenAlso) {
- if(popupLoader.sourceComponent == undefined) {
- popupLoader.sourceComponent = popupComponent;
- }
- } else {
- mouseArea.enabled = false; // disable before opacity is changed in case it has fading behavior
- if(Qt.isQtObject(popupLoader.item)) {
- popupBehavior.prepareToHide();
- popupLoader.item.opacity = 0;
- }
- }
- }
-
- property Item root: findRoot()
- function findRoot() {
- var p = parent;
- while(p.parent != undefined)
- p = p.parent;
-
- return p;
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- enabled: false // enabled only when popout is showing
- onPressed: {
- popupBehavior.showing = false;
- mouse.accepted = consumeCancelClick;
- cancelledByClick();
- }
- }
-
- Loader {
- id: popupLoader
- }
-
- Timer { // visibility timer
- running: Qt.isQtObject(popupLoader.item) && showing && whenAlso
- interval: delay
- onTriggered: {
- popupBehavior.prepareToShow();
- mouseArea.enabled = true;
- popup.opacity = 1;
- }
- }
-
- Timer { // deallocation timer
- running: Qt.isQtObject(popupLoader.item) && popupLoader.item.opacity == 0
- interval: deallocationDelay
- onTriggered: popupLoader.sourceComponent = undefined
- }
-
- states: State {
- name: "active"
- when: Qt.isQtObject(popupLoader.item) && popupLoader.item.opacity > 0
- ParentChange { target: popupBehavior; parent: root }
- }
- }
-
diff --git a/lib/qtcreator/qtcomponents/custom/components.pro b/lib/qtcreator/qtcomponents/custom/components.pro
deleted file mode 100644
index 0b08d23b92..0000000000
--- a/lib/qtcreator/qtcomponents/custom/components.pro
+++ /dev/null
@@ -1,41 +0,0 @@
-TEMPLATE = subdirs # XXX: Avoid call the linker
-TARGETPATH = Qt/labs/components/custom
-
-INSTALL_IMPORTS = $$[QT_INSTALL_IMPORTS]
-
-QML_FILES = \
- qmldir \
- BasicButton.qml \
- BusyIndicator.qml \
- ButtonBlock.qml \
- ButtonColumn.qml \
- ButtonRow.qml \
- ButtonGroup.js \
- Button.qml \
- CheckBox.qml \
- ChoiceList.qml \
- ProgressBar.qml \
- RadioButton.qml \
- ScrollDecorator.qml \
- ScrollIndicator.qml \
- Slider.qml \
- SpinBox.qml \
- Switch.qml \
- TextArea.qml \
- TextField.qml
-
-QML_DIRS = \
- behaviors \
- private \
- styles \
- visuals
-
-qmlfiles.files = $$QML_FILES
-lessThan(QT_MAJOR_VERSION, 5):qmlfiles.sources = $$QML_FILES
-qmlfiles.path = $$INSTALL_IMPORTS/$$TARGETPATH
-
-qmldirs.files = $$QML_DIRS
-lessThan(QT_MAJOR_VERSION, 5):qmldirs.sources = $$QML_DIRS
-qmldirs.path = $$INSTALL_IMPORTS/$$TARGETPATH
-
-INSTALLS += qmlfiles qmldirs
diff --git a/lib/qtcreator/qtcomponents/custom/private/ChoiceListPopup.qml b/lib/qtcreator/qtcomponents/custom/private/ChoiceListPopup.qml
deleted file mode 100644
index ec0d2567c1..0000000000
--- a/lib/qtcreator/qtcomponents/custom/private/ChoiceListPopup.qml
+++ /dev/null
@@ -1,352 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-import QtQuick 1.0
-
-MouseArea {
- id: popup
-
- // There is no global z-ordering that can stack this popup in front, so we
- // need to reparent it to the root item to fake it upon showing the popup.
- // In that case, the popup will also fill the whole window to allow the user to
- // close the popup by clicking anywhere in the window. Letting the popup act as the mouse
- // area for the button that 'owns' it is also necessary to support drag'n'release behavior.
-
- // The 'popupframe' delegate will be told to show or hide by assigning
- // opacity to 1 or 0, respectively.
-
- anchors.fill: parent
- hoverEnabled: true
-
-
-
- // Set 'popupOpen' to show/hide the popup. The 'state' property is more
- // internal, and contains additional states used to protect the popup from
- // e.g. receiving mouse clicks while its about to hide etc.
- property bool popupOpen: false
-
- property bool desktopBehavior: true
- property int previousCurrentIndex: -1
- property alias model: listView.model
- property alias currentIndex: listView.currentIndex
- property string currentText: model && currentIndex >= 0 ? model.get(currentIndex) : ""
-
- // buttonPressed will be true when the mouse press starts
- // while the popup is closed. At that point, this component can be
- // seen as a button, and not yet a popup menu:
- property bool buttonPressed: false
-
- property Component listItem
- property Component listHighlight
- property Component popupFrame
-
- property Item originalParent: parent
-
- onPopupOpenChanged: {
- if (popupFrameLoader.item === null)
- return;
- if (popupOpen) {
- var oldMouseX = mouseX
-
- // Reparent to root, so the popup stacks in front:
- originalParent = parent;
- var p = parent;
- while (p.parent != undefined)
- p = p.parent
- parent = p;
-
- previousCurrentIndex = currentIndex;
- positionPopup();
- popupFrameLoader.item.opacity = 1;
- if (oldMouseX === mouseX){
- // Work around bug: mouseX and mouseY does not immidiatly
- // update after reparenting and resizing the mouse area:
- var pos = originalParent.mapToItem(parent, mouseX, mouseY)
- highlightItemAt(pos.x, pos.y);
- } else {
- highlightItemAt(mouseX, mouseY);
- }
- listView.forceActiveFocus();
- state = "popupOpen"
- } else {
- popupFrameLoader.item.opacity = 0;
- popup.hideHighlight();
- state = "popupClosed"
- }
- }
-
- Component.onCompleted: {
- // In case 'popupOpen' was set to 'true' before
- // 'popupFrameLoader' was finished, we open the popup now instead:
- if (popup.popupOpen){
- popup.popupOpen = false
- popup.popupOpen = true
- }
- }
-
- function highlightItemAt(posX, posY)
- {
- var mappedPos = mapToItem(listView.contentItem, posX, posY);
- var indexAt = listView.indexAt(mappedPos.x, mappedPos.y);
- if (indexAt == listView.highlightedIndex)
- return;
- if (indexAt >= 0) {
- listView.highlightedIndex = indexAt;
- } else {
- if(posY > listView.y+listView.height && listView.highlightedIndex+1 < listView.count ) {
- listView.highlightedIndex++;
- } else if(posY < listView.y && listView.highlightedIndex > 0) {
- listView.highlightedIndex--;
- } else if(posX < popupFrameLoader.x || posX > popupFrameLoader.x+popupFrameLoader.width) {
- popup.hideHighlight();
- }
- }
- }
-
- function hideHighlight() {
- listView.highlightedIndex = -1;
- listView.highlightedItem = null; // will trigger positionHighlight() what will hide the highlight
- }
-
- function positionPopup() {
- // Set initial values to top left corner of original parent:
- var globalPos = mapFromItem(originalParent, 0, 0);
- var newX = globalPos.x;
- var newY = globalPos.y
- var newW = originalParent.width;
- var newH = listView.contentHeight
-
- switch (popupFrameLoader.item.popupLocation) {
- case "center":
- // Show centered over original parent with respect to selected item:
- var itemHeight = Math.max(listView.contentHeight/listView.count, 0);
- var currentItemY = Math.max(currentIndex*itemHeight, 0);
- currentItemY += Math.floor(itemHeight/2 - choiceList.height/2); // correct for choiceLists that are higher than items in the list
- newY -= currentItemY;
- break;
- case "below":
- case "":
- // Show below original parent:
- newX -= popupFrameLoader.anchors.leftMargin;
- newY += originalParent.height - popupFrameLoader.anchors.topMargin;
- break;
- }
-
- // Ensure the popup is inside the window:
- if (newX < popupFrameLoader.anchors.leftMargin)
- newX = popupFrameLoader.anchors.leftMargin;
- else if (newX + newW > popup.width - popupFrameLoader.anchors.rightMargin)
- newX = popup.width - popupFrameLoader.anchors.rightMargin - newW;
-
- if (newY < popupFrameLoader.anchors.topMargin)
- newY = popupFrameLoader.anchors.topMargin;
- else if (newY + newH > popup.height - popupFrameLoader.anchors.bottomMargin)
- newY = popup.height - popupFrameLoader.anchors.bottomMargin - newH;
-
- // Todo: handle case when the list itself is larger than the window...
-
- listView.x = newX
- listView.y = newY
- listView.width = newW
- listView.height = newH
- }
-
- Loader {
- id: popupFrameLoader
- property alias styledItem: popup.originalParent
- anchors.fill: listView
- anchors.leftMargin: -item.anchors.leftMargin
- anchors.rightMargin: -item.anchors.rightMargin
- anchors.topMargin: -item.anchors.topMargin
- anchors.bottomMargin: -item.anchors.bottomMargin
- sourceComponent: popupFrame
- onItemChanged: item.opacity = 0
- }
-
- ListView {
- id: listView
- focus: true
- opacity: popupFrameLoader.item.opacity
- boundsBehavior: desktopBehavior ? ListView.StopAtBounds : ListView.DragOverBounds
- keyNavigationWraps: !desktopBehavior
- highlightFollowsCurrentItem: false // explicitly handled below
-
- interactive: !desktopBehavior // disable flicking. also disables key handling
- onCurrentItemChanged: {
- if(desktopBehavior) {
- positionViewAtIndex(currentIndex, ListView.Contain);
- }
- }
-
- property int highlightedIndex: -1
- onHighlightedIndexChanged: positionViewAtIndex(highlightedIndex, ListView.Contain)
-
- property variant highlightedItem: null
- onHighlightedItemChanged: {
- if(desktopBehavior) {
- positionHighlight();
- }
- }
-
- function positionHighlight() {
- if(!Qt.isQtObject(highlightItem))
- return;
-
- if(!Qt.isQtObject(highlightedItem)) {
- highlightItem.opacity = 0; // hide when no item is highlighted
- } else {
- highlightItem.x = highlightedItem.x;
- highlightItem.y = highlightedItem.y;
- highlightItem.width = highlightedItem.width;
- highlightItem.height = highlightedItem.height;
- highlightItem.opacity = 1; // show once positioned
- }
- }
-
- delegate: Item {
- id: itemDelegate
- width: delegateLoader.item.width
- height: delegateLoader.item.height
- property int theIndex: index // for some reason the loader can't bind directly to 'index'
-
- Loader {
- id: delegateLoader
- property variant model: listView.model
- property alias index: itemDelegate.theIndex
- property Item styledItem: choiceList
- property bool highlighted: theIndex == listView.highlightedIndex
- property string itemText: text
- sourceComponent: listItem
- }
-
- states: State {
- name: "highlighted"
- when: index == listView.highlightedIndex
- StateChangeScript {
- script: {
- if(Qt.isQtObject(listView.highlightedItem)) {
- listView.highlightedItem.yChanged.disconnect(listView.positionHighlight);
- }
- listView.highlightedItem = itemDelegate;
- listView.highlightedItem.yChanged.connect(listView.positionHighlight);
- }
- }
-
- }
- }
-
- function firstVisibleItem() { return indexAt(contentX+10,contentY+10); }
- function lastVisibleItem() { return indexAt(contentX+width-10,contentY+height-10); }
- function itemsPerPage() { return lastVisibleItem() - firstVisibleItem(); }
-
- Keys.onPressed: {
- // with the ListView !interactive (non-flicking) we have to handle arrow keys
- if (event.key == Qt.Key_Up) {
- if(!highlightedItem) highlightedIndex = lastVisibleItem();
- else if(highlightedIndex > 0) highlightedIndex--;
- } else if (event.key == Qt.Key_Down) {
- if(!highlightedItem) highlightedIndex = firstVisibleItem();
- else if(highlightedIndex+1 < model.count) highlightedIndex++;
- } else if (event.key == Qt.Key_PageUp) {
- if(!highlightedItem) highlightedIndex = lastVisibleItem();
- else highlightedIndex = Math.max(highlightedIndex-itemsPerPage(), 0);
- } else if (event.key == Qt.Key_PageDown) {
- if(!highlightedItem) highlightedIndex = firstVisibleItem();
- else highlightedIndex = Math.min(highlightedIndex+itemsPerPage(), model.count-1);
- } else if (event.key == Qt.Key_Home) {
- highlightedIndex = 0;
- } else if (event.key == Qt.Key_End) {
- highlightedIndex = model.count-1;
- } else if (event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
- if(highlightedIndex != -1) {
- listView.currentIndex = highlightedIndex;
- } else {
- listView.currentIndex = popup.previousCurrentIndex;
- }
-
- popup.popupOpen = false;
- } else if (event.key == Qt.Key_Escape) {
- listView.currentIndex = popup.previousCurrentIndex;
- popup.popupOpen = false;
- }
- event.accepted = true; // consume all keys while popout has focus
- }
-
- highlight: popup.listHighlight
- }
-
- Timer {
- // This is the time-out value for when we consider the
- // user doing a press'n'release, and not just a click to
- // open the popup:
- id: pressedTimer
- interval: 400 // Todo: fetch value from style object
- }
-
- onPressed: {
- if (state == "popupClosed") {
- // Show the popup:
- pressedTimer.running = true
- popup.popupOpen = true
- popup.buttonPressed = true
- }
- }
-
- onReleased: {
- if (state == "popupOpen" && pressedTimer.running === false) {
- // Either we have a 'new' click on the popup, or the user has
- // done a drag'n'release. In either case, the user has done a selection:
- var mappedPos = mapToItem(listView.contentItem, mouseX, mouseY);
- var indexAt = listView.indexAt(mappedPos.x, mappedPos.y);
- if(indexAt != -1)
- listView.currentIndex = indexAt;
- popup.popupOpen = false
- }
- popup.buttonPressed = false
- }
-
- onPositionChanged: {
- if (state == "popupOpen")
- popup.highlightItemAt(mouseX, mouseY)
- }
-
- states: [
- State {
- name: "popupClosed"
- when: popupFrameLoader.item.opacity === 0;
- StateChangeScript {
- script: parent = originalParent;
- }
- }
- ]
-}
-
-
-
-
diff --git a/lib/qtcreator/qtcomponents/custom/qmldir b/lib/qtcreator/qtcomponents/custom/qmldir
deleted file mode 100644
index 8da1fd80f0..0000000000
--- a/lib/qtcreator/qtcomponents/custom/qmldir
+++ /dev/null
@@ -1,14 +0,0 @@
-RangeModel 1.0 RangeModel.qml
-BasicButton 1.0 BasicButton.qml
-BusyIndicator 1.0 BusyIndicator.qml
-ButtonBlock 1.0 ButtonBlock.qml
-Button 1.0 Button.qml
-ButtonColumn 1.0 ButtonColumn.qml
-ButtonRow 1.0 ButtonRow.qml
-CheckBox 1.0 CheckBox.qml
-ChoiceList 1.0 ChoiceList.qml
-ProgressBar 1.0 ProgressBar.qml
-Slider 1.0 Slider.qml
-SpinBox 1.0 SpinBox.qml
-TextField 1.0 TextField.qml
-GroupBox 1.0 GroupBox.qml
diff --git a/lib/qtcreator/qtcomponents/images/folder_new.png b/lib/qtcreator/qtcomponents/images/folder_new.png
deleted file mode 100644
index 8d8bb9bd76..0000000000
--- a/lib/qtcreator/qtcomponents/images/folder_new.png
+++ /dev/null
Binary files differ
diff --git a/lib/qtcreator/qtcomponents/plugins.qmltypes b/lib/qtcreator/qtcomponents/plugins.qmltypes
deleted file mode 100644
index f2a3db3a7d..0000000000
--- a/lib/qtcreator/qtcomponents/plugins.qmltypes
+++ /dev/null
@@ -1,428 +0,0 @@
-import QtQuick.tooling 1.1
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-
-Module {
- Component {
- name: "QAbstractItemModel"
- prototype: "QObject"
- Signal {
- name: "dataChanged"
- Parameter { name: "topLeft"; type: "QModelIndex" }
- Parameter { name: "bottomRight"; type: "QModelIndex" }
- }
- Signal {
- name: "headerDataChanged"
- Parameter { name: "orientation"; type: "Qt::Orientation" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal { name: "layoutChanged" }
- Signal { name: "layoutAboutToBeChanged" }
- Signal {
- name: "rowsAboutToBeInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsAboutToBeRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "rowsRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsInserted"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal {
- name: "columnsRemoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "first"; type: "int" }
- Parameter { name: "last"; type: "int" }
- }
- Signal { name: "modelAboutToBeReset" }
- Signal { name: "modelReset" }
- Signal {
- name: "rowsAboutToBeMoved"
- Parameter { name: "sourceParent"; type: "QModelIndex" }
- Parameter { name: "sourceStart"; type: "int" }
- Parameter { name: "sourceEnd"; type: "int" }
- Parameter { name: "destinationParent"; type: "QModelIndex" }
- Parameter { name: "destinationRow"; type: "int" }
- }
- Signal {
- name: "rowsMoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- Parameter { name: "destination"; type: "QModelIndex" }
- Parameter { name: "row"; type: "int" }
- }
- Signal {
- name: "columnsAboutToBeMoved"
- Parameter { name: "sourceParent"; type: "QModelIndex" }
- Parameter { name: "sourceStart"; type: "int" }
- Parameter { name: "sourceEnd"; type: "int" }
- Parameter { name: "destinationParent"; type: "QModelIndex" }
- Parameter { name: "destinationColumn"; type: "int" }
- }
- Signal {
- name: "columnsMoved"
- Parameter { name: "parent"; type: "QModelIndex" }
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- Parameter { name: "destination"; type: "QModelIndex" }
- Parameter { name: "column"; type: "int" }
- }
- Method { name: "submit"; type: "bool" }
- Method { name: "revert" }
- }
- Component { name: "QAbstractListModel"; prototype: "QAbstractItemModel" }
- Component {
- name: "QDeclarativeFolderListModel"
- prototype: "QAbstractListModel"
- exports: [
- "FileSystemModel 1.0"
- ]
- Enum {
- name: "SortField"
- values: {
- "Unsorted": 0,
- "Name": 1,
- "Time": 2,
- "Size": 3,
- "Type": 4
- }
- }
- Property { name: "folder"; type: "QUrl" }
- Property { name: "parentFolder"; type: "QUrl"; isReadonly: true }
- Property { name: "nameFilters"; type: "QStringList" }
- Property { name: "sortField"; type: "SortField" }
- Property { name: "sortReversed"; type: "bool" }
- Property { name: "showDirs"; type: "bool" }
- Property { name: "showDotAndDotDot"; type: "bool" }
- Property { name: "showOnlyReadable"; type: "bool" }
- Property { name: "count"; type: "int"; isReadonly: true }
- Signal { name: "folderChanged" }
- Signal { name: "countChanged" }
- Method {
- name: "isFolder"
- type: "bool"
- Parameter { name: "index"; type: "int" }
- }
- }
- Component {
- name: "QGraphicsDropShadowEffect"
- prototype: "QGraphicsEffect"
- exports: [
- "DropShadow 1.0"
- ]
- Property { name: "offset"; type: "QPointF" }
- Property { name: "xOffset"; type: "qreal" }
- Property { name: "yOffset"; type: "qreal" }
- Property { name: "blurRadius"; type: "qreal" }
- Property { name: "color"; type: "QColor" }
- Signal {
- name: "offsetChanged"
- Parameter { name: "offset"; type: "QPointF" }
- }
- Signal {
- name: "blurRadiusChanged"
- Parameter { name: "blurRadius"; type: "qreal" }
- }
- Signal {
- name: "colorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Method {
- name: "setOffset"
- Parameter { name: "ofs"; type: "QPointF" }
- }
- Method {
- name: "setOffset"
- Parameter { name: "dx"; type: "qreal" }
- Parameter { name: "dy"; type: "qreal" }
- }
- Method {
- name: "setOffset"
- Parameter { name: "d"; type: "qreal" }
- }
- Method {
- name: "setXOffset"
- Parameter { name: "dx"; type: "qreal" }
- }
- Method {
- name: "setYOffset"
- Parameter { name: "dy"; type: "qreal" }
- }
- Method {
- name: "setBlurRadius"
- Parameter { name: "blurRadius"; type: "qreal" }
- }
- Method {
- name: "setColor"
- Parameter { name: "color"; type: "QColor" }
- }
- }
- Component {
- name: "QGraphicsEffect"
- prototype: "QObject"
- Enum {
- name: "ChangeFlags"
- values: {
- "SourceAttached": 1,
- "SourceDetached": 2,
- "SourceBoundingRectChanged": 4,
- "SourceInvalidated": 8
- }
- }
- Property { name: "enabled"; type: "bool" }
- Signal {
- name: "enabledChanged"
- Parameter { name: "enabled"; type: "bool" }
- }
- Method {
- name: "setEnabled"
- Parameter { name: "enable"; type: "bool" }
- }
- Method { name: "update" }
- }
- Component {
- name: "QRangeModel"
- prototype: "QObject"
- exports: [
- "RangeModel 1.0"
- ]
- Property { name: "value"; type: "qreal" }
- Property { name: "minimumValue"; type: "qreal" }
- Property { name: "maximumValue"; type: "qreal" }
- Property { name: "stepSize"; type: "qreal" }
- Property { name: "position"; type: "qreal" }
- Property { name: "positionAtMinimum"; type: "qreal" }
- Property { name: "positionAtMaximum"; type: "qreal" }
- Property { name: "inverted"; type: "bool" }
- Signal {
- name: "valueChanged"
- Parameter { name: "value"; type: "qreal" }
- }
- Signal {
- name: "positionChanged"
- Parameter { name: "position"; type: "qreal" }
- }
- Signal {
- name: "stepSizeChanged"
- Parameter { name: "stepSize"; type: "qreal" }
- }
- Signal {
- name: "invertedChanged"
- Parameter { name: "inverted"; type: "bool" }
- }
- Signal {
- name: "minimumChanged"
- Parameter { name: "min"; type: "qreal" }
- }
- Signal {
- name: "maximumChanged"
- Parameter { name: "max"; type: "qreal" }
- }
- Signal {
- name: "positionAtMinimumChanged"
- Parameter { name: "min"; type: "qreal" }
- }
- Signal {
- name: "positionAtMaximumChanged"
- Parameter { name: "max"; type: "qreal" }
- }
- Method { name: "toMinimum" }
- Method { name: "toMaximum" }
- Method {
- name: "setValue"
- Parameter { name: "value"; type: "qreal" }
- }
- Method {
- name: "setPosition"
- Parameter { name: "position"; type: "qreal" }
- }
- Method {
- name: "valueForPosition"
- type: "qreal"
- Parameter { name: "position"; type: "qreal" }
- }
- Method {
- name: "positionForValue"
- type: "qreal"
- Parameter { name: "value"; type: "qreal" }
- }
- }
- Component {
- name: "QStyleItem"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- exports: [
- "QStyleItem 1.0"
- ]
- Property { name: "sunken"; type: "bool" }
- Property { name: "raised"; type: "bool" }
- Property { name: "active"; type: "bool" }
- Property { name: "selected"; type: "bool" }
- Property { name: "focus"; type: "bool" }
- Property { name: "on"; type: "bool" }
- Property { name: "hover"; type: "bool" }
- Property { name: "horizontal"; type: "bool" }
- Property { name: "elementType"; type: "string" }
- Property { name: "text"; type: "string" }
- Property { name: "activeControl"; type: "string" }
- Property { name: "info"; type: "string" }
- Property { name: "style"; type: "string"; isReadonly: true }
- Property { name: "hint"; type: "string" }
- Property { name: "cursor"; type: "string" }
- Property { name: "minimum"; type: "int" }
- Property { name: "maximum"; type: "int" }
- Property { name: "value"; type: "int" }
- Property { name: "step"; type: "int" }
- Property { name: "paintMargins"; type: "int" }
- Property { name: "fontFamily"; type: "string"; isReadonly: true }
- Property { name: "fontPointSize"; type: "double"; isReadonly: true }
- Property { name: "fontHeight"; type: "int"; isReadonly: true }
- Signal { name: "elementTypeChanged" }
- Signal { name: "textChanged" }
- Signal { name: "sunkenChanged" }
- Signal { name: "raisedChanged" }
- Signal { name: "activeChanged" }
- Signal { name: "selectedChanged" }
- Signal { name: "focusChanged" }
- Signal { name: "onChanged" }
- Signal { name: "hoverChanged" }
- Signal { name: "horizontalChanged" }
- Signal { name: "minimumChanged" }
- Signal { name: "maximumChanged" }
- Signal { name: "stepChanged" }
- Signal { name: "valueChanged" }
- Signal { name: "activeControlChanged" }
- Signal { name: "infoChanged" }
- Signal { name: "styleChanged" }
- Signal { name: "paintMarginsChanged" }
- Signal { name: "hintChanged" }
- Signal { name: "cursorChanged" }
- Signal { name: "fontHeightChanged" }
- Method {
- name: "pixelMetric"
- type: "int"
- Parameter { type: "string" }
- }
- Method {
- name: "styleHint"
- type: "QVariant"
- Parameter { type: "string" }
- }
- Method {
- name: "sizeFromContents"
- type: "QSize"
- Parameter { name: "width"; type: "int" }
- Parameter { name: "height"; type: "int" }
- }
- Method { name: "updateItem" }
- Method {
- name: "hitTest"
- type: "string"
- Parameter { name: "x"; type: "int" }
- Parameter { name: "y"; type: "int" }
- }
- Method {
- name: "subControlRect"
- type: "QRect"
- Parameter { name: "subcontrolString"; type: "string" }
- }
- Method {
- name: "showToolTip"
- Parameter { name: "str"; type: "string" }
- }
- Method {
- name: "textWidth"
- type: "int"
- Parameter { type: "string" }
- }
- }
- Component {
- name: "QWheelArea"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- exports: [
- "WheelArea 1.0"
- ]
- Property { name: "verticalDelta"; type: "qreal" }
- Property { name: "horizontalDelta"; type: "qreal" }
- Property { name: "horizontalMinimumValue"; type: "qreal" }
- Property { name: "horizontalMaximumValue"; type: "qreal" }
- Property { name: "verticalMinimumValue"; type: "qreal" }
- Property { name: "verticalMaximumValue"; type: "qreal" }
- Property { name: "horizontalValue"; type: "qreal" }
- Property { name: "verticalValue"; type: "qreal" }
- Signal { name: "verticalValueChanged" }
- Signal { name: "horizontalValueChanged" }
- Signal { name: "verticalWheelMoved" }
- Signal { name: "horizontalWheelMoved" }
- }
- Component {
- name: "QtMenu"
- defaultProperty: "menuItems"
- prototype: "QObject"
- exports: [
- "MenuBase 1.0"
- ]
- Property { name: "title"; type: "string" }
- Property { name: "menuItems"; type: "QtMenuItem"; isList: true; isReadonly: true }
- Signal { name: "selected" }
- Method {
- name: "showPopup"
- Parameter { name: "x"; type: "qreal" }
- Parameter { name: "y"; type: "qreal" }
- }
- }
- Component {
- name: "QtMenuBar"
- defaultProperty: "data"
- prototype: "QDeclarativeItem"
- exports: [
- "MenuBarBase 1.0"
- ]
- Property { name: "menus"; type: "QtMenu"; isList: true; isReadonly: true }
- }
- Component {
- name: "QtMenuItem"
- prototype: "QObject"
- exports: [
- "MenuItemBase 1.0"
- ]
- Property { name: "text"; type: "string" }
- Signal { name: "selected" }
- }
-}
diff --git a/lib/qtcreator/qtcomponents/qmldir b/lib/qtcreator/qtcomponents/qmldir
deleted file mode 100644
index d33a7971d7..0000000000
--- a/lib/qtcreator/qtcomponents/qmldir
+++ /dev/null
@@ -1,27 +0,0 @@
-Slider 1.0 Slider.qml
-SpinBox 1.0 SpinBox.qml
-GroupBox 1.0 GroupBox.qml
-Button 1.0 Button.qml
-ToolBar 1.0 ToolBar.qml
-TabFrame 1.0 TabFrame.qml
-TabBar 1.0 TabBar.qml
-Tab 1.0 Tab.qml
-ScrollArea 1.0 ScrollArea.qml
-ScrollBar 1.0 ScrollBar.qml
-ChoiceList 1.0 ChoiceList.qml
-ToolButton 1.0 ToolButton.qml
-TextArea 1.0 TextArea.qml
-TextField 1.0 TextField.qml
-ProgressBar 1.0 ProgressBar.qml
-ButtonRow 1.0 ButtonRow.qml
-ButtonColumn 1.0 ButtonColumn.qml
-SplitterRow 1.0 SplitterRow.qml
-Dial 1.0 Dial.qml
-TableView 1.0 TableView.qml
-CheckBox 1.0 CheckBox.qml
-RadioButton 1.0 RadioButton.qml
-plugin styleplugin plugin
-TableColumn 1.0 TableColumn.qml
-ContextMenu 1.0 ContextMenu.qml
-Menu 1.0 Menu.qml
-MenuItem 1.0 MenuItem.qml
diff --git a/lib/qtcreator/qtcomponents/qtcomponents.pro b/lib/qtcreator/qtcomponents/qtcomponents.pro
deleted file mode 100644
index c263f32d4f..0000000000
--- a/lib/qtcreator/qtcomponents/qtcomponents.pro
+++ /dev/null
@@ -1,57 +0,0 @@
-include(../../../qtcreator.pri)
-
-TEMPLATE = app
-TARGET = phony_target3
-CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
-QT =
-LIBS =
-macx:CONFIG -= app_bundle
-
-isEmpty(vcproj) {
- QMAKE_LINK = @: IGNORE THIS LINE
- OBJECTS_DIR =
- win32:CONFIG -= embed_manifest_exe
-} else {
- CONFIG += console
- PHONY_DEPS = .
- phony_src.input = PHONY_DEPS
- phony_src.output = phony.c
- phony_src.variable_out = GENERATED_SOURCES
- phony_src.commands = echo int main() { return 0; } > phony.c
- phony_src.name = CREATE phony.c
- phony_src.CONFIG += combine
- QMAKE_EXTRA_COMPILERS += phony_src
-}
-
-DATA_FILE_PATTERNS = \
- $$PWD/*.qml \
- $$PWD/qmldir \
- $$PWD/images/* \
- $$PWD/custom/* \
- $$PWD/custom/behaviors/* \
- $$PWD/custom/private/*
-
-!isEmpty(copydata) {
-
- for(data_file, DATA_FILE_PATTERNS) {
- files = $$files($$data_file, false)
- win32:files ~= s|\\\\|/|g
- for(file, files):!exists($$file/*):FILES += $$file
- }
-
- OTHER_FILES += $$FILES
- copy2build.input = FILES
- copy2build.output = $$IDE_LIBRARY_PATH/qtcomponents/${QMAKE_FUNC_FILE_IN_stripSrcDir}
- isEmpty(vcproj):copy2build.variable_out = PRE_TARGETDEPS
- win32:copy2build.commands = $$QMAKE_COPY \"${QMAKE_FILE_IN}\" \"${QMAKE_FILE_OUT}\"
- unix:copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
- copy2build.name = COPY ${QMAKE_FILE_IN}
- copy2build.CONFIG += no_link
- QMAKE_EXTRA_COMPILERS += copy2build
-}
-
-!macx {
- qmlfiles.files = $$PWD/*.qml $$PWD/qmldir $$PWD/images $$PWD/custom
- qmlfiles.path = $$QTC_PREFIX/$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents
- INSTALLS += qmlfiles
-}
diff --git a/lib/qtcreator/qtcomponents/qtcomponents.qbs b/lib/qtcreator/qtcomponents/qtcomponents.qbs
deleted file mode 100644
index fc0ebf79d5..0000000000
--- a/lib/qtcreator/qtcomponents/qtcomponents.qbs
+++ /dev/null
@@ -1,18 +0,0 @@
-import qbs.base 1.0
-
-Product {
- name: "QtComponents"
-
- Group {
- name: "Resources"
- qbs.install: true
- qbs.installDir: (qbs.targetOS.contains("windows") ? "lib/qtcreator" : project.ide_library_path)
- + "/qtcomponents"
- files: [
- "*.qml",
- "qmldir",
- "custom",
- "images"
- ]
- }
-}
diff --git a/qtcreator.pro b/qtcreator.pro
index e0c51e3f9f..5db86bcc66 100644
--- a/qtcreator.pro
+++ b/qtcreator.pro
@@ -11,7 +11,7 @@ include(doc/doc.pri)
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS = src share lib/qtcreator/qtcomponents
+SUBDIRS = src share
unix:!macx:!isEmpty(copydata):SUBDIRS += bin
!isEmpty(BUILD_TESTS):SUBDIRS += tests
diff --git a/qtcreator.qbs b/qtcreator.qbs
index eb204c8f7c..31fe1d3b84 100644
--- a/qtcreator.qbs
+++ b/qtcreator.qbs
@@ -56,7 +56,6 @@ Project {
references: [
"src/src.qbs",
- "lib/qtcreator/qtcomponents/qtcomponents.qbs",
"share/share.qbs",
"share/qtcreator/translations/translations.qbs",
"tests/tests.qbs"
diff --git a/src/libs/libs.pro b/src/libs/libs.pro
index ed7f534497..bac0d4ecad 100644
--- a/src/libs/libs.pro
+++ b/src/libs/libs.pro
@@ -21,8 +21,7 @@ for(l, SUBDIRS) {
}
SUBDIRS += \
- utils/process_stub.pro \
- qtcomponents/styleitem
+ utils/process_stub.pro
QBS_DIRS = \
../shared/qbs/src/lib \
diff --git a/src/libs/libs.qbs b/src/libs/libs.qbs
index f6f2a36959..8bff7f99a2 100644
--- a/src/libs/libs.qbs
+++ b/src/libs/libs.qbs
@@ -11,7 +11,6 @@ Project {
"qmleditorwidgets/qmleditorwidgets.qbs",
"qmljs/qmljs.qbs",
"qmldebug/qmldebug.qbs",
- "qtcomponents/styleitem/styleitem.qbs",
"ssh/ssh.qbs",
"utils/process_stub.qbs",
"utils/process_ctrlc_stub.qbs",
diff --git a/src/libs/qmleditorwidgets/colorbox.h b/src/libs/qmleditorwidgets/colorbox.h
index ff339b692a..b33998a125 100644
--- a/src/libs/qmleditorwidgets/colorbox.h
+++ b/src/libs/qmleditorwidgets/colorbox.h
@@ -32,7 +32,6 @@
#include "qmleditorwidgets_global.h"
#include <QWidget>
-#include <qdeclarative.h>
namespace QmlEditorWidgets {
@@ -92,6 +91,4 @@ private:
} //QmlEditorWidgets
-QML_DECLARE_TYPE(QmlEditorWidgets::ColorBox)
-
#endif //COLORBOX_H
diff --git a/src/libs/qmleditorwidgets/colorbutton.h b/src/libs/qmleditorwidgets/colorbutton.h
index 4f40e6485f..44357d1df9 100644
--- a/src/libs/qmleditorwidgets/colorbutton.h
+++ b/src/libs/qmleditorwidgets/colorbutton.h
@@ -32,7 +32,7 @@
#include "qmleditorwidgets_global.h"
#include <QToolButton>
-#include <qdeclarative.h>
+#include <QVariant>
namespace QmlEditorWidgets {
@@ -73,6 +73,4 @@ private:
} //QmlEditorWidgets
-QML_DECLARE_TYPE(QmlEditorWidgets::ColorButton)
-
#endif //COLORBUTTON_H
diff --git a/src/libs/qmleditorwidgets/colorwidgets.cpp b/src/libs/qmleditorwidgets/colorwidgets.cpp
deleted file mode 100644
index e25cdcb5bd..0000000000
--- a/src/libs/qmleditorwidgets/colorwidgets.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "colorwidgets.h"
-#include <qdeclarative.h>
-
-#include "colorbox.h"
-#include "colorbutton.h"
-#include "huecontrol.h"
-#include "gradientline.h"
-
-namespace QmlEditorWidgets {
-
-void ColorWidgets::registerDeclarativeTypes() {
- qmlRegisterType<QmlEditorWidgets::ColorButton>("Bauhaus",1,0,"ColorButton");
- qmlRegisterType<QmlEditorWidgets::HueControl>("Bauhaus",1,0,"HueControl");
- qmlRegisterType<QmlEditorWidgets::ColorBox>("Bauhaus",1,0,"ColorBox");
- qmlRegisterType<QmlEditorWidgets::GradientLine>("Bauhaus",1,0,"GradientLine");
-}
-
-}
diff --git a/src/libs/qmleditorwidgets/colorwidgets.h b/src/libs/qmleditorwidgets/colorwidgets.h
deleted file mode 100644
index 39760d5586..0000000000
--- a/src/libs/qmleditorwidgets/colorwidgets.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef COLORWIDGET_H
-#define COLORWIDGET_H
-
-#include "qmleditorwidgets_global.h"
-
-namespace QmlEditorWidgets {
-
-class QMLEDITORWIDGETS_EXPORT ColorWidgets {
-
-public:
- static void registerDeclarativeTypes();
-};
-
-} // namespace QmlEditorWidgets
-
-#endif //COLORWIDGET_H
diff --git a/src/libs/qmleditorwidgets/easingpane/easingpane.pri b/src/libs/qmleditorwidgets/easingpane/easingpane.pri
index a1c04cda4b..472bc1bfd3 100644
--- a/src/libs/qmleditorwidgets/easingpane/easingpane.pri
+++ b/src/libs/qmleditorwidgets/easingpane/easingpane.pri
@@ -5,7 +5,5 @@ SOURCES += $$PWD/easinggraph.cpp \
HEADERS += $$PWD/easinggraph.h \
$$PWD/easingcontextpane.h
-QT += declarative
-
RESOURCES += $$PWD/easingpane.qrc
FORMS += $$PWD/easingcontextpane.ui
diff --git a/src/libs/qmleditorwidgets/huecontrol.h b/src/libs/qmleditorwidgets/huecontrol.h
index 957dd5f63d..b0425d9a31 100644
--- a/src/libs/qmleditorwidgets/huecontrol.h
+++ b/src/libs/qmleditorwidgets/huecontrol.h
@@ -32,7 +32,6 @@
#include "qmleditorwidgets_global.h"
#include <QWidget>
-#include <qdeclarative.h>
namespace QmlEditorWidgets {
@@ -69,6 +68,4 @@ private:
} //QmlEditorWidgets
-QML_DECLARE_TYPE(QmlEditorWidgets::HueControl)
-
#endif //HUECONTROL_H
diff --git a/src/libs/qmleditorwidgets/qmleditorwidgets-lib.pri b/src/libs/qmleditorwidgets/qmleditorwidgets-lib.pri
index fdaf629f7a..7e88ac570c 100644
--- a/src/libs/qmleditorwidgets/qmleditorwidgets-lib.pri
+++ b/src/libs/qmleditorwidgets/qmleditorwidgets-lib.pri
@@ -1,5 +1,3 @@
-QT += script declarative
-
contains(CONFIG, dll) {
DEFINES += BUILD_QMLEDITORWIDGETS_LIB
} else {
@@ -17,7 +15,6 @@ HEADERS += \
contextpanewidgetimage.h \
contextpanewidget.h \
contextpanetextwidget.h \
- colorwidgets.h \
colorbutton.h \
colorbox.h \
customcolordialog.h \
@@ -32,7 +29,6 @@ SOURCES += \
contextpanewidgetimage.cpp \
contextpanewidget.cpp \
contextpanetextwidget.cpp \
- colorwidgets.cpp \
colorbox.cpp \
customcolordialog.cpp \
huecontrol.cpp \
diff --git a/src/libs/qmleditorwidgets/qmleditorwidgets.qbs b/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
index a8a3ebc2c1..7bcb914945 100644
--- a/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
+++ b/src/libs/qmleditorwidgets/qmleditorwidgets.qbs
@@ -10,7 +10,7 @@ QtcLibrary {
])
cpp.optimization: "fast"
- Depends { name: "Qt"; submodules: ["widgets", "declarative", "script"] }
+ Depends { name: "Qt"; submodules: ["widgets"] }
Depends { name: "QmlJS" }
Depends { name: "Utils" }
@@ -19,7 +19,6 @@ QtcLibrary {
files: [
"colorbox.cpp", "colorbox.h",
"colorbutton.cpp", "colorbutton.h",
- "colorwidgets.cpp", "colorwidgets.h",
"contextpanetext.ui",
"contextpanetextwidget.cpp", "contextpanetextwidget.h",
"contextpanewidget.cpp", "contextpanewidget.h",
diff --git a/src/libs/qmleditorwidgets/qmleditorwidgets_dependencies.pri b/src/libs/qmleditorwidgets/qmleditorwidgets_dependencies.pri
index 7768fffce8..aef40e6272 100644
--- a/src/libs/qmleditorwidgets/qmleditorwidgets_dependencies.pri
+++ b/src/libs/qmleditorwidgets/qmleditorwidgets_dependencies.pri
@@ -2,4 +2,3 @@ QTC_LIB_NAME = QmlEditorWidgets
QTC_LIB_DEPENDS += \
qmljs \
utils
-QT *= declarative
diff --git a/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.cpp b/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.cpp
deleted file mode 100644
index e9c39e9d51..0000000000
--- a/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-//![code]
-#include "qdeclarativefolderlistmodel.h"
-#include <QDirModel>
-#include <QDebug>
-#include <qdeclarativecontext.h>
-
-#ifndef QT_NO_DIRMODEL
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeFolderListModelPrivate
-{
-public:
- QDeclarativeFolderListModelPrivate()
- : sortField(QDeclarativeFolderListModel::Name), sortReversed(false), count(0) {
- nameFilters << QLatin1String("*");
- }
-
- void updateSorting() {
- QDir::SortFlags flags = 0;
- switch (sortField) {
- case QDeclarativeFolderListModel::Unsorted:
- flags |= QDir::Unsorted;
- break;
- case QDeclarativeFolderListModel::Name:
- flags |= QDir::Name;
- break;
- case QDeclarativeFolderListModel::Time:
- flags |= QDir::Time;
- break;
- case QDeclarativeFolderListModel::Size:
- flags |= QDir::Size;
- break;
- case QDeclarativeFolderListModel::Type:
- flags |= QDir::Type;
- break;
- }
-
- if (sortReversed)
- flags |= QDir::Reversed;
-
- model.setSorting(flags);
- }
-
- QDirModel model;
- QUrl folder;
- QStringList nameFilters;
- QModelIndex folderIndex;
- QDeclarativeFolderListModel::SortField sortField;
- bool sortReversed;
- int count;
-};
-
-/*!
- \qmlclass FolderListModel QDeclarativeFolderListModel
- \ingroup qml-working-with-data
- \brief The FolderListModel provides a model of the contents of a file system folder.
-
- FolderListModel provides access to information about the contents of a folder
- in the local file system, exposing a list of files to views and other data components.
-
- \note This type is made available by importing the \c Qt.labs.folderlistmodel module.
- \e{Elements in the Qt.labs module are not guaranteed to remain compatible
- in future versions.}
-
- \b {import Qt.labs.folderlistmodel 1.0}
-
- The \l folder property specifies the folder to access. Information about the
- files and directories in the folder is supplied via the model's interface.
- Components access names and paths via the following roles:
-
- \list
- \li fileName
- \li filePath
- \endlist
-
- Additionally a file entry can be differentiated from a folder entry via the
- isFolder() method.
-
- \section1 Filtering
-
- Various properties can be set to filter the number of files and directories
- exposed by the model.
-
- The \l nameFilters property can be set to contain a list of wildcard filters
- that are applied to names of files and directories, causing only those that
- match the filters to be exposed.
-
- Directories can be included or excluded using the \l showDirs property, and
- navigation directories can also be excluded by setting the \l showDotAndDotDot
- property to false.
-
- It is sometimes useful to limit the files and directories exposed to those
- that the user can access. The \l showOnlyReadable property can be set to
- enable this feature.
-
- \section1 Example Usage
-
- The following example shows a FolderListModel being used to provide a list
- of QML files in a \l ListView:
-
- \snippet doc/src/snippets/declarative/folderlistmodel.qml 0
-
- \section1 Path Separators
-
- Qt uses "/" as a universal directory separator in the same way that "/" is
- used as a path separator in URLs. If you always use "/" as a directory
- separator, Qt will translate your paths to conform to the underlying
- operating system.
-
- \sa {QML Data Models}
-*/
-
-QDeclarativeFolderListModel::QDeclarativeFolderListModel(QObject *parent)
- : QAbstractListModel(parent)
-{
- QHash<int, QByteArray> roles;
- roles[FileNameRole] = "fileName";
- roles[FilePathRole] = "filePath";
- roles[FileSizeRole] = "fileSize";
- setRoleNames(roles);
-
- d = new QDeclarativeFolderListModelPrivate;
- d->model.setFilter(QDir::AllDirs | QDir::Files | QDir::Drives | QDir::NoDotAndDotDot);
- connect(&d->model, SIGNAL(rowsInserted(QModelIndex,int,int))
- , this, SLOT(inserted(QModelIndex,int,int)));
- connect(&d->model, SIGNAL(rowsRemoved(QModelIndex,int,int))
- , this, SLOT(removed(QModelIndex,int,int)));
- connect(&d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex))
- , this, SLOT(handleDataChanged(QModelIndex,QModelIndex)));
- connect(&d->model, SIGNAL(modelReset()), this, SLOT(refresh()));
- connect(&d->model, SIGNAL(layoutChanged()), this, SLOT(refresh()));
-}
-
-QDeclarativeFolderListModel::~QDeclarativeFolderListModel()
-{
- delete d;
-}
-
-QVariant QDeclarativeFolderListModel::data(const QModelIndex &index, int role) const
-{
- QVariant rv;
- QModelIndex modelIndex = d->model.index(index.row(), 0, d->folderIndex);
- if (modelIndex.isValid()) {
- if (role == FileNameRole)
- rv = d->model.data(modelIndex, QDirModel::FileNameRole).toString();
- else if (role == FilePathRole)
- rv = QUrl::fromLocalFile(d->model.data(modelIndex, QDirModel::FilePathRole).toString());
- else if (role == FileSizeRole)
- rv = d->model.data(d->model.index(index.row(), 1, d->folderIndex), Qt::DisplayRole).toString();
- }
- return rv;
-}
-
-/*!
- \qmlproperty int FolderListModel::count
-
- Returns the number of items in the current folder that match the
- filter criteria.
-*/
-int QDeclarativeFolderListModel::rowCount(const QModelIndex &parent) const
-{
- Q_UNUSED(parent);
- return d->count;
-}
-
-/*!
- \qmlproperty string FolderListModel::folder
-
- The \a folder property holds a URL for the folder that the model is
- currently providing.
-
- The value is a URL expressed as a string, and must be a \c file: or \c qrc:
- URL, or a relative URL.
-
- By default, the value is an invalid URL.
-*/
-QUrl QDeclarativeFolderListModel::folder() const
-{
- return d->folder;
-}
-
-void QDeclarativeFolderListModel::setFolder(const QUrl &folder)
-{
- if (folder == d->folder)
- return;
- QModelIndex index = d->model.index(folder.toLocalFile());
- if ((index.isValid() && d->model.isDir(index)) || folder.toLocalFile().isEmpty()) {
-
- d->folder = folder;
- QMetaObject::invokeMethod(this, "refresh", Qt::QueuedConnection);
- emit folderChanged();
- }
-}
-
-/*!
- \qmlproperty url FolderListModel::parentFolder
-
- Returns the URL of the parent of of the current \l folder.
-*/
-QUrl QDeclarativeFolderListModel::parentFolder() const
-{
- QString localFile = d->folder.toLocalFile();
- if (!localFile.isEmpty()) {
- QDir dir(localFile);
- dir.cdUp();
- localFile = dir.path();
- } else {
- int pos = d->folder.path().lastIndexOf(QLatin1Char('/'));
- if (pos == -1)
- return QUrl();
- localFile = d->folder.path().left(pos);
- }
- return QUrl::fromLocalFile(localFile);
-}
-
-/*!
- \qmlproperty list<string> FolderListModel::nameFilters
-
- The \a nameFilters property contains a list of file name filters.
- The filters may include the ? and * wildcards.
-
- The example below filters on PNG and JPEG files:
-
- \qml
- FolderListModel {
- nameFilters: [ "*.png", "*.jpg" ]
- }
- \endqml
-
- \note Directories are not excluded by filters.
-*/
-QStringList QDeclarativeFolderListModel::nameFilters() const
-{
- return d->nameFilters;
-}
-
-void QDeclarativeFolderListModel::setNameFilters(const QStringList &filters)
-{
- d->nameFilters = filters;
- d->model.setNameFilters(d->nameFilters);
-}
-
-void QDeclarativeFolderListModel::classBegin()
-{
-}
-
-void QDeclarativeFolderListModel::componentComplete()
-{
- if (!d->folder.isValid() || d->folder.toLocalFile().isEmpty() || !QDir().exists(d->folder.toLocalFile()))
- setFolder(QUrl(QLatin1String("file://")+QDir::currentPath()));
-
- if (!d->folderIndex.isValid())
- QMetaObject::invokeMethod(this, "refresh", Qt::QueuedConnection);
-}
-
-/*!
- \qmlproperty enumeration FolderListModel::sortField
-
- The \a sortField property contains field to use for sorting. sortField
- may be one of:
- \list
- \li Unsorted - no sorting is applied. The order is system default.
- \li Name - sort by filename
- \li Time - sort by time modified
- \li Size - sort by file size
- \li Type - sort by file type (extension)
- \endlist
-
- \sa sortReversed
-*/
-QDeclarativeFolderListModel::SortField QDeclarativeFolderListModel::sortField() const
-{
- return d->sortField;
-}
-
-void QDeclarativeFolderListModel::setSortField(SortField field)
-{
- if (field != d->sortField) {
- d->sortField = field;
- d->updateSorting();
- }
-}
-
-/*!
- \qmlproperty bool FolderListModel::sortReversed
-
- If set to true, reverses the sort order. The default is false.
-
- \sa sortField
-*/
-bool QDeclarativeFolderListModel::sortReversed() const
-{
- return d->sortReversed;
-}
-
-void QDeclarativeFolderListModel::setSortReversed(bool rev)
-{
- if (rev != d->sortReversed) {
- d->sortReversed = rev;
- d->updateSorting();
- }
-}
-
-/*!
- \qmlmethod bool FolderListModel::isFolder(int index)
-
- Returns true if the entry \a index is a folder; otherwise
- returns false.
-*/
-bool QDeclarativeFolderListModel::isFolder(int index) const
-{
- if (index != -1) {
- QModelIndex idx = d->model.index(index, 0, d->folderIndex);
- if (idx.isValid())
- return d->model.isDir(idx);
- }
- return false;
-}
-
-void QDeclarativeFolderListModel::refresh()
-{
- d->folderIndex = QModelIndex();
- if (d->count) {
- emit beginRemoveRows(QModelIndex(), 0, d->count-1);
- d->count = 0;
- emit endRemoveRows();
- }
- d->folderIndex = d->model.index(d->folder.toLocalFile());
- int newcount = d->model.rowCount(d->folderIndex);
- if (newcount) {
- emit beginInsertRows(QModelIndex(), 0, newcount-1);
- d->count = newcount;
- emit endInsertRows();
- }
-}
-
-void QDeclarativeFolderListModel::inserted(const QModelIndex &index, int start, int end)
-{
- if (index == d->folderIndex) {
- emit beginInsertRows(QModelIndex(), start, end);
- d->count = d->model.rowCount(d->folderIndex);
- emit endInsertRows();
- }
-}
-
-void QDeclarativeFolderListModel::removed(const QModelIndex &index, int start, int end)
-{
- if (index == d->folderIndex) {
- emit beginRemoveRows(QModelIndex(), start, end);
- d->count = d->model.rowCount(d->folderIndex);
- emit endRemoveRows();
- }
-}
-
-void QDeclarativeFolderListModel::handleDataChanged(const QModelIndex &start, const QModelIndex &end)
-{
- if (start.parent() == d->folderIndex)
- emit dataChanged(index(start.row(),0), index(end.row(),0));
-}
-
-/*!
- \qmlproperty bool FolderListModel::showDirs
-
- If true, directories are included in the model; otherwise only files
- are included.
-
- By default, this property is true.
-
- Note that the nameFilters are not applied to directories.
-
- \sa showDotAndDotDot
-*/
-bool QDeclarativeFolderListModel::showDirs() const
-{
- return d->model.filter() & QDir::AllDirs;
-}
-
-void QDeclarativeFolderListModel::setShowDirs(bool on)
-{
- if (!(d->model.filter() & QDir::AllDirs) == !on)
- return;
- if (on)
- d->model.setFilter(d->model.filter() | QDir::AllDirs | QDir::Drives);
- else
- d->model.setFilter(d->model.filter() & ~(QDir::AllDirs | QDir::Drives));
-}
-
-/*!
- \qmlproperty bool FolderListModel::showDotAndDotDot
-
- If true, the "." and ".." directories are included in the model; otherwise
- they are excluded.
-
- By default, this property is false.
-
- \sa showDirs
-*/
-bool QDeclarativeFolderListModel::showDotAndDotDot() const
-{
- return !(d->model.filter() & QDir::NoDotAndDotDot);
-}
-
-void QDeclarativeFolderListModel::setShowDotAndDotDot(bool on)
-{
- if (!(d->model.filter() & QDir::NoDotAndDotDot) == on)
- return;
- if (on)
- d->model.setFilter(d->model.filter() & ~QDir::NoDotAndDotDot);
- else
- d->model.setFilter(d->model.filter() | QDir::NoDotAndDotDot);
-}
-
-/*!
- \qmlproperty bool FolderListModel::showOnlyReadable
-
- If true, only readable files and directories are shown; otherwise all files
- and directories are shown.
-
- By default, this property is false.
-
- \sa showDirs
-*/
-bool QDeclarativeFolderListModel::showOnlyReadable() const
-{
- return d->model.filter() & QDir::Readable;
-}
-
-void QDeclarativeFolderListModel::setShowOnlyReadable(bool on)
-{
- if (!(d->model.filter() & QDir::Readable) == !on)
- return;
- if (on)
- d->model.setFilter(d->model.filter() | QDir::Readable);
- else
- d->model.setFilter(d->model.filter() & ~QDir::Readable);
-}
-
-//![code]
-QT_END_NAMESPACE
-
-#endif // QT_NO_DIRMODEL
diff --git a/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.h b/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.h
deleted file mode 100644
index c5ee05c296..0000000000
--- a/src/libs/qtcomponents/styleitem/qdeclarativefolderlistmodel.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEFOLDERLISTMODEL_H
-#define QDECLARATIVEFOLDERLISTMODEL_H
-
-#include <qdeclarative.h>
-#include <QStringList>
-#include <QUrl>
-#include <QAbstractListModel>
-
-#ifndef QT_NO_DIRMODEL
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeContext;
-class QModelIndex;
-
-class QDeclarativeFolderListModelPrivate;
-
-//![class begin]
-class QDeclarativeFolderListModel : public QAbstractListModel, public QDeclarativeParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QDeclarativeParserStatus)
-//![class begin]
-
-//![class props]
- Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged)
- Q_PROPERTY(QUrl parentFolder READ parentFolder NOTIFY folderChanged)
- Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters)
- Q_PROPERTY(SortField sortField READ sortField WRITE setSortField)
- Q_PROPERTY(bool sortReversed READ sortReversed WRITE setSortReversed)
- Q_PROPERTY(bool showDirs READ showDirs WRITE setShowDirs)
- Q_PROPERTY(bool showDotAndDotDot READ showDotAndDotDot WRITE setShowDotAndDotDot)
- Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable)
- Q_PROPERTY(int count READ count NOTIFY countChanged)
-//![class props]
-
-//![abslistmodel]
-public:
- QDeclarativeFolderListModel(QObject *parent = 0);
- ~QDeclarativeFolderListModel();
-
- enum Roles { FileNameRole = Qt::UserRole+1, FilePathRole = Qt::UserRole+2, FileSizeRole = Qt::UserRole+3 };
-
- int rowCount(const QModelIndex &parent) const;
- QVariant data(const QModelIndex &index, int role) const;
-//![abslistmodel]
-
-//![count]
- int count() const { return rowCount(QModelIndex()); }
-//![count]
-
-//![prop funcs]
- QUrl folder() const;
- void setFolder(const QUrl &folder);
-
- QUrl parentFolder() const;
-
- QStringList nameFilters() const;
- void setNameFilters(const QStringList &filters);
-
- enum SortField { Unsorted, Name, Time, Size, Type };
- SortField sortField() const;
- void setSortField(SortField field);
- Q_ENUMS(SortField)
-
- bool sortReversed() const;
- void setSortReversed(bool rev);
-
- bool showDirs() const;
- void setShowDirs(bool);
- bool showDotAndDotDot() const;
- void setShowDotAndDotDot(bool);
- bool showOnlyReadable() const;
- void setShowOnlyReadable(bool);
-//![prop funcs]
-
-//![isfolder]
- Q_INVOKABLE bool isFolder(int index) const;
-//![isfolder]
-
-//![parserstatus]
- virtual void classBegin();
- virtual void componentComplete();
-//![parserstatus]
-
-//![notifier]
-Q_SIGNALS:
- void folderChanged();
- void countChanged();
-//![notifier]
-
-//![class end]
-private Q_SLOTS:
- void refresh();
- void inserted(const QModelIndex &index, int start, int end);
- void removed(const QModelIndex &index, int start, int end);
- void handleDataChanged(const QModelIndex &start, const QModelIndex &end);
-
-private:
- Q_DISABLE_COPY(QDeclarativeFolderListModel)
- QDeclarativeFolderListModelPrivate *d;
-};
-//![class end]
-
-QT_END_NAMESPACE
-
-//![qml decl]
-QML_DECLARE_TYPE(QDeclarativeFolderListModel)
-//![qml decl]
-
-#endif // QT_NO_DIRMODEL
-
-#endif // QDECLARATIVEFOLDERLISTMODEL_H
diff --git a/src/libs/qtcomponents/styleitem/qrangemodel.cpp b/src/libs/qtcomponents/styleitem/qrangemodel.cpp
deleted file mode 100644
index 03f5758fb1..0000000000
--- a/src/libs/qtcomponents/styleitem/qrangemodel.cpp
+++ /dev/null
@@ -1,523 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-/*!
- \class QRangeModel
- \brief The QRangeModel class helps users to build components that depend
- on some value and/or position to be in a certain range previously defined.
-
- With this class, the user sets a value range and a position range, which
- represent the valid values/positions the model can assume. It is worth telling
- that the value property always has priority over the position property. A nice use
- case, would be a Slider implementation with the help of QRangeModel. If the user sets
- a value range to [0,100], a position range to [50,100] and sets the value
- to 80, the equivalent position would be 90. After that, if the user decides to
- resize the slider, the value would be the same, but the knob position would
- be updated due to the new position range.
-
- \ingroup qt-components
-*/
-
-#include <QEvent>
-#include <QApplication>
-#include <QGraphicsSceneEvent>
-#include <QDebug>
-
-#ifndef QT_NO_ACCESSIBILITY
-#include <QAccessible>
-#endif
-
-#include "qrangemodel.h"
-#include "qrangemodel_p.h"
-
-QRangeModelPrivate::QRangeModelPrivate(QRangeModel *qq)
- : q_ptr(qq)
-{
-}
-
-QRangeModelPrivate::~QRangeModelPrivate()
-{
-}
-
-void QRangeModelPrivate::init()
-{
- minimum = 0;
- maximum = 99;
- stepSize = 0;
- value = 0;
- pos = 0;
- posatmin = 0;
- posatmax = 0;
- inverted = false;
-}
-
-/*!
- Calculates the position that is going to be seen outside by the component
- that is using QRangeModel. It takes into account the \l stepSize,
- \l positionAtMinimum, \l positionAtMaximum properties
- and \a position that is passed as parameter.
-*/
-
-qreal QRangeModelPrivate::publicPosition(qreal position) const
-{
- // Calculate the equivalent stepSize for the position property.
- const qreal min = effectivePosAtMin();
- const qreal max = effectivePosAtMax();
- const qreal valueRange = maximum - minimum;
- const qreal positionValueRatio = valueRange ? (max - min) / valueRange : 0;
- const qreal positionStep = stepSize * positionValueRatio;
-
- if (positionStep == 0)
- return (min < max) ? qBound(min, position, max) : qBound(max, position, min);
-
- const int stepSizeMultiplier = (position - min) / positionStep;
-
- // Test whether value is below minimum range
- if (stepSizeMultiplier < 0)
- return min;
-
- qreal leftEdge = (stepSizeMultiplier * positionStep) + min;
- qreal rightEdge = ((stepSizeMultiplier + 1) * positionStep) + min;
-
- if (min < max) {
- leftEdge = qMin(leftEdge, max);
- rightEdge = qMin(rightEdge, max);
- } else {
- leftEdge = qMax(leftEdge, max);
- rightEdge = qMax(rightEdge, max);
- }
-
- if (qAbs(leftEdge - position) <= qAbs(rightEdge - position))
- return leftEdge;
- return rightEdge;
-}
-
-/*!
- Calculates the value that is going to be seen outside by the component
- that is using QRangeModel. It takes into account the \l stepSize,
- \l minimumValue, \l maximumValue properties
- and \a value that is passed as parameter.
-*/
-
-qreal QRangeModelPrivate::publicValue(qreal value) const
-{
- // It is important to do value-within-range check this
- // late (as opposed to during setPosition()). The reason is
- // QML bindings; a position that is initially invalid because it lays
- // outside the range, might become valid later if the range changes.
-
- if (stepSize == 0)
- return qBound(minimum, value, maximum);
-
- const int stepSizeMultiplier = (value - minimum) / stepSize;
-
- // Test whether value is below minimum range
- if (stepSizeMultiplier < 0)
- return minimum;
-
- const qreal leftEdge = qMin(maximum, (stepSizeMultiplier * stepSize) + minimum);
- const qreal rightEdge = qMin(maximum, ((stepSizeMultiplier + 1) * stepSize) + minimum);
- const qreal middle = (leftEdge + rightEdge) / 2;
-
- return (value <= middle) ? leftEdge : rightEdge;
-}
-
-/*!
- Checks if the \l value or \l position, that is seen by the user, has changed and emits the changed signal if it
- has changed.
-*/
-
-void QRangeModelPrivate::emitValueAndPositionIfChanged(const qreal oldValue, const qreal oldPosition)
-{
- Q_Q(QRangeModel);
-
- // Effective value and position might have changed even in cases when e.g. d->value is
- // unchanged. This will be the case when operating with values outside range:
- const qreal newValue = q->value();
- const qreal newPosition = q->position();
- if (!qFuzzyCompare(newValue, oldValue))
- emit q->valueChanged(newValue);
- if (!qFuzzyCompare(newPosition, oldPosition))
- emit q->positionChanged(newPosition);
-}
-
-/*!
- Constructs a QRangeModel with \a parent.
-*/
-
-QRangeModel::QRangeModel(QObject *parent)
- : QObject(parent), d_ptr(new QRangeModelPrivate(this))
-{
- Q_D(QRangeModel);
- d->init();
-}
-
-/*!
- \internal
- Constructs a QRangeModel with private class pointer \a dd and \a parent.
-*/
-
-QRangeModel::QRangeModel(QRangeModelPrivate &dd, QObject *parent)
- : QObject(parent), d_ptr(&dd)
-{
- Q_D(QRangeModel);
- d->init();
-}
-
-/*!
- Destroys the QRangeModel
-*/
-
-QRangeModel::~QRangeModel()
-{
- delete d_ptr;
- d_ptr = 0;
-}
-
-/*!
- Sets the range of valid positions, that \l position can assume externally, with
- \a min and \a max.
- Such range is represented by \l positionAtMinimum and \l positionAtMaximum.
-*/
-
-void QRangeModel::setPositionRange(qreal min, qreal max)
-{
- Q_D(QRangeModel);
-
- bool emitPosAtMinChanged = !qFuzzyCompare(min, d->posatmin);
- bool emitPosAtMaxChanged = !qFuzzyCompare(max, d->posatmax);
-
- if (!(emitPosAtMinChanged || emitPosAtMaxChanged))
- return;
-
- const qreal oldPosition = position();
- d->posatmin = min;
- d->posatmax = max;
-
- // When a new positionRange is defined, the position property must be updated based on the value property.
- // For instance, imagine that you have a valueRange of [0,100] and a position range of [20,100],
- // if a user set the value to 50, the position would be 60. If this positionRange is updated to [0,100], then
- // the new position, based on the value (50), will be 50.
- // If the newPosition is different than the old one, it must be updated, in order to emit
- // the positionChanged signal.
- d->pos = d->equivalentPosition(d->value);
-
- if (emitPosAtMinChanged)
- emit positionAtMinimumChanged(d->posatmin);
- if (emitPosAtMaxChanged)
- emit positionAtMaximumChanged(d->posatmax);
-
- d->emitValueAndPositionIfChanged(value(), oldPosition);
-}
-/*!
- Sets the range of valid values, that \l value can assume externally, with
- \a min and \a max. The range has the following constraint: \a min must be less or equal \a max
- Such range is represented by \l minimumValue and \l maximumValue.
-*/
-
-void QRangeModel::setRange(qreal min, qreal max)
-{
- Q_D(QRangeModel);
-
- bool emitMinimumChanged = !qFuzzyCompare(min, d->minimum);
- bool emitMaximumChanged = !qFuzzyCompare(max, d->maximum);
-
- if (!(emitMinimumChanged || emitMaximumChanged))
- return;
-
- const qreal oldValue = value();
- const qreal oldPosition = position();
-
- d->minimum = min;
- d->maximum = qMax(min, max);
-
- // Update internal position if it was changed. It can occurs if internal value changes, due to range update
- d->pos = d->equivalentPosition(d->value);
-
- if (emitMinimumChanged)
- emit minimumChanged(d->minimum);
- if (emitMaximumChanged)
- emit maximumChanged(d->maximum);
-
- d->emitValueAndPositionIfChanged(oldValue, oldPosition);
-}
-
-/*!
- \property QRangeModel::minimumValue
- \brief the minimum value that \l value can assume
-
- This property's default value is 0
-*/
-
-void QRangeModel::setMinimum(qreal min)
-{
- Q_D(const QRangeModel);
- setRange(min, d->maximum);
-}
-
-qreal QRangeModel::minimum() const
-{
- Q_D(const QRangeModel);
- return d->minimum;
-}
-
-/*!
- \property QRangeModel::maximumValue
- \brief the maximum value that \l value can assume
-
- This property's default value is 99
-*/
-
-void QRangeModel::setMaximum(qreal max)
-{
- Q_D(const QRangeModel);
- // if the new maximum value is smaller than
- // minimum, update minimum too
- setRange(qMin(d->minimum, max), max);
-}
-
-qreal QRangeModel::maximum() const
-{
- Q_D(const QRangeModel);
- return d->maximum;
-}
-
-/*!
- \property QRangeModel::stepSize
- \brief the value that is added to the \l value and \l position property
-
- Example: If a user sets a range of [0,100] and stepSize
- to 30, the valid values that are going to be seen externally would be: 0, 30, 60, 90, 100.
-*/
-
-void QRangeModel::setStepSize(qreal stepSize)
-{
- Q_D(QRangeModel);
-
- stepSize = qMax(qreal(0.0), stepSize);
- if (qFuzzyCompare(stepSize, d->stepSize))
- return;
-
- const qreal oldValue = value();
- const qreal oldPosition = position();
- d->stepSize = stepSize;
-
- emit stepSizeChanged(d->stepSize);
- d->emitValueAndPositionIfChanged(oldValue, oldPosition);
-}
-
-qreal QRangeModel::stepSize() const
-{
- Q_D(const QRangeModel);
- return d->stepSize;
-}
-
-/*!
- Returns a valid position, respecting the \l positionAtMinimum,
- \l positionAtMaximum and the \l stepSize properties.
- Such calculation is based on the parameter \a value (which is valid externally).
-*/
-
-qreal QRangeModel::positionForValue(qreal value) const
-{
- Q_D(const QRangeModel);
-
- const qreal unconstrainedPosition = d->equivalentPosition(value);
- return d->publicPosition(unconstrainedPosition);
-}
-
-/*!
- \property QRangeModel::position
- \brief the current position of the model
-
- Represents a valid external position, based on the \l positionAtMinimum,
- \l positionAtMaximum and the \l stepSize properties.
- The user can set it internally with a position, that is not within the current position range,
- since it can become valid if the user changes the position range later.
-*/
-
-qreal QRangeModel::position() const
-{
- Q_D(const QRangeModel);
-
- // Return the internal position but observe boundaries and
- // stepSize restrictions.
- return d->publicPosition(d->pos);
-}
-
-void QRangeModel::setPosition(qreal newPosition)
-{
- Q_D(QRangeModel);
-
- if (qFuzzyCompare(newPosition, d->pos))
- return;
-
- const qreal oldPosition = position();
- const qreal oldValue = value();
-
- // Update position and calculate new value
- d->pos = newPosition;
- d->value = d->equivalentValue(d->pos);
- d->emitValueAndPositionIfChanged(oldValue, oldPosition);
-}
-
-/*!
- \property QRangeModel::positionAtMinimum
- \brief the minimum value that \l position can assume
-
- This property's default value is 0
-*/
-
-void QRangeModel::setPositionAtMinimum(qreal min)
-{
- Q_D(QRangeModel);
- setPositionRange(min, d->posatmax);
-}
-
-qreal QRangeModel::positionAtMinimum() const
-{
- Q_D(const QRangeModel);
- return d->posatmin;
-}
-
-/*!
- \property QRangeModel::positionAtMaximum
- \brief the maximum value that \l position can assume
-
- This property's default value is 0
-*/
-
-void QRangeModel::setPositionAtMaximum(qreal max)
-{
- Q_D(QRangeModel);
- setPositionRange(d->posatmin, max);
-}
-
-qreal QRangeModel::positionAtMaximum() const
-{
- Q_D(const QRangeModel);
- return d->posatmax;
-}
-
-/*!
- Returns a valid value, respecting the \l minimumValue,
- \l maximumValue and the \l stepSize properties.
- Such calculation is based on the parameter \a position (which is valid externally).
-*/
-
-qreal QRangeModel::valueForPosition(qreal position) const
-{
- Q_D(const QRangeModel);
-
- const qreal unconstrainedValue = d->equivalentValue(position);
- return d->publicValue(unconstrainedValue);
-}
-
-/*!
- \property QRangeModel::value
- \brief the current value of the model
-
- Represents a valid external value, based on the \l minimumValue,
- \l maximumValue and the \l stepSize properties.
- The user can set it internally with a value, that is not within the current range,
- since it can become valid if the user changes the range later.
-*/
-
-qreal QRangeModel::value() const
-{
- Q_D(const QRangeModel);
-
- // Return internal value but observe boundaries and
- // stepSize restrictions
- return d->publicValue(d->value);
-}
-
-void QRangeModel::setValue(qreal newValue)
-{
- Q_D(QRangeModel);
-
- if (qFuzzyCompare(newValue, d->value))
- return;
-
- const qreal oldValue = value();
- const qreal oldPosition = position();
-
- // Update relative value and position
- d->value = newValue;
- d->pos = d->equivalentPosition(d->value);
- d->emitValueAndPositionIfChanged(oldValue, oldPosition);
-}
-
-/*!
- \property QRangeModel::inverted
- \brief whether the model is inverted or not
-
- The model can be represented with an inverted behavior, e.g. when \l value assumes
- the maximum value (represented by \l maximumValue) the \l position will be at its
- minimum (represented by \l positionAtMinimum).
-*/
-
-void QRangeModel::setInverted(bool inverted)
-{
- Q_D(QRangeModel);
- if (inverted == d->inverted)
- return;
-
- d->inverted = inverted;
- emit invertedChanged(d->inverted);
-
- // After updating the internal value, the position property can change.
- setPosition(d->equivalentPosition(d->value));
-}
-
-bool QRangeModel::inverted() const
-{
- Q_D(const QRangeModel);
- return d->inverted;
-}
-
-/*!
- Sets the \l value to \l minimumValue.
-*/
-
-void QRangeModel::toMinimum()
-{
- Q_D(const QRangeModel);
- setValue(d->minimum);
-}
-
-/*!
- Sets the \l value to \l maximumValue.
-*/
-
-void QRangeModel::toMaximum()
-{
- Q_D(const QRangeModel);
- setValue(d->maximum);
-}
diff --git a/src/libs/qtcomponents/styleitem/qrangemodel.h b/src/libs/qtcomponents/styleitem/qrangemodel.h
deleted file mode 100644
index 26d7b56968..0000000000
--- a/src/libs/qtcomponents/styleitem/qrangemodel.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef QRANGEMODEL_H
-#define QRANGEMODEL_H
-
-#include <qobject.h>
-#include <qgraphicsitem.h>
-#include <qabstractslider.h>
-#include <qdeclarative.h>
-
-class QRangeModelPrivate;
-
-class QRangeModel : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged USER true)
- Q_PROPERTY(qreal minimumValue READ minimum WRITE setMinimum NOTIFY minimumChanged)
- Q_PROPERTY(qreal maximumValue READ maximum WRITE setMaximum NOTIFY maximumChanged)
- Q_PROPERTY(qreal stepSize READ stepSize WRITE setStepSize NOTIFY stepSizeChanged)
- Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged)
- Q_PROPERTY(qreal positionAtMinimum READ positionAtMinimum WRITE setPositionAtMinimum NOTIFY positionAtMinimumChanged)
- Q_PROPERTY(qreal positionAtMaximum READ positionAtMaximum WRITE setPositionAtMaximum NOTIFY positionAtMaximumChanged)
- Q_PROPERTY(bool inverted READ inverted WRITE setInverted NOTIFY invertedChanged)
-
-public:
- QRangeModel(QObject *parent = 0);
- virtual ~QRangeModel();
-
- void setRange(qreal min, qreal max);
- void setPositionRange(qreal min, qreal max);
-
- void setStepSize(qreal stepSize);
- qreal stepSize() const;
-
- void setMinimum(qreal min);
- qreal minimum() const;
-
- void setMaximum(qreal max);
- qreal maximum() const;
-
- void setPositionAtMinimum(qreal posAtMin);
- qreal positionAtMinimum() const;
-
- void setPositionAtMaximum(qreal posAtMax);
- qreal positionAtMaximum() const;
-
- void setInverted(bool inverted);
- bool inverted() const;
-
- qreal value() const;
- qreal position() const;
-
- Q_INVOKABLE qreal valueForPosition(qreal position) const;
- Q_INVOKABLE qreal positionForValue(qreal value) const;
-
-public Q_SLOTS:
- void toMinimum();
- void toMaximum();
- void setValue(qreal value);
- void setPosition(qreal position);
-
-Q_SIGNALS:
- void valueChanged(qreal value);
- void positionChanged(qreal position);
-
- void stepSizeChanged(qreal stepSize);
-
- void invertedChanged(bool inverted);
-
- void minimumChanged(qreal min);
- void maximumChanged(qreal max);
- void positionAtMinimumChanged(qreal min);
- void positionAtMaximumChanged(qreal max);
-
-protected:
- QRangeModel(QRangeModelPrivate &dd, QObject *parent);
- QRangeModelPrivate* d_ptr;
-
-private:
- Q_DISABLE_COPY(QRangeModel)
- Q_DECLARE_PRIVATE(QRangeModel)
-
-};
-
-QML_DECLARE_TYPE(QRangeModel)
-
-#endif // QRANGEMODEL_H
diff --git a/src/libs/qtcomponents/styleitem/qrangemodel_p.h b/src/libs/qtcomponents/styleitem/qrangemodel_p.h
deleted file mode 100644
index a2a926ca5d..0000000000
--- a/src/libs/qtcomponents/styleitem/qrangemodel_p.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef QRANGEMODEL_P_H
-#define QRANGEMODEL_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt Components API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qrangemodel.h"
-
-class QRangeModelPrivate
-{
- Q_DECLARE_PUBLIC(QRangeModel)
-public:
- QRangeModelPrivate(QRangeModel *qq);
- virtual ~QRangeModelPrivate();
-
- void init();
-
- qreal posatmin, posatmax;
- qreal minimum, maximum, stepSize, pos, value;
-
- uint inverted : 1;
-
- QRangeModel *q_ptr;
-
- inline qreal effectivePosAtMin() const {
- return inverted ? posatmax : posatmin;
- }
-
- inline qreal effectivePosAtMax() const {
- return inverted ? posatmin : posatmax;
- }
-
- inline qreal equivalentPosition(qreal value) const {
- // Return absolute position from absolute value
- const qreal valueRange = maximum - minimum;
- if (valueRange == 0)
- return effectivePosAtMin();
-
- const qreal scale = (effectivePosAtMax() - effectivePosAtMin()) / valueRange;
- return (value - minimum) * scale + effectivePosAtMin();
- }
-
- inline qreal equivalentValue(qreal pos) const {
- // Return absolute value from absolute position
- const qreal posRange = effectivePosAtMax() - effectivePosAtMin();
- if (posRange == 0)
- return minimum;
-
- const qreal scale = (maximum - minimum) / posRange;
- return (pos - effectivePosAtMin()) * scale + minimum;
- }
-
- qreal publicPosition(qreal position) const;
- qreal publicValue(qreal value) const;
- void emitValueAndPositionIfChanged(const qreal oldValue, const qreal oldPosition);
-};
-
-#endif // QRANGEMODEL_P_H
diff --git a/src/libs/qtcomponents/styleitem/qstyleitem.cpp b/src/libs/qtcomponents/styleitem/qstyleitem.cpp
deleted file mode 100644
index ecdde82d11..0000000000
--- a/src/libs/qtcomponents/styleitem/qstyleitem.cpp
+++ /dev/null
@@ -1,1067 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTgall
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qstyleitem.h"
-
-#include <QPainter>
-#include <QStyle>
-#include <QStyleOption>
-#include <QApplication>
-#include <QMainWindow>
-#include <QGroupBox>
-#include <QToolBar>
-#include <QMenu>
-#include <QStringBuilder>
-
-
-QStyleItem::QStyleItem(QDeclarativeItem *parent)
- : QDeclarativeItem(parent),
- m_dummywidget(0),
- m_styleoption(0),
- m_itemType(Undefined),
- m_sunken(false),
- m_raised(false),
- m_active(true),
- m_selected(false),
- m_focus(false),
- m_on(false),
- m_horizontal(true),
- m_sharedWidget(false),
- m_minimum(0),
- m_maximum(100),
- m_value(0),
- m_paintMargins(0)
-{
- setFlag(QGraphicsItem::ItemHasNoContents, false);
- setCacheMode(QGraphicsItem::DeviceCoordinateCache);
- setSmooth(true);
-
- connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(focusChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
- connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
-}
-
-QStyleItem::~QStyleItem()
-{
- delete m_styleoption;
- m_styleoption = 0;
-
- if (!m_sharedWidget) {
- delete m_dummywidget;
- m_dummywidget = 0;
- }
-}
-
-void QStyleItem::initStyleOption()
-{
- QString type = elementType();
- if (m_styleoption)
- m_styleoption->state = 0;
-
- switch (m_itemType) {
- case Button: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionButton();
-
- QStyleOptionButton *opt = qstyleoption_cast<QStyleOptionButton*>(m_styleoption);
- opt->text = text();
- opt->features = (activeControl() == QLatin1String("default")) ?
- QStyleOptionButton::DefaultButton :
- QStyleOptionButton::None;
- }
- break;
- case ItemRow: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionViewItemV4();
-
- QStyleOptionViewItemV4 *opt = qstyleoption_cast<QStyleOptionViewItemV4*>(m_styleoption);
- opt->features = 0;
- if (activeControl() == QLatin1String("alternate"))
- opt->features |= QStyleOptionViewItemV2::Alternate;
- }
- break;
-
- case Splitter: {
- if (!m_styleoption)
- m_styleoption = new QStyleOption;
- }
- break;
-
- case Item: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionViewItemV4();
- QStyleOptionViewItemV4 *opt = qstyleoption_cast<QStyleOptionViewItemV4*>(m_styleoption);
- opt->features = QStyleOptionViewItemV4::HasDisplay;
- opt->text = text();
- opt->textElideMode = Qt::ElideRight;
- QPalette pal = m_styleoption->palette;
- pal.setBrush(QPalette::Base, Qt::NoBrush);
- m_styleoption->palette = pal;
- }
- break;
- case Header: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionHeader();
-
- QStyleOptionHeader *opt = qstyleoption_cast<QStyleOptionHeader*>(m_styleoption);
- opt->text = text();
- opt->sortIndicator = activeControl() == QLatin1String("down") ?
- QStyleOptionHeader::SortDown
- : activeControl() == QLatin1String("up") ?
- QStyleOptionHeader::SortUp : QStyleOptionHeader::None;
- if (activeControl() == QLatin1String("beginning"))
- opt->position = QStyleOptionHeader::Beginning;
- else if (activeControl() == QLatin1String("end"))
- opt->position = QStyleOptionHeader::End;
- else if (activeControl() == QLatin1String("only"))
- opt->position = QStyleOptionHeader::OnlyOneSection;
- else
- opt->position = QStyleOptionHeader::Middle;
-
- }
- break;
- case ToolButton :{
- if (!m_styleoption)
- m_styleoption = new QStyleOptionToolButton();
-
- QStyleOptionToolButton *opt =
- qstyleoption_cast<QStyleOptionToolButton*>(m_styleoption);
- opt->subControls = QStyle::SC_ToolButton;
- opt->state |= QStyle::State_AutoRaise;
- opt->activeSubControls = QStyle::SC_ToolButton;
- }
- break;
- case ToolBar: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionToolBar();
- }
- break;
- case Tab: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionTabV3();
-
- QStyleOptionTabV3 *opt =
- qstyleoption_cast<QStyleOptionTabV3*>(m_styleoption);
- opt->text = text();
- opt->shape = info() == QLatin1String("South") ? QTabBar::RoundedSouth : QTabBar::RoundedNorth;
- if (activeControl() == QLatin1String("beginning"))
- opt->position = QStyleOptionTabV3::Beginning;
- else if (activeControl() == QLatin1String("end"))
- opt->position = QStyleOptionTabV3::End;
- else if (activeControl() == QLatin1String("only"))
- opt->position = QStyleOptionTabV3::OnlyOneTab;
- else
- opt->position = QStyleOptionTabV3::Middle;
-
- } break;
-
- case Menu: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionMenuItem();
- }
- break;
- case Frame: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionFrameV3();
-
- QStyleOptionFrameV3 *opt = qstyleoption_cast<QStyleOptionFrameV3*>(m_styleoption);
- opt->frameShape = QFrame::StyledPanel;
- opt->lineWidth = 1;
- opt->midLineWidth = 1;
- }
- break;
- case TabFrame: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionTabWidgetFrameV2();
- QStyleOptionTabWidgetFrameV2 *opt = qstyleoption_cast<QStyleOptionTabWidgetFrameV2*>(m_styleoption);
- opt->shape = (info() == QLatin1String("South")) ? QTabBar::RoundedSouth : QTabBar::RoundedNorth;
- if (minimum())
- opt->selectedTabRect = QRect(value(), 0, minimum(), height());
- opt->tabBarSize = QSize(minimum() , height());
- // oxygen style needs this hack
- opt->leftCornerWidgetSize = QSize(value(), 0);
- }
- break;
- case MenuItem:
- case ComboBoxItem:
- {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionMenuItem();
-
- QStyleOptionMenuItem *opt = qstyleoption_cast<QStyleOptionMenuItem*>(m_styleoption);
- opt->checked = false;
- opt->text = text();
- opt->palette = widget()->palette();
- }
- break;
- case CheckBox:
- case RadioButton:
- {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionButton();
-
- QStyleOptionButton *opt = qstyleoption_cast<QStyleOptionButton*>(m_styleoption);
- if (!on())
- opt->state |= QStyle::State_Off;
- opt->text = text();
- }
- break;
- case Edit: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionFrameV3();
-
- QStyleOptionFrameV3 *opt = qstyleoption_cast<QStyleOptionFrameV3*>(m_styleoption);
- opt->lineWidth = 1; // this must be non-zero
- }
- break;
- case ComboBox :{
- if (!m_styleoption)
- m_styleoption = new QStyleOptionComboBox();
- QStyleOptionComboBox *opt = qstyleoption_cast<QStyleOptionComboBox*>(m_styleoption);
- opt->currentText = text();
- }
- break;
- case SpinBox: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionSpinBox();
-
- QStyleOptionSpinBox *opt = qstyleoption_cast<QStyleOptionSpinBox*>(m_styleoption);
- opt->frame = true;
- if (value() & 0x1)
- opt->activeSubControls = QStyle::SC_SpinBoxUp;
- else if (value() & (1<<1))
- opt->activeSubControls = QStyle::SC_SpinBoxDown;
- opt->subControls = QStyle::SC_All;
- opt->stepEnabled = 0;
- if (value() & (1<<2))
- opt->stepEnabled |= QAbstractSpinBox::StepUpEnabled;
- if (value() & (1<<3))
- opt->stepEnabled |= QAbstractSpinBox::StepDownEnabled;
- }
- break;
- case Slider:
- case Dial:
- {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionSlider();
-
- QStyleOptionSlider *opt = qstyleoption_cast<QStyleOptionSlider*>(m_styleoption);
- opt->minimum = minimum();
- opt->maximum = maximum();
- // ### fixme - workaround for KDE inverted dial
- opt->sliderPosition = value();
- opt->singleStep = step();
-
- if (opt->singleStep)
- {
- qreal numOfSteps = (opt->maximum - opt->minimum) / opt->singleStep;
-
- // at least 5 pixels between tick marks
- if (numOfSteps && (width() / numOfSteps < 5))
- opt->tickInterval = qRound((5*numOfSteps / width()) + 0.5)*step();
- else
- opt->tickInterval = opt->singleStep;
- }
- else // default Qt-components implementation
- opt->tickInterval = opt->maximum != opt->minimum ? 1200 / (opt->maximum - opt->minimum) : 0;
-
- if (style() == QLatin1String("oxygen") && type == QLatin1String("dial"))
- opt->sliderValue = maximum() - value();
- else
- opt->sliderValue = value();
- opt->subControls = QStyle::SC_SliderGroove | QStyle::SC_SliderHandle;
- opt->tickPosition = (activeControl() == QLatin1String("below")) ?
- QSlider::TicksBelow : (activeControl() == QLatin1String("above") ?
- QSlider::TicksAbove:
- QSlider::NoTicks);
- if (opt->tickPosition != QSlider::NoTicks)
- opt->subControls |= QStyle::SC_SliderTickmarks;
-
- opt->activeSubControls = QStyle::SC_None;
- }
- break;
- case ProgressBar: {
- if (QProgressBar *bar= qobject_cast<QProgressBar*>(widget())){
- bar->setMaximum(maximum());
- bar->setMinimum(minimum());
- if (maximum() != minimum())
- bar->setValue(1);
- }
- if (!m_styleoption)
- m_styleoption = new QStyleOptionProgressBarV2();
-
- QStyleOptionProgressBarV2 *opt = qstyleoption_cast<QStyleOptionProgressBarV2*>(m_styleoption);
- opt->orientation = horizontal() ? Qt::Horizontal : Qt::Vertical;
- opt->minimum = minimum();
- opt->maximum = maximum();
- opt->progress = value();
- }
- break;
- case GroupBox: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionGroupBox();
-
- QStyleOptionGroupBox *opt = qstyleoption_cast<QStyleOptionGroupBox*>(m_styleoption);
- opt->text = text();
- opt->lineWidth = 1;
- opt->subControls = QStyle::SC_GroupBoxLabel;
- if (sunken()) // Qt draws an ugly line here so I ignore it
- opt->subControls |= QStyle::SC_GroupBoxFrame;
- else
- opt->features |= QStyleOptionFrameV2::Flat;
- if (activeControl() == QLatin1String("checkbox"))
- opt->subControls |= QStyle::SC_GroupBoxCheckBox;
-
- if (QGroupBox *group= qobject_cast<QGroupBox*>(widget())) {
- group->setTitle(text());
- group->setCheckable(opt->subControls & QStyle::SC_GroupBoxCheckBox);
- }
- }
- break;
- case ScrollBar: {
- if (!m_styleoption)
- m_styleoption = new QStyleOptionSlider();
-
- QStyleOptionSlider *opt = qstyleoption_cast<QStyleOptionSlider*>(m_styleoption);
- opt->minimum = minimum();
- opt->maximum = maximum();
- opt->pageStep = horizontal() ? width() : height();
- opt->orientation = horizontal() ? Qt::Horizontal : Qt::Vertical;
- opt->sliderPosition = value();
- opt->sliderValue = value();
- opt->activeSubControls = (activeControl() == QLatin1String("up"))
- ? QStyle::SC_ScrollBarSubLine :
- (activeControl() == QLatin1String("down")) ?
- QStyle::SC_ScrollBarAddLine:
- QStyle::SC_ScrollBarSlider;
-
- opt->sliderValue = value();
- opt->subControls = QStyle::SC_All;
-
- QScrollBar *bar = qobject_cast<QScrollBar *>(widget());
- bar->setMaximum(maximum());
- bar->setMinimum(minimum());
- bar->setValue(value());
- }
- break;
- default:
- break;
- }
-
- if (!m_styleoption)
- m_styleoption = new QStyleOption();
-
- m_styleoption->rect = QRect(m_paintMargins, m_paintMargins, width() - 2* m_paintMargins, height() - 2 * m_paintMargins);
-#if QT_VERSION >= 0x050000
- m_styleoption->styleObject = this;
-#endif
-
- if (isEnabled())
- m_styleoption->state |= QStyle::State_Enabled;
- if (m_active)
- m_styleoption->state |= QStyle::State_Active;
- if (m_sunken)
- m_styleoption->state |= QStyle::State_Sunken;
- if (m_raised)
- m_styleoption->state |= QStyle::State_Raised;
- if (m_selected)
- m_styleoption->state |= QStyle::State_Selected;
- if (m_focus)
- m_styleoption->state |= QStyle::State_HasFocus;
- if (m_on)
- m_styleoption->state |= QStyle::State_On;
- if (m_hover)
- m_styleoption->state |= QStyle::State_MouseOver;
- if (m_horizontal)
- m_styleoption->state |= QStyle::State_Horizontal;
-
- if (widget()) {
- widget()->ensurePolished();
- if (type == QLatin1String("tab") && style() != QLatin1String("mac")) {
- // Some styles actually check the beginning and end position
- // using widget geometry, so we have to trick it
- widget()->setGeometry(0, 0, width(), height());
- if (activeControl() != QLatin1String("beginning"))
- m_styleoption->rect.translate(1, 0); // Don't position at start of widget
- if (activeControl() != QLatin1String("end"))
- widget()->resize(200, height());
- }
-#ifdef Q_WS_WIN
- else widget()->resize(width(), height());
-#endif
-
- widget()->setEnabled(isEnabled());
- m_styleoption->fontMetrics = widget()->fontMetrics();
- if (!m_styleoption->palette.resolve())
- m_styleoption->palette = widget()->palette();
- if (m_hint.contains(QLatin1String("mac.mini")))
- widget()->setAttribute(Qt::WA_MacMiniSize);
- else if (m_hint.contains(QLatin1String("mac.small")))
- widget()->setAttribute(Qt::WA_MacSmallSize);
- }
-}
-
-/*
- * Property style
- *
- * Returns a simplified style name.
- *
- * QMacStyle = "mac"
- * QWindowsXPStyle = "windowsxp"
- * QPlastiqueStyle = "plastique"
- */
-
-QString QStyleItem::style() const
-{
- QByteArray style = qApp->style()->metaObject()->className();
- style = style.toLower();
- if (style.contains("oxygen"))
- return QLatin1String("oxygen");
- if (style.startsWith('q'))
- style.remove(0, 1);
- if (style.endsWith("style"))
- style.chop(5);
- return QLatin1String(style);
-}
-
-QString QStyleItem::hitTest(int px, int py)
-{
- QStyle::SubControl subcontrol = QStyle::SC_All;
- initStyleOption();
- switch (m_itemType) {
- case SpinBox :{
- subcontrol = qApp->style()->hitTestComplexControl(QStyle::CC_SpinBox,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- QPoint(px,py), 0);
- if (subcontrol == QStyle::SC_SpinBoxUp)
- return QLatin1String("up");
- else if (subcontrol == QStyle::SC_SpinBoxDown)
- return QLatin1String("down");
-
- }
- break;
-
- case Slider: {
- subcontrol = qApp->style()->hitTestComplexControl(QStyle::CC_Slider,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- QPoint(px,py), 0);
- if (subcontrol == QStyle::SC_SliderHandle)
- return QLatin1String("handle");
-
- }
- break;
- case ScrollBar: {
- subcontrol = qApp->style()->hitTestComplexControl(QStyle::CC_ScrollBar,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- QPoint(px,py), 0);
- if (subcontrol == QStyle::SC_ScrollBarSlider)
- return QLatin1String("handle");
-
- if (subcontrol == QStyle::SC_ScrollBarSubLine)
- return QLatin1String("up");
- else if (subcontrol == QStyle::SC_ScrollBarSubPage)
- return QLatin1String("upPage");
-
- if (subcontrol == QStyle::SC_ScrollBarAddLine)
- return QLatin1String("down");
- else if (subcontrol == QStyle::SC_ScrollBarAddPage)
- return QLatin1String("downPage");
- }
- break;
- default:
- break;
- }
- return QLatin1String("none");
-}
-
-QSize QStyleItem::sizeFromContents(int width, int height)
-{
- initStyleOption();
-
- QSize size;
- switch (m_itemType) {
- case CheckBox:
- size = qApp->style()->sizeFromContents(QStyle::CT_CheckBox, m_styleoption, QSize(width,height), widget());
- break;
- case ToolButton:
- size = qApp->style()->sizeFromContents(QStyle::CT_ToolButton, m_styleoption, QSize(width,height), widget());
- break;
- case Button:
- size = qApp->style()->sizeFromContents(QStyle::CT_PushButton, m_styleoption, QSize(width,height), widget());
- break;
- case Tab:
- size = qApp->style()->sizeFromContents(QStyle::CT_TabBarTab, m_styleoption, QSize(width,height), widget());
- break;
- case ComboBox:
- size = qApp->style()->sizeFromContents(QStyle::CT_ComboBox, m_styleoption, QSize(width,height), widget());
- break;
- case SpinBox:
- size = qApp->style()->sizeFromContents(QStyle::CT_SpinBox, m_styleoption, QSize(width,height), widget());
- break;
- case Slider:
- size = qApp->style()->sizeFromContents(QStyle::CT_Slider, m_styleoption, QSize(width,height), widget());
- break;
- case ProgressBar:
- size = qApp->style()->sizeFromContents(QStyle::CT_ProgressBar, m_styleoption, QSize(width,height), widget());
- break;
- case Edit:
- size = qApp->style()->sizeFromContents(QStyle::CT_LineEdit, m_styleoption, QSize(width,height), widget());
- break;
- case GroupBox:
- size = qApp->style()->sizeFromContents(QStyle::CT_GroupBox, m_styleoption, QSize(width,height), widget());
- break;
- case Header:
- size = qApp->style()->sizeFromContents(QStyle::CT_HeaderSection, m_styleoption, QSize(width,height), widget());
-#ifdef Q_OS_MAC
- if (style() == QLatin1String("mac"))
- size.setHeight(15);
-#endif
- break;
- case ItemRow:
- case Item: //fall through
- size = qApp->style()->sizeFromContents(QStyle::CT_ItemViewItem, m_styleoption, QSize(width,height), widget());
- break;
- default:
- break;
- }
-
-#ifdef Q_OS_MAC
- // ### hack - With even heights, the text baseline is off on mac
- if (size.height() %2 == 0)
- size.setHeight(size.height() + 1);
-#endif
- return size;
-}
-
-
-int QStyleItem::pixelMetric(const QString &metric)
-{
-
- if (metric == QLatin1String("scrollbarExtent"))
- return qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, widget());
- else if (metric == QLatin1String("defaultframewidth"))
- return qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, widget());
- else if (metric == QLatin1String("taboverlap"))
- return qApp->style()->pixelMetric(QStyle::PM_TabBarTabOverlap, 0 , widget());
- else if (metric == QLatin1String("tabbaseoverlap"))
-#ifdef Q_WS_WIN
- // On windows the tabbar paintmargin extends the overlap by one pixels
- return 1 + qApp->style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, 0 , widget());
-#else
- return qApp->style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, 0 , widget());
-#endif
- else if (metric == QLatin1String("tabhspace"))
- return qApp->style()->pixelMetric(QStyle::PM_TabBarTabHSpace, 0 , widget());
- else if (metric == QLatin1String("tabvspace"))
- return qApp->style()->pixelMetric(QStyle::PM_TabBarTabVSpace, 0 , widget());
- else if (metric == QLatin1String("tabbaseheight"))
- return qApp->style()->pixelMetric(QStyle::PM_TabBarBaseHeight, 0 , widget());
- else if (metric == QLatin1String("tabvshift"))
- return qApp->style()->pixelMetric(QStyle::PM_TabBarTabShiftVertical, 0 , widget());
- else if (metric == QLatin1String("menuhmargin"))
- return qApp->style()->pixelMetric(QStyle::PM_MenuHMargin, 0 , widget());
- else if (metric == QLatin1String("menuvmargin"))
- return qApp->style()->pixelMetric(QStyle::PM_MenuVMargin, 0 , widget());
- else if (metric == QLatin1String("menupanelwidth"))
- return qApp->style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0 , widget());
- else if (metric == QLatin1String("splitterwidth"))
- return qApp->style()->pixelMetric(QStyle::PM_SplitterWidth, 0 , widget());
- // This metric is incorrectly negative on oxygen
- else if (metric == QLatin1String("scrollbarspacing"))
- return abs(qApp->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarSpacing, 0 , widget()));
- return 0;
-}
-
-QVariant QStyleItem::styleHint(const QString &metric)
-{
- initStyleOption();
- if (metric == QLatin1String("comboboxpopup")) {
- return qApp->style()->styleHint(QStyle::SH_ComboBox_Popup, m_styleoption);
- } else if (metric == QLatin1String("highlightedTextColor")) {
- if (widget())
- return widget()->palette().highlightedText().color().name();
- return qApp->palette().highlightedText().color().name();
- } else if (metric == QLatin1String("textColor")) {
- if (widget())
- return widget()->palette().text().color().name();
- return qApp->palette().text().color().name();
- } else if (metric == QLatin1String("focuswidget")) {
- return qApp->style()->styleHint(QStyle::SH_FocusFrame_AboveWidget);
- } else if (metric == QLatin1String("tabbaralignment")) {
- int result = qApp->style()->styleHint(QStyle::SH_TabBar_Alignment);
- if (result == Qt::AlignCenter)
- return QLatin1String("center");
- return QLatin1String("left");
- } else if (metric == QLatin1String("framearoundcontents")) {
- return qApp->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents);
- } else if (metric == QLatin1String("scrollToClickPosition"))
- return qApp->style()->styleHint(QStyle::SH_ScrollBar_LeftClickAbsolutePosition);
- return 0;
-}
-
-void QStyleItem::setCursor(const QString &str)
-{
- if (m_cursor != str) {
- m_cursor = str;
- if (m_cursor == QLatin1String("sizehorcursor"))
- QDeclarativeItem::setCursor(Qt::SizeHorCursor);
- else if (m_cursor == QLatin1String("sizevercursor"))
- QDeclarativeItem::setCursor(Qt::SizeVerCursor);
- else if (m_cursor == QLatin1String("sizeallcursor"))
- QDeclarativeItem::setCursor(Qt::SizeAllCursor);
- else if (m_cursor == QLatin1String("splithcursor"))
- QDeclarativeItem::setCursor(Qt::SplitHCursor);
- else if (m_cursor == QLatin1String("splitvcursor"))
- QDeclarativeItem::setCursor(Qt::SplitVCursor);
- else if (m_cursor == QLatin1String("wait"))
- QDeclarativeItem::setCursor(Qt::WaitCursor);
- else if (m_cursor == QLatin1String("pointinghandcursor"))
- QDeclarativeItem::setCursor(Qt::PointingHandCursor);
- emit cursorChanged();
- }
-}
-
-void QStyleItem::setElementType(const QString &str)
-{
- if (m_type == str)
- return;
-
- m_type = str;
-
- emit elementTypeChanged();
-
- if (m_dummywidget && !m_sharedWidget) {
- delete m_dummywidget;
- m_dummywidget = 0;
- }
-
- if (m_styleoption) {
- delete m_styleoption;
- m_styleoption = 0;
- }
-
- // Only enable visible if the widget can animate
- bool visible = false;
- if (str == QLatin1String("menu") || str == QLatin1String("menuitem")) {
- // Since these are used by the delegate, it makes no
- // sense to re-create them per item
- static QWidget *menu = new QMenu();
- m_sharedWidget = true;
- m_dummywidget = menu;
- m_itemType = (str == QLatin1String("menu")) ? Menu : MenuItem;
- } else if (str == QLatin1String("item") || str == QLatin1String("itemrow") || str == QLatin1String("header")) {
- // Since these are used by the delegate, it makes no
- // sense to re-create them per item
- static QTreeView *menu = new QTreeView();
- menu->setAttribute(Qt::WA_MacMiniSize);
- m_sharedWidget = true;
- if (str == QLatin1String("header")) {
- m_dummywidget = menu->header();
- if (style() == QLatin1String("mac")) { // The default qt font seems to big
- QFont font = m_dummywidget->font();
- font.setPointSize(11);
- m_dummywidget->setFont(font);
- }
- m_itemType = Header;
- } else {
- m_dummywidget = menu;
- m_itemType = (str == QLatin1String("item")) ? Item : ItemRow;
- }
- } else if (str == QLatin1String("groupbox")) {
- // Since these are used by the delegate, it makes no
- // sense to re-create them per item
- static QGroupBox *group = new QGroupBox();
- m_sharedWidget = true;
- m_dummywidget = group;
- m_itemType = GroupBox;
- } else if (str == QLatin1String("tabframe") || str == QLatin1String("tab")) {
- static QTabWidget *tabframe = new QTabWidget();
- m_sharedWidget = true;
- if (str == QLatin1String("tab")) {
- m_dummywidget = tabframe->findChild<QTabBar*>();
- m_itemType = Tab;
- } else {
- m_dummywidget = tabframe;
- m_itemType = TabFrame;
- }
- } else if (str == QLatin1String("comboboxitem")) {
- // Gtk uses qobject cast, hence we need to separate this from menuitem
- // On mac, we temporarily use the menu item because it has more accurate
- // palette.
-#ifdef Q_OS_MAC
- static QMenu *combo = new QMenu();
-#else
- static QComboBox *combo = new QComboBox();
-#endif
- m_sharedWidget = true;
- m_dummywidget = combo;
- m_itemType = ComboBoxItem;
- } else if (str == QLatin1String("toolbar")) {
- static QToolBar *tb = 0;
- if (!tb) {
- QMainWindow *mw = new QMainWindow();
- tb = new QToolBar(mw);
- }
- m_dummywidget = tb;
- m_itemType = ToolBar;
- } else if (str == QLatin1String("toolbutton")) {
- static QToolButton *tb = 0;
- static QToolBar *bar = 0;
- // KDE animations are too broken with these widgets
- if (style() != QLatin1String("oxygen")) {
- if (!tb) {
- bar = new QToolBar(0);
- tb = new QToolButton(bar);
- }
- }
- m_sharedWidget = true;
- m_dummywidget = tb;
- m_itemType = ToolButton;
- } else if (str == QLatin1String("slider")) {
- static QSlider *slider = new QSlider();
- m_sharedWidget = true;
- m_dummywidget = slider;
- m_itemType = Slider;
- } else if (str == QLatin1String("frame")) {
- static QFrame *frame = new QFrame();
- m_sharedWidget = true;
- m_dummywidget = frame;
- m_itemType = Frame;
- } else if (str == QLatin1String("combobox")) {
- m_dummywidget = new QComboBox();
- visible = true;
- m_itemType = ComboBox;
- } else if (str == QLatin1String("splitter")) {
- visible = true;
- m_itemType = Splitter;
- } else if (str == QLatin1String("progressbar")) {
- m_dummywidget = new QProgressBar();
- visible = true;
- m_itemType = ProgressBar;
- } else if (str == QLatin1String("button")) {
- m_dummywidget = new QPushButton();
- visible = true;
- m_itemType = Button;
- } else if (str == QLatin1String("checkbox")) {
- m_dummywidget = new QCheckBox();
- visible = true;
- m_itemType = CheckBox;
- } else if (str == QLatin1String("radiobutton")) {
- m_dummywidget = new QRadioButton();
- visible = true;
- m_itemType = RadioButton;
- } else if (str == QLatin1String("edit")) {
- m_dummywidget = new QLineEdit();
- visible = true;
- m_itemType = Edit;
- } else if (str == QLatin1String("spinbox")) {
-#ifndef Q_WS_WIN // Vista spinbox is currently not working due to grabwidget
- m_dummywidget = new QSpinBox();
- visible = true;
-#endif
- m_itemType = SpinBox;
- } else if (str == QLatin1String("scrollbar")) {
- m_dummywidget = new QScrollBar();
- visible = true;
- m_itemType = ScrollBar;
- } else if (str == QLatin1String("widget")) {
- m_itemType = Widget;
- } else if (str == QLatin1String("focusframe")) {
- m_itemType = FocusFrame;
- } else if (str == QLatin1String("dial")) {
- m_itemType = Dial;
- }
- if (m_dummywidget) {
- m_dummywidget->installEventFilter(this);
- m_dummywidget->setAttribute(Qt::WA_QuitOnClose, false); // dont keep app open
- m_dummywidget->setAttribute(Qt::WA_LayoutUsesWidgetRect);
- m_dummywidget->winId();
-#ifdef Q_OS_MAC
- m_dummywidget->setGeometry(-1000, 0, 10,10);
- m_dummywidget->setVisible(visible); // Mac require us to set the visibility before this
-#endif
- m_dummywidget->setAttribute(Qt::WA_DontShowOnScreen);
- m_dummywidget->setVisible(visible);
- }
-}
-
-bool QStyleItem::eventFilter(QObject *o, QEvent *e) {
- if (e->type() == QEvent::Paint) {
- updateItem();
- return true;
- }
- return QObject::eventFilter(o, e);
-}
-
-void QStyleItem::showToolTip(const QString &str)
-{
- QToolTip::showText(QCursor::pos(), str);
-}
-
-QRect QStyleItem::subControlRect(const QString &subcontrolString)
-{
- QStyle::SubControl subcontrol = QStyle::SC_None;
- initStyleOption();
- switch (m_itemType) {
- case SpinBox:
- {
- QStyle::ComplexControl control = QStyle::CC_SpinBox;
- if (subcontrolString == QLatin1String("down"))
- subcontrol = QStyle::SC_SpinBoxDown;
- else if (subcontrolString == QLatin1String("up"))
- subcontrol = QStyle::SC_SpinBoxUp;
- else if (subcontrolString == QLatin1String("edit"))
- subcontrol = QStyle::SC_SpinBoxEditField;
- return qApp->style()->subControlRect(control,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- subcontrol, widget());
-
- }
- break;
- case Slider:
- {
- QStyle::ComplexControl control = QStyle::CC_Slider;
- if (subcontrolString == QLatin1String("handle"))
- subcontrol = QStyle::SC_SliderHandle;
- else if (subcontrolString == QLatin1String("groove"))
- subcontrol = QStyle::SC_SliderGroove;
- return qApp->style()->subControlRect(control,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- subcontrol, widget());
-
- }
- break;
- case ScrollBar:
- {
- QStyle::ComplexControl control = QStyle::CC_ScrollBar;
- if (subcontrolString == QLatin1String("slider"))
- subcontrol = QStyle::SC_ScrollBarSlider;
- if (subcontrolString == QLatin1String("groove"))
- subcontrol = QStyle::SC_ScrollBarGroove;
- else if (subcontrolString == QLatin1String("handle"))
- subcontrol = QStyle::SC_ScrollBarSlider;
- else if (subcontrolString == QLatin1String("add"))
- subcontrol = QStyle::SC_ScrollBarAddPage;
- else if (subcontrolString == QLatin1String("sub"))
- subcontrol = QStyle::SC_ScrollBarSubPage;
- return qApp->style()->subControlRect(control,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- subcontrol, widget());
- }
- break;
- default:
- break;
- }
- return QRect();
-}
-
-void QStyleItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
-{
- if (width() < 1 || height() <1)
- return;
-
- initStyleOption();
-
- if (widget()) {
- painter->save();
- painter->setFont(widget()->font());
- painter->translate(-m_styleoption->rect.left() + m_paintMargins, 0);
- }
-
- switch (m_itemType) {
- case Button:
- qApp->style()->drawControl(QStyle::CE_PushButton, m_styleoption, painter, widget());
- break;
- case ItemRow :{
- QPixmap pixmap;
- // Only draw through style once
- const QString pmKey = QLatin1Literal("itemrow") % QString::number(m_styleoption->state,16) % activeControl();
- if (!QPixmapCache::find(pmKey, pixmap) || pixmap.width() < width() || height() != pixmap.height()) {
- int newSize = width();
- pixmap = QPixmap(newSize, height());
- pixmap.fill(Qt::transparent);
- QPainter pixpainter(&pixmap);
- qApp->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, m_styleoption, &pixpainter, widget());
- if (!qApp->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected) && selected())
- pixpainter.fillRect(m_styleoption->rect, m_styleoption->palette.highlight());
- QPixmapCache::insert(pmKey, pixmap);
- }
- painter->drawPixmap(0, 0, pixmap);
- }
- break;
- case Item:
- qApp->style()->drawControl(QStyle::CE_ItemViewItem, m_styleoption, painter, widget());
- break;
- case Header:
- widget()->resize(m_styleoption->rect.size()); // macstyle explicitly uses the widget height
- qApp->style()->drawControl(QStyle::CE_Header, m_styleoption, painter, widget());
- break;
- case ToolButton:
- qApp->style()->drawComplexControl(QStyle::CC_ToolButton, qstyleoption_cast<QStyleOptionComplex*>(m_styleoption), painter, widget());
- break;
- case Tab:
- qApp->style()->drawControl(QStyle::CE_TabBarTab, m_styleoption, painter, widget());
- break;
- case Frame:
- qApp->style()->drawControl(QStyle::CE_ShapedFrame, m_styleoption, painter, widget());
- break;
- case FocusFrame:
- qApp->style()->drawControl(QStyle::CE_FocusFrame, m_styleoption, painter, widget());
- break;
- case TabFrame:
- qApp->style()->drawPrimitive(QStyle::PE_FrameTabWidget, m_styleoption, painter, widget());
- break;
- case MenuItem:
- case ComboBoxItem: // fall through
- qApp->style()->drawControl(QStyle::CE_MenuItem, m_styleoption, painter, widget());
- break;
- case CheckBox:
- qApp->style()->drawControl(QStyle::CE_CheckBox, m_styleoption, painter, widget());
- break;
- case RadioButton:
- qApp->style()->drawControl(QStyle::CE_RadioButton, m_styleoption, painter, widget());
- break;
- case Edit:
- qApp->style()->drawPrimitive(QStyle::PE_PanelLineEdit, m_styleoption, painter, widget());
- break;
- case Widget:
- qApp->style()->drawPrimitive(QStyle::PE_Widget, m_styleoption, painter, widget());
- break;
- case Splitter:
- qApp->style()->drawControl(QStyle::CE_Splitter, m_styleoption, painter, widget());
- break;
- case ComboBox:
- qApp->style()->drawComplexControl(QStyle::CC_ComboBox,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- painter, widget());
- qApp->style()->drawControl(QStyle::CE_ComboBoxLabel, m_styleoption, painter, widget());
- break;
- case SpinBox:
- qApp->style()->drawComplexControl(QStyle::CC_SpinBox,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- painter, widget());
- break;
- case Slider:
- qApp->style()->drawComplexControl(QStyle::CC_Slider,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- painter, widget());
- break;
- case Dial:
- qApp->style()->drawComplexControl(QStyle::CC_Dial,
- qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
- painter, widget());
- break;
- case ProgressBar:
- qApp->style()->drawControl(QStyle::CE_ProgressBar, m_styleoption, painter, widget());
- break;
- case ToolBar:
- qApp->style()->drawControl(QStyle::CE_ToolBar, m_styleoption, painter, widget());
- break;
- case GroupBox:
- qApp->style()->drawComplexControl(QStyle::CC_GroupBox, qstyleoption_cast<QStyleOptionComplex*>(m_styleoption), painter, widget());
- break;
- case ScrollBar:
- qApp->style()->drawComplexControl(QStyle::CC_ScrollBar, qstyleoption_cast<QStyleOptionComplex*>(m_styleoption), painter, widget());
- break;
- case Menu: {
- if (QMenu *menu = qobject_cast<QMenu*>(widget()))
- m_styleoption->palette = menu->palette();
- QStyleHintReturnMask val;
- qApp->style()->styleHint(QStyle::SH_Menu_Mask, m_styleoption, widget(), &val);
- painter->save();
- painter->setClipRegion(val.region);
- painter->fillRect(m_styleoption->rect, m_styleoption->palette.window());
- painter->restore();
- qApp->style()->drawPrimitive(QStyle::PE_PanelMenu, m_styleoption, painter, widget());
-
- QStyleOptionFrame frame;
- frame.lineWidth = qApp->style()->pixelMetric(QStyle::PM_MenuPanelWidth);
- frame.midLineWidth = 0;
- frame.rect = m_styleoption->rect;
- qApp->style()->drawPrimitive(QStyle::PE_FrameMenu, &frame, painter, widget());
- }
- break;
- default:
- break;
- }
- if (widget())
- painter->restore();
-}
-
-int QStyleItem::textWidth(const QString &text)
-{
- if (widget())
- return widget()->fontMetrics().boundingRect(text).width();
- return qApp->fontMetrics().boundingRect(text).width();
-}
-
-int QStyleItem::fontHeight()
-{
- if (widget())
- return widget()->fontMetrics().height();
- return qApp->fontMetrics().height();
-}
-
-QString QStyleItem::fontFamily()
-{
- if (widget())
- return widget()->font().family();
- return qApp->font().family();
-}
-
-double QStyleItem::fontPointSize()
-{
- if (widget())
- return widget()->font().pointSizeF();
- return qApp->font().pointSizeF();
-}
diff --git a/src/libs/qtcomponents/styleitem/qstyleitem.h b/src/libs/qtcomponents/styleitem/qstyleitem.h
deleted file mode 100644
index 7f472009de..0000000000
--- a/src/libs/qtcomponents/styleitem/qstyleitem.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STYLEWRAPPER_H
-#define STYLEWRAPPER_H
-
-#include <QCheckBox>
-#include <QComboBox>
-#include <QDeclarativeItem>
-#include <QEvent>
-#include <QGraphicsDropShadowEffect>
-#include <QHeaderView>
-#include <QLineEdit>
-#include <QPixmapCache>
-#include <QProgressBar>
-#include <QPushButton>
-#include <QRadioButton>
-#include <QScrollBar>
-#include <QSpinBox>
-#include <QStyle>
-#include <QToolButton>
-#include <QToolTip>
-#include <QTreeView>
-
-class QStyleItem: public QDeclarativeItem
-{
- Q_OBJECT
-
- Q_PROPERTY( bool sunken READ sunken WRITE setSunken NOTIFY sunkenChanged)
- Q_PROPERTY( bool raised READ raised WRITE setRaised NOTIFY raisedChanged)
- Q_PROPERTY( bool active READ active WRITE setActive NOTIFY activeChanged)
- Q_PROPERTY( bool selected READ selected WRITE setSelected NOTIFY selectedChanged)
- Q_PROPERTY( bool focus READ focus WRITE setFocus NOTIFY focusChanged)
- Q_PROPERTY( bool on READ on WRITE setOn NOTIFY onChanged)
- Q_PROPERTY( bool hover READ hover WRITE setHover NOTIFY hoverChanged)
- Q_PROPERTY( bool horizontal READ horizontal WRITE setHorizontal NOTIFY horizontalChanged)
-
- Q_PROPERTY( QString elementType READ elementType WRITE setElementType NOTIFY elementTypeChanged)
- Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged)
- Q_PROPERTY( QString activeControl READ activeControl WRITE setActiveControl NOTIFY activeControlChanged)
- Q_PROPERTY( QString info READ info WRITE setInfo NOTIFY infoChanged)
- Q_PROPERTY( QString style READ style NOTIFY styleChanged)
- Q_PROPERTY( QString hint READ hint WRITE setHint NOTIFY hintChanged)
- Q_PROPERTY( QString cursor READ cursor WRITE setCursor NOTIFY cursorChanged)
-
- // For range controls
- Q_PROPERTY( int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged)
- Q_PROPERTY( int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged)
- Q_PROPERTY( int value READ value WRITE setValue NOTIFY valueChanged)
- Q_PROPERTY( int step READ step WRITE setStep NOTIFY stepChanged)
- Q_PROPERTY( int paintMargins READ paintMargins WRITE setPaintMargins NOTIFY paintMarginsChanged)
-
- Q_PROPERTY( QString fontFamily READ fontFamily)
- Q_PROPERTY( double fontPointSize READ fontPointSize)
- Q_PROPERTY( int fontHeight READ fontHeight NOTIFY fontHeightChanged)
-
-public:
- enum Type {
- Undefined,
- Button,
- RadioButton,
- CheckBox,
- ComboBox,
- ComboBoxItem,
- Dial,
- ToolBar,
- ToolButton,
- Tab,
- TabFrame,
- Frame,
- FocusFrame,
- SpinBox,
- Slider,
- ScrollBar,
- ProgressBar,
- Edit,
- GroupBox,
- Header,
- Item,
- ItemRow,
- Splitter,
- Menu,
- MenuItem,
- Widget
- };
-
- QStyleItem(QDeclarativeItem *parent = 0);
- ~QStyleItem();
-
- void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
-
- bool sunken() const { return m_sunken; }
- bool raised() const { return m_raised; }
- bool active() const { return m_active; }
- bool selected() const { return m_selected; }
- bool focus() const { return m_focus; }
- bool on() const { return m_on; }
- bool hover() const { return m_hover; }
- bool horizontal() const { return m_horizontal; }
-
- int minimum() const { return m_minimum; }
- int maximum() const { return m_maximum; }
- int step() const { return m_step; }
- int value() const { return m_value; }
- int paintMargins() const { return m_paintMargins; }
-
- QString elementType() const { return m_type; }
- QString text() const { return m_text; }
- QString cursor() const { return m_cursor; }
- QString activeControl() const { return m_activeControl; }
- QString info() const { return m_info; }
- QString hint() const { return m_hint; }
- QString style() const;
-
- void setSunken(bool sunken) { if (m_sunken != sunken) {m_sunken = sunken; emit sunkenChanged();}}
- void setRaised(bool raised) { if (m_raised!= raised) {m_raised = raised; emit raisedChanged();}}
- void setActive(bool active) { if (m_active!= active) {m_active = active; emit activeChanged();}}
- void setSelected(bool selected) { if (m_selected!= selected) {m_selected = selected; emit selectedChanged();}}
- void setFocus(bool focus) { if (m_focus != focus) {m_focus = focus; emit focusChanged();}}
- void setOn(bool on) { if (m_on != on) {m_on = on ; emit onChanged();}}
- void setHover(bool hover) { if (m_hover != hover) {m_hover = hover ; emit hoverChanged();}}
- void setHorizontal(bool horizontal) { if (m_horizontal != horizontal) {m_horizontal = horizontal; emit horizontalChanged();}}
- void setMinimum(int minimum) { if (m_minimum!= minimum) {m_minimum = minimum; emit minimumChanged();}}
- void setMaximum(int maximum) { if (m_maximum != maximum) {m_maximum = maximum; emit maximumChanged();}}
- void setValue(int value) { if (m_value!= value) {m_value = value; emit valueChanged();}}
- void setStep(int step) { if (m_step != step) { m_step = step; emit stepChanged(); }}
- void setPaintMargins(int value) {
- Q_UNUSED(value)
-#ifdef Q_WS_WIN //only vista style needs this hack
- if (m_paintMargins!= value) {m_paintMargins = value;}
-#endif
- }
- void setCursor(const QString &str);
- void setElementType(const QString &str);
- void setText(const QString &str) { if (m_text != str) {m_text = str; emit textChanged();}}
- void setActiveControl(const QString &str) { if (m_activeControl != str) {m_activeControl = str; emit activeControlChanged();}}
- void setInfo(const QString &str) { if (m_info != str) {m_info = str; emit infoChanged();}}
- void setHint(const QString &str) { if (m_hint != str) {m_hint= str; emit hintChanged();}}
-
- bool eventFilter(QObject *, QEvent *);
- virtual void initStyleOption ();
- QWidget *widget(){ return m_dummywidget; }
-
- int fontHeight();
- QString fontFamily();
- double fontPointSize();
-
-
-public Q_SLOTS:
- int pixelMetric(const QString&);
- QVariant styleHint(const QString&);
- QSize sizeFromContents(int width, int height);
- void updateItem(){update();}
- QString hitTest(int x, int y);
- QRect subControlRect(const QString &subcontrolString);
- void showToolTip(const QString &str);
- int textWidth(const QString &);
-
-Q_SIGNALS:
- void elementTypeChanged();
- void textChanged();
- void sunkenChanged();
- void raisedChanged();
- void activeChanged();
- void selectedChanged();
- void focusChanged();
- void onChanged();
- void hoverChanged();
- void horizontalChanged();
- void minimumChanged();
- void maximumChanged();
- void stepChanged();
- void valueChanged();
- void activeControlChanged();
- void infoChanged();
- void styleChanged();
- void paintMarginsChanged();
- void hintChanged();
- void cursorChanged();
- void fontHeightChanged();
-
-protected:
- QWidget *m_dummywidget;
- QStyleOption *m_styleoption;
- Type m_itemType;
-
- QString m_type;
- QString m_cursor;
- QString m_text;
- QString m_activeControl;
- QString m_info;
- QString m_hint;
-
- bool m_sunken;
- bool m_raised;
- bool m_active;
- bool m_selected;
- bool m_focus;
- bool m_hover;
- bool m_on;
- bool m_horizontal;
- bool m_sharedWidget;
-
- int m_minimum;
- int m_maximum;
- int m_value;
- int m_step;
- int m_paintMargins;
-};
-
-#endif //STYLEWRAPPER_H
diff --git a/src/libs/qtcomponents/styleitem/qstyleplugin.cpp b/src/libs/qtcomponents/styleitem/qstyleplugin.cpp
deleted file mode 100644
index 9894d7e1ea..0000000000
--- a/src/libs/qtcomponents/styleitem/qstyleplugin.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qstyleplugin.h"
-#include "qstyleitem.h"
-#include "qrangemodel.h"
-#include "qtmenu.h"
-#include "qtmenubar.h"
-#include "qtmenuitem.h"
-#include "qwheelarea.h"
-#include <qdeclarativeextensionplugin.h>
-
-#include <qdeclarativeengine.h>
-#include <qdeclarative.h>
-#include <qdeclarativeitem.h>
-#include <qdeclarativeimageprovider.h>
-#include <qdeclarativeview.h>
-#include <QApplication>
-#include <QImage>
-
-// Load icons from desktop theme
-class DesktopIconProvider : public QDeclarativeImageProvider
-{
-public:
- DesktopIconProvider()
- : QDeclarativeImageProvider(QDeclarativeImageProvider::Pixmap)
- {
- }
-
- QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
- {
- Q_UNUSED(requestedSize);
- Q_UNUSED(size);
- int pos = id.lastIndexOf(QLatin1Char('/'));
- QString iconName = id.right(id.length() - pos);
- int width = qApp->style()->pixelMetric(QStyle::PM_ToolBarIconSize);
- return QIcon::fromTheme(iconName).pixmap(width);
- }
-};
-
-
-void StylePlugin::registerTypes(const char *uri)
-{
-// qDebug() << "register" << uri;
- qmlRegisterType<QStyleItem>(uri, 1, 0, "QStyleItem");
- qmlRegisterType<QRangeModel>(uri, 1, 0, "RangeModel");
- qmlRegisterType<QGraphicsDropShadowEffect>(uri, 1, 0, "DropShadow");
- qmlRegisterType<QDeclarativeFolderListModel>(uri, 1, 0, "FileSystemModel");
- qmlRegisterType<QWheelArea>(uri, 1, 0, "WheelArea");
- qmlRegisterType<QtMenu>(uri, 1, 0, "MenuBase");
- qmlRegisterType<QtMenuBar>(uri, 1, 0, "MenuBarBase");
- qmlRegisterType<QtMenuItem>(uri, 1, 0, "MenuItemBase");
-}
-
-void StylePlugin::initializeEngine(QDeclarativeEngine *engine, const char *uri)
-{
- Q_UNUSED(uri);
- engine->addImageProvider(QLatin1String("desktoptheme"), new DesktopIconProvider);
-}
-
-#if QT_VERSION < 0x050000
-Q_EXPORT_PLUGIN2(styleplugin, StylePlugin)
-#endif
diff --git a/src/libs/qtcomponents/styleitem/qstyleplugin.h b/src/libs/qtcomponents/styleitem/qstyleplugin.h
deleted file mode 100644
index 66edcb5d40..0000000000
--- a/src/libs/qtcomponents/styleitem/qstyleplugin.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STYLEPLUGIN_H
-#define STYLEPLUGIN_H
-
-#include <QDeclarativeExtensionPlugin>
-#include <QScriptValue>
-#include <QTimer>
-#include <QFileSystemModel>
-#include "qdeclarativefolderlistmodel.h"
-
-
-class StylePlugin : public QDeclarativeExtensionPlugin
-{
- Q_OBJECT
-#if QT_VERSION >= 0x050000
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "styleitem.json")
- Q_INTERFACES(QDeclarativeExtensionInterface)
-#endif
-
-public:
- void registerTypes(const char *uri);
- void initializeEngine(QDeclarativeEngine *engine, const char *uri);
-};
-
-#endif // STYLEPLUGIN_H
diff --git a/src/libs/qtcomponents/styleitem/qtmenu.cpp b/src/libs/qtcomponents/styleitem/qtmenu.cpp
deleted file mode 100644
index 872d581a5f..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenu.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#include "qtmenu.h"
-
-#include <QApplication>
-#include <QtDebug>
-
-QtMenu::QtMenu(QObject *parent)
- : QObject(parent)
-{
- m_menu = new QMenu(0);
-}
-
-QtMenu::~QtMenu()
-{
- delete m_menu;
-}
-
-void QtMenu::setTitle(const QString &title)
-{
- m_title = title;
-}
-
-QString QtMenu::title() const
-{
- return m_title;
-}
-
-QDeclarativeListProperty<QtMenuItem> QtMenu::menuItems()
-{
- return QDeclarativeListProperty<QtMenuItem>(this, m_menuItems);
-}
-
-void QtMenu::showPopup(qreal x, qreal y)
-{
- m_menu->clear();
- foreach (QtMenuItem *item, m_menuItems) {
- QAction *action = new QAction(item->text(), m_menu);
- connect(action, SIGNAL(triggered()), item, SIGNAL(selected()));
- m_menu->insertAction(0, action);
- }
-
- // x,y are in view coordinates, QMenu expects screen coordinates
- // ### activeWindow hack
- QPoint screenPosition = QApplication::activeWindow()->mapToGlobal(QPoint(x, y));
-
- m_menu->popup(screenPosition);
-}
-
diff --git a/src/libs/qtcomponents/styleitem/qtmenu.h b/src/libs/qtcomponents/styleitem/qtmenu.h
deleted file mode 100644
index 32663fd087..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenu.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef QTMLMENU_H
-#define QTMLMENU_H
-
-#include <qmenu.h>
-#include <qdeclarative.h>
-#include <QDeclarativeListProperty>
-#include "qtmenuitem.h"
-class QtMenu : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString title READ title WRITE setTitle)
- Q_PROPERTY(QDeclarativeListProperty<QtMenuItem> menuItems READ menuItems)
- Q_CLASSINFO("DefaultProperty", "menuItems")
-public:
- QtMenu(QObject *parent = 0);
- virtual ~QtMenu();
-
- void setTitle(const QString &title);
- QString title() const;
- QDeclarativeListProperty<QtMenuItem> menuItems();
- Q_INVOKABLE void showPopup(qreal x, qreal y);
-Q_SIGNALS:
- void selected();
-private:
- QString m_title;
- QWidget *dummy;
- QMenu *m_menu;
- QList<QtMenuItem *> m_menuItems;
-};
-
-QML_DECLARE_TYPE(QtMenu)
-
-#endif // QTMLMENU_H
diff --git a/src/libs/qtcomponents/styleitem/qtmenubar.cpp b/src/libs/qtcomponents/styleitem/qtmenubar.cpp
deleted file mode 100644
index 8cc432edf7..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenubar.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-**************************************************************************/
-
-
-#include "qtmenubar.h"
-
-#include <QMenu>
-
-QtMenuBar::QtMenuBar(QDeclarativeItem *parent)
- : QDeclarativeItem(parent)
-{
- setFlag(QGraphicsItem::ItemHasNoContents, false);
-}
-
-QtMenuBar::~QtMenuBar()
-{
-}
-
-QDeclarativeListProperty<QtMenu> QtMenuBar::menus()
-{
- return QDeclarativeListProperty<QtMenu>(this, m_menus);
-}
diff --git a/src/libs/qtcomponents/styleitem/qtmenubar.h b/src/libs/qtcomponents/styleitem/qtmenubar.h
deleted file mode 100644
index 1e1421d505..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenubar.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-**************************************************************************/
-
-
-#ifndef QTMENUBAR_H
-#define QTMENUBAR_H
-
-#include <QDeclarativeItem>
-
-#include "qtmenu.h"
-
-class QtMenuBar: public QDeclarativeItem
-{
- Q_OBJECT
-
- Q_PROPERTY(QDeclarativeListProperty<QtMenu> menus READ menus)
-public:
- QtMenuBar(QDeclarativeItem *parent = 0);
- ~QtMenuBar();
-
- QDeclarativeListProperty<QtMenu> menus();
-
- //void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
-
-private:
- QList<QtMenu *> m_menus;
-};
-
-#endif //QTMENUBAR_H
diff --git a/src/libs/qtcomponents/styleitem/qtmenuitem.cpp b/src/libs/qtcomponents/styleitem/qtmenuitem.cpp
deleted file mode 100644
index 968c84476c..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenuitem.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-**************************************************************************/
-
-
-#include "qtmenuitem.h"
-
-QtMenuItem::QtMenuItem(QObject *parent)
- : QObject(parent)
-{
-
-}
-
-QtMenuItem::~QtMenuItem()
-{
-}
-
-void QtMenuItem::setText(const QString &text)
-{
- m_text = text;
-}
-
-QString QtMenuItem::text()
-{
- return m_text;
-}
diff --git a/src/libs/qtcomponents/styleitem/qtmenuitem.h b/src/libs/qtcomponents/styleitem/qtmenuitem.h
deleted file mode 100644
index 27a161e56a..0000000000
--- a/src/libs/qtcomponents/styleitem/qtmenuitem.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-**************************************************************************/
-
-
-#ifndef QTMENUITEM_H
-#define QTMENUITEM_H
-
-#include <QObject>
-
-class QtMenuItem: public QObject
-{
- Q_PROPERTY(QString text READ text WRITE setText);
-
- Q_OBJECT
-public:
- QtMenuItem(QObject *parent = 0);
- ~QtMenuItem();
-
- void setText(const QString &text);
- QString text();
-
-Q_SIGNALS:
- void selected();
-
-private:
- QString m_text;
-};
-
-#endif //QTMENUITEM_H
diff --git a/src/libs/qtcomponents/styleitem/qwheelarea.cpp b/src/libs/qtcomponents/styleitem/qwheelarea.cpp
deleted file mode 100644
index d89d14fe73..0000000000
--- a/src/libs/qtcomponents/styleitem/qwheelarea.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Toolkit.
-**
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor
-** the names of its contributors may be used to endorse or promote
-** products derived from this software without specific prior written
-** permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTgall
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include "qwheelarea.h"
-
-
-QWheelArea::QWheelArea(QDeclarativeItem *parent)
- : QDeclarativeItem(parent),
- _horizontalMinimumValue(0),
- _horizontalMaximumValue(0),
- _verticalMinimumValue(0),
- _verticalMaximumValue(0),
- _horizontalValue(0),
- _verticalValue(0),
- _verticalDelta(0),
- _horizontalDelta(0)
-{}
-
-QWheelArea::~QWheelArea() {}
-
-bool QWheelArea::event (QEvent * e) {
- switch (e->type()) {
- case QEvent::GraphicsSceneWheel: {
- QGraphicsSceneWheelEvent *we = static_cast<QGraphicsSceneWheelEvent*>(e);
- if (we) {
- switch (we->orientation()) {
- case Qt::Horizontal:
- setHorizontalDelta(we->delta());
- break;
- case Qt::Vertical:
- setVerticalDelta(we->delta());
- }
- return true;
- }
- }
- case QEvent::Wheel: {
- QWheelEvent *we = static_cast<QWheelEvent*>(e);
- if (we) {
- switch (we->orientation()) {
- case Qt::Horizontal:
- setHorizontalDelta(we->delta());
-
- break;
- case Qt::Vertical:
- setVerticalDelta(we->delta());
-
- }
- return true;
- }
- }
- default: break;
- }
- return QDeclarativeItem::event(e);
-}
-
-void QWheelArea::setHorizontalMinimumValue(qreal min)
-{
- _horizontalMinimumValue = min;
-}
-
-qreal QWheelArea::horizontalMinimumValue() const
-{
- return _horizontalMinimumValue;
-}
-
-void QWheelArea::setHorizontalMaximumValue(qreal max)
-{
- _horizontalMaximumValue = max;
-}
-qreal QWheelArea::horizontalMaximumValue() const
-{
- return _horizontalMaximumValue;
-}
-
-void QWheelArea::setVerticalMinimumValue(qreal min)
-{
- _verticalMinimumValue = min;
-}
-
-qreal QWheelArea::verticalMinimumValue() const
-{
- return _verticalMinimumValue;
-}
-
-void QWheelArea::setVerticalMaximumValue(qreal max)
-{
- _verticalMaximumValue = max;
-}
-
-qreal QWheelArea::verticalMaximumValue() const
-{
- return _verticalMaximumValue;
-}
-
-void QWheelArea::setHorizontalValue(qreal val)
-{
- if (val > _horizontalMaximumValue)
- _horizontalValue = _horizontalMaximumValue;
- else if (val < _horizontalMinimumValue)
- _horizontalValue = _horizontalMinimumValue;
- else
- _horizontalValue = val;
- emit(horizontalValueChanged());
-}
-
-qreal QWheelArea::horizontalValue() const
-{
- return _horizontalValue;
-}
-
-void QWheelArea::setVerticalValue(qreal val)
-{
- if (val > _verticalMaximumValue)
- _verticalValue = _verticalMaximumValue;
- else if (val < _verticalMinimumValue)
- _verticalValue = _verticalMinimumValue;
- else
- _verticalValue = val;
- emit(verticalValueChanged());
-}
-
-qreal QWheelArea::verticalValue() const
-{
- return _verticalValue;
-}
-
-void QWheelArea::setVerticalDelta(qreal d)
-{
- _verticalDelta = d/5;
- setVerticalValue(_verticalValue - _verticalDelta);
- emit(verticalWheelMoved());
-}
-
-qreal QWheelArea::verticalDelta() const
-{
- return _verticalDelta;
-}
-
-void QWheelArea::setHorizontalDelta(qreal d)
-{
- _horizontalDelta = d/5;
- setHorizontalValue(_horizontalValue - _horizontalDelta);
- emit(horizontalWheelMoved());
-}
-
-qreal QWheelArea::horizontalDelta() const
-{
- return _horizontalDelta;
-}
diff --git a/src/libs/qtcomponents/styleitem/qwheelarea.h b/src/libs/qtcomponents/styleitem/qwheelarea.h
deleted file mode 100644
index 135183ca12..0000000000
--- a/src/libs/qtcomponents/styleitem/qwheelarea.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** 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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-#ifndef QWHEELAREA_H
-#define QWHEELAREA_H
-
-
-#include <qobject.h>
-#include <qdeclarative.h>
-#include <qdeclarativeitem.h>
-#include <qcoreevent.h>
-#include <qevent.h>
-#include <qgraphicssceneevent.h>
-
-class QWheelArea : public QDeclarativeItem
-{
- Q_OBJECT
- Q_PROPERTY(qreal verticalDelta READ verticalDelta WRITE setVerticalDelta NOTIFY verticalWheelMoved)
- Q_PROPERTY(qreal horizontalDelta READ horizontalDelta WRITE setHorizontalDelta NOTIFY horizontalWheelMoved)
- Q_PROPERTY(qreal horizontalMinimumValue READ horizontalMinimumValue WRITE setHorizontalMinimumValue)
- Q_PROPERTY(qreal horizontalMaximumValue READ horizontalMaximumValue WRITE setHorizontalMaximumValue)
- Q_PROPERTY(qreal verticalMinimumValue READ verticalMinimumValue WRITE setVerticalMinimumValue)
- Q_PROPERTY(qreal verticalMaximumValue READ verticalMaximumValue WRITE setVerticalMaximumValue)
- Q_PROPERTY(qreal horizontalValue READ horizontalValue WRITE setHorizontalValue)
- Q_PROPERTY(qreal verticalValue READ verticalValue WRITE setVerticalValue)
-
-
-public:
- QWheelArea(QDeclarativeItem *parent = 0);
-
- virtual ~QWheelArea();
-
- virtual bool event (QEvent * e);
-
- void setHorizontalMinimumValue(qreal min);
- qreal horizontalMinimumValue() const;
-
- void setHorizontalMaximumValue(qreal min);
- qreal horizontalMaximumValue() const;
-
- void setVerticalMinimumValue(qreal min);
- qreal verticalMinimumValue() const;
-
- void setVerticalMaximumValue(qreal min);
- qreal verticalMaximumValue() const;
-
- void setHorizontalValue(qreal val);
- qreal horizontalValue() const;
-
- void setVerticalValue(qreal val);
- qreal verticalValue() const;
-
- void setVerticalDelta(qreal d);
- qreal verticalDelta() const;
-
- void setHorizontalDelta(qreal d);
- qreal horizontalDelta() const;
-
-Q_SIGNALS:
- void verticalValueChanged();
- void horizontalValueChanged();
- void verticalWheelMoved();
- void horizontalWheelMoved();
-
-private:
- qreal _horizontalMinimumValue;
- qreal _horizontalMaximumValue;
- qreal _verticalMinimumValue;
- qreal _verticalMaximumValue;
- qreal _horizontalValue;
- qreal _verticalValue;
- qreal _verticalDelta;
- qreal _horizontalDelta;
-
- Q_DISABLE_COPY(QWheelArea)
-};
-
-QML_DECLARE_TYPE(QWheelArea)
-
-
-#endif // QWHEELAREA_H
diff --git a/src/libs/qtcomponents/styleitem/styleitem.json b/src/libs/qtcomponents/styleitem/styleitem.json
deleted file mode 100644
index 0967ef424b..0000000000
--- a/src/libs/qtcomponents/styleitem/styleitem.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/src/libs/qtcomponents/styleitem/styleitem.pro b/src/libs/qtcomponents/styleitem/styleitem.pro
deleted file mode 100644
index 67666b0ccf..0000000000
--- a/src/libs/qtcomponents/styleitem/styleitem.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-TEMPLATE = lib
-CONFIG += qt plugin
-QT += script declarative
-
-TARGET = styleplugin
-include(../../../../qtcreator.pri)
-DESTDIR = $$IDE_LIBRARY_PATH/qtcomponents/plugin
-OBJECTS_DIR = tmp
-MOC_DIR = tmp
-
-HEADERS += qtmenu.h \
- qtmenubar.h \
- qtmenuitem.h \
- qrangemodel_p.h \
- qrangemodel.h \
- qstyleplugin.h \
- qdeclarativefolderlistmodel.h \
- qstyleitem.h \
- qwheelarea.h
-
-SOURCES += qtmenu.cpp \
- qtmenubar.cpp \
- qtmenuitem.cpp \
- qrangemodel.cpp \
- qstyleplugin.cpp \
- qdeclarativefolderlistmodel.cpp \
- qstyleitem.cpp \
- qwheelarea.cpp
-
-!macx {
- target.path = $$QTC_PREFIX/$${IDE_LIBRARY_BASENAME}/qtcreator/qtcomponents/plugin
- INSTALLS += target
-}
diff --git a/src/libs/qtcomponents/styleitem/styleitem.qbs b/src/libs/qtcomponents/styleitem/styleitem.qbs
deleted file mode 100644
index f3c2c8ed22..0000000000
--- a/src/libs/qtcomponents/styleitem/styleitem.qbs
+++ /dev/null
@@ -1,37 +0,0 @@
-import qbs.base 1.0
-
-DynamicLibrary {
- name: "styleplugin"
-
- Depends { name: "cpp" }
- Depends { name: "Qt"; submodules: ["core", "widgets", "declarative", "script"] }
-
- cpp.defines: project.generalDefines
-
- files: [
- "qdeclarativefolderlistmodel.cpp",
- "qdeclarativefolderlistmodel.h",
- "qrangemodel.cpp",
- "qrangemodel.h",
- "qrangemodel_p.h",
- "qstyleitem.cpp",
- "qstyleitem.h",
- "qstyleplugin.cpp",
- "qstyleplugin.h",
- "qtmenu.cpp",
- "qtmenu.h",
- "qtmenubar.cpp",
- "qtmenubar.h",
- "qtmenuitem.cpp",
- "qtmenuitem.h",
- "qwheelarea.cpp",
- "qwheelarea.h",
- ]
-
- Group {
- fileTagsFilter: product.type
- qbs.install: true
- qbs.installDir: (qbs.targetOS.contains("windows") ? "lib/qtcreator" : project.ide_library_path)
- + "/qtcomponents/plugin"
- }
-}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h b/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h
index 6de823e086..7d7fc65c07 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/fontwidget.h
@@ -32,8 +32,7 @@
#include <QWeakPointer>
#include <QWidget>
-#include <qdeclarative.h>
-
+#include <QtQml>
QT_BEGIN_NAMESPACE
class QLabel;
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp
index cfd9812baf..33c514b60e 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp
@@ -29,8 +29,8 @@
#include "gradientlineqmladaptor.h"
-#include <qdeclarative.h>
#include <QMessageBox>
+#include <QtQml>
#include <nodeproperty.h>
#include <nodelistproperty.h>
diff --git a/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp b/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp
index 4eb119b903..68ffe7e647 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/originwidget.cpp
@@ -31,7 +31,7 @@
#include <QList>
#include <QPainter>
#include <QMouseEvent>
-#include <qdeclarative.h>
+#include <QtQml>
static QList<QPoint> positions;
static QStringList originsStringList;
diff --git a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp
index 900732cc71..780323788d 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp
@@ -28,7 +28,8 @@
****************************************************************************/
#include "siblingcombobox.h"
-#include <QDeclarativeComponent>
+
+#include <QtQml>
namespace QmlDesigner {
diff --git a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
index e44877e3e4..dbb26a55f5 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
+++ b/src/plugins/qmlprojectmanager/qmlprojectmanager.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "QmlProjectManager"
- Depends { name: "Qt"; submodules: ["widgets", "declarative"] }
+ Depends { name: "Qt"; submodules: ["widgets", "network"] }
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }
diff --git a/src/plugins/welcome/welcome.pro b/src/plugins/welcome/welcome.pro
index b201120c74..325478392b 100644
--- a/src/plugins/welcome/welcome.pro
+++ b/src/plugins/welcome/welcome.pro
@@ -7,5 +7,3 @@ HEADERS += welcomeplugin.h
SOURCES += welcomeplugin.cpp
DEFINES += WELCOME_LIBRARY
-
-QML_IMPORT_PATH = $$IDE_SOURCE_TREE/lib/qtcreator/