diff options
author | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-10-14 11:32:43 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@digia.com> | 2014-10-14 13:26:34 +0200 |
commit | 5847f325e9466a53d8ffc5e32af03ca17670c05e (patch) | |
tree | 5f64c578fd597833c6c3b74034e5e8fc433ed853 /tests/manual/qml/testprojects/uisplit | |
parent | 087d1f5cd5b0b4b7f519a4a410fe8cd4d9365d3a (diff) | |
download | qt-creator-5847f325e9466a53d8ffc5e32af03ca17670c05e.tar.gz |
Manual tests for UI split
This adds a couple of projects for testing the ui split.
Change-Id: I9056702e724541a43895f28453ce31516a348e70
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Diffstat (limited to 'tests/manual/qml/testprojects/uisplit')
70 files changed, 3013 insertions, 0 deletions
diff --git a/tests/manual/qml/testprojects/uisplit/basiclayouts/MainForm.ui.qml b/tests/manual/qml/testprojects/uisplit/basiclayouts/MainForm.ui.qml new file mode 100644 index 0000000000..06632aa1b9 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/basiclayouts/MainForm.ui.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.0 + +ColumnLayout { + property alias rowBox_1: rowBox_1 + property alias rowLayout_1: rowLayout_1 + property alias textField_1: textField_1 + property alias button_1: button_1 + property alias gridBox_1: gridBox_1 + property alias gridLayout_1: gridLayout_1 + property alias label_1: label_1 + property alias label_2: label_2 + property alias label_3: label_3 + property alias textField_2: textField_2 + property alias textField_3: textField_3 + property alias textField_4: textField_4 + property alias textField_5: textField_5 + property alias textArea_1: textArea_1 + + anchors.fill: parent + + GroupBox { + id: rowBox_1 + title: "Row layout" + Layout.fillWidth: true + + RowLayout { + id: rowLayout_1 + anchors.fill: parent + TextField { + id: textField_1 + placeholderText: "This wants to grow horizontally" + Layout.fillWidth: true + } + Button { + id: button_1 + text: "Button" + } + } + } + + GroupBox { + id: gridBox_1 + title: "Grid layout" + Layout.fillWidth: true + + GridLayout { + id: gridLayout_1 + rows: 3 + flow: GridLayout.TopToBottom + anchors.fill: parent + + Label { id: label_1; text: "Line 1" } + Label { id: label_2; text: "Line 2" } + Label { id: label_3; text: "Line 3" } + + TextField { id: textField_2 } + TextField { id: textField_3 } + TextField { id: textField_4 } + + TextArea { + id: textField_5 + text: "This widget spans over three rows in the GridLayout.\n" + + "All items in the GridLayout are implicitly positioned from top to bottom." + Layout.rowSpan: 3 + Layout.fillHeight: true + Layout.fillWidth: true + } + } + } + TextArea { + id: textArea_1 + text: "This fills the whole cell" + Layout.minimumHeight: 30 + Layout.fillHeight: true + Layout.fillWidth: true + } +} diff --git a/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.pro b/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.pro new file mode 100644 index 0000000000..cc998cb6ee --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.pro @@ -0,0 +1,13 @@ +QT += qml quick +TARGET = basiclayouts +!no_desktop: QT += widgets + +include(src/src.pri) +include(../shared/shared.pri) + +OTHER_FILES += \ + main.qml \ + MainForm.qml \ + +RESOURCES += \ + resources.qrc diff --git a/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.qmlproject b/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.qmlproject new file mode 100644 index 0000000000..e5a8bf02ca --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/basiclayouts/basiclayouts.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + mainFile: "main.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/tests/manual/qml/testprojects/uisplit/basiclayouts/main.qml b/tests/manual/qml/testprojects/uisplit/basiclayouts/main.qml new file mode 100644 index 0000000000..e7b459ca57 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/basiclayouts/main.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.0 + +ApplicationWindow { + visible: true + title: "Basic layouts" + property int margin: 11 + width: mainForm.implicitWidth + 2 * margin + height: mainForm.implicitHeight + 2 * margin + minimumWidth: mainForm.Layout.minimumWidth + 2 * margin + minimumHeight: mainForm.Layout.minimumHeight + 2 * margin + + MainForm { + id: mainForm + anchors.margins: margin + } + +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/MainTabView.ui.qml b/tests/manual/qml/testprojects/uisplit/gallery/MainTabView.ui.qml new file mode 100644 index 0000000000..ec7b7c0985 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/MainTabView.ui.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.0 +import QtQuick.Dialogs 1.0 +import "content" + +TabView { + + id: tabView + + tabPosition: controlPage.item ? controlPage.item.tabPosition : Qt.TopEdge + + width: 640 + height: 420 + + Tab { + id: controlPage + title: "Controls" + Controls { + anchors.fill: parent + enabled: tabView.enabled + } + } + Tab { + title: "Itemviews" + ModelView { + anchors.fill: parent + anchors.margins: Qt.platform.os === "osx" ? 12 : 6 + } + } + Tab { + title: "Styles" + Styles { + anchors.fill: parent + } + } + Tab { + title: "Layouts" + Layouts { + anchors.fill:parent + anchors.margins: 8 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/AboutDialog.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/AboutDialog.qml new file mode 100644 index 0000000000..20baf45ddd --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/AboutDialog.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Dialogs 1.1 + +MessageDialog { + icon: StandardIcon.Information + text: "QtQuick.Controls gallery example" + detailedText: "This example demonstrates most of the available Qt Quick Controls." + title: "About Gallery" +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/ChildWindow.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/ChildWindow.qml new file mode 100644 index 0000000000..7da06b14a7 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/ChildWindow.qml @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Window { + id: window1 + + width: 400 + height: 400 + + title: "child window" + flags: Qt.Dialog + + Rectangle { + color: syspal.window + anchors.fill: parent + + Label { + id: dimensionsText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + width: parent.width + horizontalAlignment: Text.AlignHCenter + } + + Label { + id: availableDimensionsText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: dimensionsText.bottom + width: parent.width + horizontalAlignment: Text.AlignHCenter + } + + Label { + id: closeText + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: availableDimensionsText.bottom + text: "This is a new Window, press the\nbutton below to close it again." + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: closeText.bottom + id: closeWindowButton + text:"Close" + width: 98 + tooltip:"Press me, to close this window again" + onClicked: window1.visible = false + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: closeWindowButton.bottom + id: maximizeWindowButton + text:"Maximize" + width: 98 + tooltip:"Press me, to maximize this window again" + onClicked: window1.visibility = Window.Maximized; + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: maximizeWindowButton.bottom + id: normalizeWindowButton + text:"Normalize" + width: 98 + tooltip:"Press me, to normalize this window again" + onClicked: window1.visibility = Window.Windowed; + } + Button { + anchors.horizontalCenter: closeText.horizontalCenter + anchors.top: normalizeWindowButton.bottom + id: minimizeWindowButton + text:"Minimize" + width: 98 + tooltip:"Press me, to minimize this window again" + onClicked: window1.visibility = Window.Minimized; + } + } +} + diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/Controls.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/Controls.qml new file mode 100644 index 0000000000..48267478e8 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/Controls.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.1 +import QtQuick.Controls.Styles 1.1 + +ControlsForm { + id: flickable + button2.menu: Menu { + MenuItem { text: "This Button" } + MenuItem { text: "Happens To Have" } + MenuItem { text: "A Menu Assigned" } + } + + editableCombo.onAccepted: { + if (editableCombo.find(currentText) === -1) { + choices.append({text: editText}) + currentIndex = editableCombo.find(editText) + } + } + + rowLayout1.data: [ ExclusiveGroup { id: tabPositionGroup } ] +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/ControlsForm.ui.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/ControlsForm.ui.qml new file mode 100644 index 0000000000..f7de3526a3 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/ControlsForm.ui.qml @@ -0,0 +1,205 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.1 +import QtQuick.Controls.Styles 1.1 + +Item { + id: flickable + + width: 640 + height: 420 + property alias rowLayout1: rowLayout1 + property alias button2: button2 + property alias editableCombo: editableCombo + + property int tabPosition: tabPositionGroup.current === r2 ? Qt.BottomEdge : Qt.TopEdge + + RowLayout { + id: contentRow + anchors.fill:parent + anchors.margins: 8 + spacing: 16 + ColumnLayout { + id: firstColumn + Layout.minimumWidth: implicitWidth + Layout.fillWidth: false + RowLayout { + id: buttonrow + + Button { + id: button1 + text: "Button 1" + tooltip:"This is an interesting tool tip" + Layout.fillWidth: true + } + + Button { + id:button2 + text:"Button 2" + Layout.fillWidth: true + + } + } + ComboBox { + id: combo + model: choices + currentIndex: 2 + Layout.fillWidth: true + } + ComboBox { + model: Qt.fontFamilies() + Layout.fillWidth: true + currentIndex: 47 + } + ComboBox { + id: editableCombo + editable: true + model: choices + Layout.fillWidth: true + currentIndex: 2 + } + RowLayout { + SpinBox { + id: t1 + Layout.fillWidth: true + minimumValue: -50 + value: -20 + } + SpinBox { + id: t2 + Layout.fillWidth: true + } + } + TextField { + id: t3 + placeholderText: "This is a placeholder for a TextField" + Layout.fillWidth: true + } + ProgressBar { + // normalize value [0.0 .. 1.0] + value: (slider.value - slider.minimumValue) / (slider.maximumValue - slider.minimumValue) + Layout.fillWidth: true + } + ProgressBar { + indeterminate: true + Layout.fillWidth: true + } + Slider { + id: slider + value: 0.5 + Layout.fillWidth: true + tickmarksEnabled: tickmarkCheck.checked + stepSize: tickmarksEnabled ? 0.1 : 0 + } + MouseArea { + id: busyCheck + Layout.fillWidth: true + Layout.fillHeight: true + hoverEnabled:true + Layout.preferredHeight: busyIndicator.height + BusyIndicator { + id: busyIndicator + running: busyCheck.containsMouse + anchors.horizontalCenter: parent.horizontalCenter + } + } + } + ColumnLayout { + id: rightcol + Layout.fillWidth: true + anchors { + top: parent.top + bottom: parent.bottom + } + + GroupBox { + id: group1 + title: "CheckBox" + Layout.fillWidth: true + RowLayout { + Layout.fillWidth: true + CheckBox { + id: frameCheckbox + text: "Text frame" + checked: true + Layout.minimumWidth: 100 + } + CheckBox { + id: tickmarkCheck + text: "Tickmarks" + checked: false + Layout.minimumWidth: 100 + } + CheckBox { + id: wrapCheck + text: "Word wrap" + checked: true + Layout.minimumWidth: 100 + } + } + } + GroupBox { + id: group2 + title:"Tab Position" + Layout.fillWidth: true + RowLayout { + id: rowLayout1 + + RadioButton { + id: r1 + text: "Top" + checked: true + exclusiveGroup: tabPositionGroup + Layout.minimumWidth: 100 + } + RadioButton { + id: r2 + text: "Bottom" + exclusiveGroup: tabPositionGroup + Layout.minimumWidth: 100 + } + } + } + + TextArea { + id: area + frameVisible: frameCheckbox.checked + text: loremIpsum + loremIpsum + textFormat: Qt.RichText + wrapMode: wrapCheck.checked ? TextEdit.WordWrap : TextEdit.NoWrap + Layout.fillWidth: true + Layout.fillHeight: true + //menu: editmenu + } + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/DummyModel.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/DummyModel.qml new file mode 100644 index 0000000000..6fc2eef7a4 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/DummyModel.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 + +ListModel { + id: dummyModel + Component.onCompleted: { + for (var i = 0 ; i < 100 ; ++i) { + append({"index": i, "title": "A title " + i, "imagesource" :"http://someurl.com", "credit" : "N/A"}) + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/ImageViewer.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/ImageViewer.qml new file mode 100644 index 0000000000..b5a6f7b221 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/ImageViewer.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 + +Window { + id: imageViewer + minimumWidth: viewerImage.width + minimumHeight: viewerImage.height + function open(source) { + viewerImage.source = source + width = viewerImage.implicitWidth + 20 + height = viewerImage.implicitHeight + 20 + title = source + visible = true + } + Image { + id: viewerImage + anchors.centerIn: parent + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/Layouts.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/Layouts.qml new file mode 100644 index 0000000000..fd687d415e --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/Layouts.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.0 + +Item { + id:root + + width: 600 + height: 300 + + ColumnLayout { + id: mainLayout + anchors.fill: parent + spacing: 4 + GroupBox { + id: rowBox + title: "Row layout" + Layout.fillWidth: true + RowLayout { + id: rowLayout + anchors.fill: parent + TextField { + placeholderText: "This wants to grow horizontally" + Layout.fillWidth: true + } + Button { + text: "Button" + } + } + } + + GroupBox { + id: gridBox + title: "Grid layout" + Layout.fillWidth: true + + GridLayout { + id: gridLayout + anchors.fill: parent + rows: 3 + flow: GridLayout.TopToBottom + + Label { text: "Line 1" } + Label { text: "Line 2" } + Label { text: "Line 3" } + + TextField { } + TextField { } + TextField { } + + TextArea { + text: "This widget spans over three rows in the GridLayout.\n" + + "All items in the GridLayout are implicitly positioned from top to bottom." + Layout.rowSpan: 3 + Layout.fillHeight: true + Layout.fillWidth: true + } + } + } + TextArea { + id: t3 + text: "This fills the whole cell" + Layout.minimumHeight: 30 + Layout.fillHeight: true + Layout.fillWidth: true + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/ModelView.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/ModelView.qml new file mode 100644 index 0000000000..d7948900c6 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/ModelView.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +//import QtQuick.XmlListModel 2.1 + +Item { + id: root + + width: 600 + height: 300 + + // XmlListModel { + // id: flickerModel + // source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=" + "Cat" + // query: "/rss/channel/item" + // namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" + // XmlRole { name: "title"; query: "title/string()" } + // XmlRole { name: "imagesource"; query: "media:thumbnail/@url/string()" } + // XmlRole { name: "credit"; query: "media:credit/string()" } + // } + + TableView{ + model: DummyModel { + + } + + anchors.fill: parent + + TableViewColumn { + role: "index" + title: "#" + width: 36 + resizable: false + movable: false + } + TableViewColumn { + role: "title" + title: "Title" + width: 120 + } + TableViewColumn { + role: "credit" + title: "Credit" + width: 120 + } + TableViewColumn { + role: "imagesource" + title: "Image source" + width: 200 + visible: true + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/Styles.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/Styles.qml new file mode 100644 index 0000000000..77b0a5f500 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/Styles.qml @@ -0,0 +1,172 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Particles 2.0 +import QtQuick.Layouts 1.0 +import "styles" + +Item { + id: root + + width: 600 + height: 300 + + property int columnWidth: 120 + GridLayout { + rowSpacing: 12 + columnSpacing: 30 + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.margins: 30 + + Button { + text: "Push me" + style: ButtonStyle { } + implicitWidth: columnWidth + } + Button { + text: "Push me" + style: MyButtonStyle1 { + } + implicitWidth: columnWidth + } + Button { + text: "Push me" + style: MyButtonStyle2 { + + } + + implicitWidth: columnWidth + } + + TextField { + Layout.row: 1 + style: TextFieldStyle { } + implicitWidth: columnWidth + } + TextField { + style: MyTextFieldStyle1 { + } + implicitWidth: columnWidth + } + TextField { + style: MyTextFieldStyle2 { + } + implicitWidth: columnWidth + } + + Slider { + id: slider1 + Layout.row: 2 + value: 0.5 + implicitWidth: columnWidth + style: SliderStyle { } + } + Slider { + id: slider2 + value: 0.5 + implicitWidth: columnWidth + style: MySliderStyle1 { + } + } + Slider { + id: slider3 + value: 0.5 + implicitWidth: columnWidth + style: MySliderStyle2 { + + } + } + + ProgressBar { + Layout.row: 3 + value: slider1.value + implicitWidth: columnWidth + style: ProgressBarStyle { } + } + ProgressBar { + value: slider2.value + implicitWidth: columnWidth + style: MyProgressBarStyle1 { } + } + ProgressBar { + value: slider3.value + implicitWidth: columnWidth + style: MyProgressBarStyle2 { } + } + + CheckBox { + text: "CheckBox" + style: CheckBoxStyle{} + Layout.row: 4 + implicitWidth: columnWidth + } + RadioButton { + style: RadioButtonStyle{} + text: "RadioButton" + implicitWidth: columnWidth + } + + ComboBox { + model: ["Paris", "Oslo", "New York"] + style: ComboBoxStyle{} + implicitWidth: columnWidth + } + + TabView { + Layout.row: 5 + Layout.columnSpan: 3 + Layout.fillWidth: true + implicitHeight: 30 + Tab { title: "One" ; Item {}} + Tab { title: "Two" ; Item {}} + Tab { title: "Three" ; Item {}} + Tab { title: "Four" ; Item {}} + style: TabViewStyle {} + } + + TabView { + Layout.row: 6 + Layout.columnSpan: 3 + Layout.fillWidth: true + implicitHeight: 30 + Tab { title: "One" ; Item {}} + Tab { title: "Two" ; Item {}} + Tab { title: "Three" ; Item {}} + Tab { title: "Four" ; Item {}} + style: MyTabViewStyle { + + } + } + } +} + diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle1.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle1.qml new file mode 100644 index 0000000000..5db5fc6a80 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle1.qml @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +ButtonStyle { + background: BorderImage { + source: control.pressed ? "../../images/button-pressed.png" : "../../images/button.png" + border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4 + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle2.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle2.qml new file mode 100644 index 0000000000..17a398e856 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyButtonStyle2.qml @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +ButtonStyle { + background: Rectangle { + implicitHeight: 22 + implicitWidth: columnWidth + color: control.pressed ? "darkGray" : control.activeFocus ? "#cdd" : "#ccc" + antialiasing: true + border.color: "gray" + radius: height/2 + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + antialiasing: true + visible: !control.pressed + border.color: "#aaffffff" + radius: height/2 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle1.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle1.qml new file mode 100644 index 0000000000..75431f5e85 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle1.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Particles 2.0 + +ProgressBarStyle { + background: BorderImage { + source: "../../images/progress-background.png" + border.left: 2 ; border.right: 2 ; border.top: 2 ; border.bottom: 2 + } + progress: Item { + clip: true + BorderImage { + anchors.fill: parent + anchors.rightMargin: (control.value < control.maximumValue) ? -4 : 0 + source: "../../images/progress-fill.png" + border.left: 10 ; border.right: 10 + Rectangle { + width: 1 + color: "#a70" + opacity: 0.8 + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.bottomMargin: 1 + anchors.right: parent.right + visible: control.value < control.maximumValue + anchors.rightMargin: -parent.anchors.rightMargin + } + } + ParticleSystem{ id: bubbles; running: visible } + ImageParticle{ + id: fireball + system: bubbles + source: "../../images/bubble.png" + opacity: 0.7 + } + Emitter{ + system: bubbles + anchors.bottom: parent.bottom + anchors.margins: 4 + anchors.bottomMargin: -4 + anchors.left: parent.left + anchors.right: parent.right + size: 4 + sizeVariation: 4 + acceleration: PointDirection{ y: -6; xVariation: 3 } + emitRate: 6 * control.value + lifeSpan: 3000 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle2.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle2.qml new file mode 100644 index 0000000000..2c16ea3804 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyProgressBarStyle2.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +ProgressBarStyle { + background: Rectangle { + implicitWidth: columnWidth + implicitHeight: 24 + color: "#f0f0f0" + border.color: "gray" + } + progress: Rectangle { + color: "#ccc" + border.color: "gray" + Rectangle { + color: "transparent" + border.color: "#44ffffff" + anchors.fill: parent + anchors.margins: 1 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle1.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle1.qml new file mode 100644 index 0000000000..a949d4fb2e --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle1.qml @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Particles 2.0 +import QtQuick.Layouts 1.0 + +SliderStyle { + groove: BorderImage { + height: 6 + border.top: 1 + border.bottom: 1 + source: "../../images/progress-background.png" + border.left: 6 + border.right: 6 + BorderImage { + anchors.verticalCenter: parent.verticalCenter + source: "../../images/progress-fill.png" + border.left: 5 ; border.top: 1 + border.right: 5 ; border.bottom: 1 + width: styleData.handlePosition + height: parent.height + } + } + handle: Item { + width: 13 + height: 13 + Image { + anchors.centerIn: parent + source: "../../images/slider-handle.png" + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle2.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle2.qml new file mode 100644 index 0000000000..2d0eb1aca6 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MySliderStyle2.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +SliderStyle { + handle: Rectangle { + width: 18 + height: 18 + color: control.pressed ? "darkGray" : "lightGray" + border.color: "gray" + antialiasing: true + radius: height/2 + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + antialiasing: true + border.color: "#eee" + radius: height/2 + } + } + + groove: Rectangle { + height: 8 + implicitWidth: columnWidth + implicitHeight: 22 + + antialiasing: true + color: "#ccc" + border.color: "#777" + radius: height/2 + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + antialiasing: true + border.color: "#66ffffff" + radius: height/2 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTabViewStyle.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTabViewStyle.qml new file mode 100644 index 0000000000..687300fc24 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTabViewStyle.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +Component { +TabViewStyle { + tabOverlap: 16 + frameOverlap: 4 + tabsMovable: true + + frame: Rectangle { + gradient: Gradient{ + GradientStop { color: "#e5e5e5" ; position: 0 } + GradientStop { color: "#e0e0e0" ; position: 1 } + } + border.color: "#898989" + Rectangle { anchors.fill: parent ; anchors.margins: 1 ; border.color: "white" ; color: "transparent" } + } + tab: Item { + property int totalOverlap: tabOverlap * (control.count - 1) + implicitWidth: Math.min ((styleData.availableWidth + totalOverlap)/control.count - 4, image.sourceSize.width) + implicitHeight: image.sourceSize.height + BorderImage { + id: image + anchors.fill: parent + source: styleData.selected ? "../../images/tab_selected.png" : "../../images/tab.png" + border.left: 30 + smooth: false + border.right: 30 + } + Text { + text: styleData.title + anchors.centerIn: parent + } + } + leftCorner: Item { implicitWidth: 12 } +} +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle1.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle1.qml new file mode 100644 index 0000000000..d3b9d75e86 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle1.qml @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +TextFieldStyle { + background: BorderImage { + source: "../../images/textfield.png" + border.left: 4 ; border.right: 4 ; border.top: 4 ; border.bottom: 4 + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle2.qml b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle2.qml new file mode 100644 index 0000000000..59f0cd697a --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/content/styles/MyTextFieldStyle2.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.1 + +TextFieldStyle { + background: Rectangle { + implicitWidth: columnWidth + implicitHeight: 22 + color: "#f0f0f0" + antialiasing: true + border.color: "gray" + radius: height/2 + Rectangle { + anchors.fill: parent + anchors.margins: 1 + color: "transparent" + antialiasing: true + border.color: "#aaffffff" + radius: height/2 + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/gallery.qmlproject b/tests/manual/qml/testprojects/uisplit/gallery/gallery.qmlproject new file mode 100644 index 0000000000..417aef1ee4 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/gallery.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + //mainFile: "main.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/bubble.png b/tests/manual/qml/testprojects/uisplit/gallery/images/bubble.png Binary files differnew file mode 100644 index 0000000000..62aa1efe54 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/bubble.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/button-pressed.png b/tests/manual/qml/testprojects/uisplit/gallery/images/button-pressed.png Binary files differnew file mode 100644 index 0000000000..d64cdaa787 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/button-pressed.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/button.png b/tests/manual/qml/testprojects/uisplit/gallery/images/button.png Binary files differnew file mode 100644 index 0000000000..8ab41cc804 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/button.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/document-open.png b/tests/manual/qml/testprojects/uisplit/gallery/images/document-open.png Binary files differnew file mode 100644 index 0000000000..f35f258354 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/document-open.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/document-open@2x.png b/tests/manual/qml/testprojects/uisplit/gallery/images/document-open@2x.png Binary files differnew file mode 100644 index 0000000000..9fdbb66577 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/document-open@2x.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as.png b/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as.png Binary files differnew file mode 100644 index 0000000000..5c9f6b343b --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as@2x.png b/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as@2x.png Binary files differnew file mode 100644 index 0000000000..a15e34c924 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/document-save-as@2x.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/folder_new.png b/tests/manual/qml/testprojects/uisplit/gallery/images/folder_new.png Binary files differnew file mode 100644 index 0000000000..8d8bb9bd76 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/folder_new.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/go-next.png b/tests/manual/qml/testprojects/uisplit/gallery/images/go-next.png Binary files differnew file mode 100644 index 0000000000..a68e2db775 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/go-next.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/go-previous.png b/tests/manual/qml/testprojects/uisplit/gallery/images/go-previous.png Binary files differnew file mode 100644 index 0000000000..c37bc0414c --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/go-previous.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/preferences-system.png b/tests/manual/qml/testprojects/uisplit/gallery/images/preferences-system.png Binary files differnew file mode 100644 index 0000000000..6e52db7cfd --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/preferences-system.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/process-stop.png b/tests/manual/qml/testprojects/uisplit/gallery/images/process-stop.png Binary files differnew file mode 100644 index 0000000000..e7a8d1722f --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/process-stop.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/progress-background.png b/tests/manual/qml/testprojects/uisplit/gallery/images/progress-background.png Binary files differnew file mode 100644 index 0000000000..55a069dfce --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/progress-background.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/progress-fill.png b/tests/manual/qml/testprojects/uisplit/gallery/images/progress-fill.png Binary files differnew file mode 100644 index 0000000000..b588c9586d --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/progress-fill.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/slider-handle.png b/tests/manual/qml/testprojects/uisplit/gallery/images/slider-handle.png Binary files differnew file mode 100644 index 0000000000..ac4d4a0d98 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/slider-handle.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/tab.png b/tests/manual/qml/testprojects/uisplit/gallery/images/tab.png Binary files differnew file mode 100644 index 0000000000..74fefab78a --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/tab.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/tab_selected.png b/tests/manual/qml/testprojects/uisplit/gallery/images/tab_selected.png Binary files differnew file mode 100644 index 0000000000..665400ccfd --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/tab_selected.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/textfield.png b/tests/manual/qml/testprojects/uisplit/gallery/images/textfield.png Binary files differnew file mode 100644 index 0000000000..1d4a38ab38 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/textfield.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/toplevel_window.png b/tests/manual/qml/testprojects/uisplit/gallery/images/toplevel_window.png Binary files differnew file mode 100644 index 0000000000..4dc6a8cee2 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/toplevel_window.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/view-refresh.png b/tests/manual/qml/testprojects/uisplit/gallery/images/view-refresh.png Binary files differnew file mode 100644 index 0000000000..606ea9eba4 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/view-refresh.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/window-new.png b/tests/manual/qml/testprojects/uisplit/gallery/images/window-new.png Binary files differnew file mode 100644 index 0000000000..e091702e33 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/window-new.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/images/window-new@2x.png b/tests/manual/qml/testprojects/uisplit/gallery/images/window-new@2x.png Binary files differnew file mode 100644 index 0000000000..36503018ef --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/images/window-new@2x.png diff --git a/tests/manual/qml/testprojects/uisplit/gallery/main.qml b/tests/manual/qml/testprojects/uisplit/gallery/main.qml new file mode 100644 index 0000000000..9b07759dce --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/gallery/main.qml @@ -0,0 +1,235 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.3 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.0 +import QtQuick.Dialogs 1.0 +import "content" + +ApplicationWindow { + visible: true + title: "Component Gallery" + + width: 640 + height: 420 + minimumHeight: 400 + minimumWidth: 600 + + property string loremIpsum: + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ + "incididunt ut labore et dolore magna aliqua.\n Ut enim ad minim veniam, quis nostrud "+ + "exercitation ullamco laboris nisi ut aliquip ex ea commodo cosnsequat. "; + + ImageViewer { id: imageViewer } + + FileDialog { + id: fileDialog + nameFilters: [ "Image files (*.png *.jpg)" ] + onAccepted: imageViewer.open(fileUrl) + } + + AboutDialog { id: aboutDialog } + + Action { + id: openAction + text: "&Open" + shortcut: StandardKey.Open + iconSource: "images/document-open.png" + onTriggered: fileDialog.open() + tooltip: "Open an image" + } + + Action { + id: copyAction + text: "&Copy" + shortcut: StandardKey.Copy + iconName: "edit-copy" + enabled: (!!activeFocusItem && !!activeFocusItem["copy"]) + onTriggered: activeFocusItem.copy() + } + + Action { + id: cutAction + text: "Cu&t" + shortcut: StandardKey.Cut + iconName: "edit-cut" + enabled: (!!activeFocusItem && !!activeFocusItem["cut"]) + onTriggered: activeFocusItem.cut() + } + + Action { + id: pasteAction + text: "&Paste" + shortcut: StandardKey.Paste + iconName: "edit-paste" + enabled: (!!activeFocusItem && !!activeFocusItem["paste"]) + onTriggered: activeFocusItem.paste() + } + + Action { + id: aboutAction + text: "About" + onTriggered: aboutDialog.open() + } + + ExclusiveGroup { + id: textFormatGroup + + Action { + id: a1 + text: "Align &Left" + checkable: true + Component.onCompleted: checked = true + } + + Action { + id: a2 + text: "&Center" + checkable: true + } + + Action { + id: a3 + text: "Align &Right" + checkable: true + } + } + + ChildWindow { id: window1 } + + Component { + id: editmenu + Menu { + MenuItem { action: cutAction } + MenuItem { action: copyAction } + MenuItem { action: pasteAction } + MenuSeparator {} + Menu { + title: "Text &Format" + MenuItem { action: a1 } + MenuItem { action: a2 } + MenuItem { action: a3 } + MenuSeparator { } + MenuItem { text: "Allow &Hyphenation"; checkable: true } + } + Menu { + title: "Font &Style" + MenuItem { text: "&Bold"; checkable: true } + MenuItem { text: "&Italic"; checkable: true } + MenuItem { text: "&Underline"; checkable: true } + } + } + } + + toolBar: ToolBar { + id: toolbar + RowLayout { + id: toolbarLayout + spacing: 0 + anchors.fill: parent + ToolButton { + iconSource: "images/window-new.png" + onClicked: window1.visible = !window1.visible + Accessible.name: "New window" + tooltip: "Toggle visibility of the second window" + } + ToolButton { action: openAction } + ToolButton { + Accessible.name: "Save as" + iconSource: "images/document-save-as.png" + tooltip: "(Pretend to) Save as..." + } + Item { Layout.fillWidth: true } + CheckBox { + id: enabledCheck + text: "Enabled" + checked: true + } + } + } + + menuBar: MenuBar { + Menu { + title: "&File" + MenuItem { action: openAction } + MenuItem { + text: "Close" + shortcut: StandardKey.Quit + onTriggered: Qt.quit() + } + } + Menu { + title: "&Edit" + MenuItem { action: cutAction } + MenuItem { action: copyAction } + MenuItem { action: pasteAction } + MenuSeparator { } + MenuItem { + text: "Do Nothing" + shortcut: "Ctrl+E,Shift+Ctrl+X" + enabled: false + } + MenuItem { + text: "Not Even There" + shortcut: "Ctrl+E,Shift+Ctrl+Y" + visible: false + } + Menu { + title: "Me Neither" + visible: false + } + } + Menu { + title: "&Help" + MenuItem { action: aboutAction } + } + } + + + SystemPalette {id: syspal} + color: syspal.window + ListModel { + id: choices + ListElement { text: "Banana" } + ListElement { text: "Orange" } + ListElement { text: "Apple" } + ListElement { text: "Coconut" } + } + + MainTabView { + id: frame + + enabled: enabledCheck.checked + anchors.fill: parent + anchors.margins: Qt.platform.os === "osx" ? 12 : 2 + } +} + diff --git a/tests/manual/qml/testprojects/uisplit/splitview/MainForm.ui.qml b/tests/manual/qml/testprojects/uisplit/splitview/MainForm.ui.qml new file mode 100644 index 0000000000..12f3c0a473 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/splitview/MainForm.ui.qml @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Layouts 1.0 + +SplitView { + width: 600 + height: 400 + + Rectangle { + id: column + width: 200 + Layout.minimumWidth: 100 + Layout.maximumWidth: 300 + color: "lightsteelblue" + } + + SplitView { + orientation: Qt.Vertical + Layout.fillWidth: true + + Rectangle { + id: row1 + height: 200 + color: "lightblue" + Layout.minimumHeight: 1 + } + + Rectangle { + id: row2 + color: "lightgray" + } + } +} + + diff --git a/tests/manual/qml/testprojects/uisplit/splitview/main.qml b/tests/manual/qml/testprojects/uisplit/splitview/main.qml new file mode 100644 index 0000000000..b360eff897 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/splitview/main.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Controls 1.2 + +ApplicationWindow { + visible: true + width: 600 + height: 400 + + MainForm { + anchors.fill: parent + } + + +} diff --git a/tests/manual/qml/testprojects/uisplit/splitview/splitview.qmlproject b/tests/manual/qml/testprojects/uisplit/splitview/splitview.qmlproject new file mode 100644 index 0000000000..e5a8bf02ca --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/splitview/splitview.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + mainFile: "main.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/MainForm.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/MainForm.ui.qml new file mode 100644 index 0000000000..8c49b2a956 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/MainForm.ui.qml @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Column { + + width: 540 + height: 360 + property alias frame: frame + + property int margins: Qt.platform.os === "osx" ? 16 : 0 + + MainTabView { + id: frame + + height: parent.height - 34 + anchors.right: parent.right + anchors.left: parent.left + anchors.margins: margins + + + genteratedTabFrameVisible: frameCheckbox.checked + genteratedTabHeaderVisible: headerCheckbox.checked + genteratedTabSortIndicatorVisible: sortableCheckbox.checked + genteratedTabAlternatingRowColors: alternateCheckbox.checked + } + + Row { + x: 12 + height: 34 + CheckBox{ + id: alternateCheckbox + checked: true + text: "Alternate" + anchors.verticalCenter: parent.verticalCenter + } + CheckBox{ + id: sortableCheckbox + checked: false + text: "Sort indicator" + anchors.verticalCenter: parent.verticalCenter + } + CheckBox{ + id: frameCheckbox + checked: true + text: "Frame" + anchors.verticalCenter: parent.verticalCenter + } + CheckBox{ + id: headerCheckbox + checked: true + text: "Headers" + anchors.verticalCenter: parent.verticalCenter + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/MainTabView.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/MainTabView.ui.qml new file mode 100644 index 0000000000..5f1ce1e4b6 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/MainTabView.ui.qml @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 +import "tabs" + +TabView { + id:frame + focus:true + + width: 540 + height: 360 + + property bool genteratedTabFrameVisible: false + property bool genteratedTabHeaderVisible: false + property bool genteratedTabSortIndicatorVisible: false + property bool genteratedTabAlternatingRowColors: false + + Tab { + title: "XmlListModel" + + TabXmlListModel { + anchors.fill: parent + anchors.margins: 12 + + frameVisible: genteratedTabFrameVisible + headerVisible: genteratedTabHeaderVisible + sortIndicatorVisible: genteratedTabSortIndicatorVisible + alternatingRowColors: genteratedTabAlternatingRowColors + } + } + + Tab { + title: "Multivalue" + + TabMultivalue { + anchors.fill: parent + anchors.margins: 12 + + frameVisible: genteratedTabFrameVisible + headerVisible: genteratedTabHeaderVisible + sortIndicatorVisible: genteratedTabSortIndicatorVisible + alternatingRowColors: genteratedTabAlternatingRowColors + } + } + + Tab { + title: "Generated" + id: generatedTab + + TabGenerated { + anchors.margins: 12 + anchors.fill: parent + + frameVisible: genteratedTabFrameVisible + headerVisible: genteratedTabHeaderVisible + sortIndicatorVisible: genteratedTabSortIndicatorVisible + alternatingRowColors: genteratedTabAlternatingRowColors + } + } + + Tab { + title: "Delegates" + + TabDelegates { + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate1.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate1.qml new file mode 100644 index 0000000000..e474150cef --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate1.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Component { + id: delegate1 + Item { + clip: true + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value !== undefined ? styleData.value : "" + color: styleData.textColor + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate2.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate2.qml new file mode 100644 index 0000000000..558f134516 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/Delegate2.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Component { + id: delegate2 + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value !== undefined ? styleData.value : "" + color: styleData.textColor + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/EditableDelegate.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/EditableDelegate.qml new file mode 100644 index 0000000000..72be3de012 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/EditableDelegate.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Component { + Item { + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value !== undefined ? styleData.value : "" + color: styleData.textColor + visible: !styleData.selected + } + + Loader { // Initialize text editor lazily to improve performance + id: loaderEditor + anchors.fill: parent + anchors.margins: 4 + Connections { + target: loaderEditor.item + onAccepted: { + if (typeof styleData.value === 'number') + largeModel.setProperty(styleData.row, styleData.role, Number(parseFloat(loaderEditor.item.text).toFixed(0))) + else + largeModel.setProperty(styleData.row, styleData.role, loaderEditor.item.text) + } + } + sourceComponent: styleData.selected ? editor : null + Component { + id: editor + TextInput { + id: textinput + color: styleData.textColor + text: styleData.value + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + onClicked: textinput.forceActiveFocus() + } + } + } + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/HeaderDelegate.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/HeaderDelegate.qml new file mode 100644 index 0000000000..693b496042 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/HeaderDelegate.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +BorderImage{ + source: "../images/header.png" + border{left:2;right:2;top:2;bottom:2} + Text { + text: styleData.value + anchors.centerIn:parent + color:"#333" + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/MultiValueDelegate.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/MultiValueDelegate.qml new file mode 100644 index 0000000000..3d00f86d84 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/MultiValueDelegate.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Item { + Rectangle{ + color: styleData.value.get(0).color + anchors.top:parent.top + anchors.right:parent.right + anchors.bottom:parent.bottom + anchors.margins: 4 + width:32 + border.color:"#666" + } + Text { + width: parent.width + anchors.margins: 4 + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + elide: styleData.elideMode + text: styleData.value.get(0).description + color: styleData.textColor + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/delegates/RowDelegate.qml b/tests/manual/qml/testprojects/uisplit/tableview/delegates/RowDelegate.qml new file mode 100644 index 0000000000..8fcd63271a --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/delegates/RowDelegate.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +Component { + Rectangle { + height: (delegateChooser.currentIndex == 1 && styleData.selected) ? 30 : 20 + Behavior on height{ NumberAnimation{} } + + color: styleData.selected ? "#448" : (styleData.alternate? "#eee" : "#fff") + BorderImage{ + id: selected + anchors.fill: parent + source: "../images/selectedrow.png" + visible: styleData.selected + border{left:2; right:2; top:2; bottom:2} + SequentialAnimation { + running: true; loops: Animation.Infinite + NumberAnimation { target:selected; property: "opacity"; to: 1.0; duration: 900} + NumberAnimation { target:selected; property: "opacity"; to: 0.5; duration: 900} + } + } + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/images/header.png b/tests/manual/qml/testprojects/uisplit/tableview/images/header.png Binary files differnew file mode 100644 index 0000000000..dba6646092 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/images/header.png diff --git a/tests/manual/qml/testprojects/uisplit/tableview/images/selectedrow.png b/tests/manual/qml/testprojects/uisplit/tableview/images/selectedrow.png Binary files differnew file mode 100644 index 0000000000..71192ea4e2 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/images/selectedrow.png diff --git a/tests/manual/qml/testprojects/uisplit/tableview/main.qml b/tests/manual/qml/testprojects/uisplit/tableview/main.qml new file mode 100644 index 0000000000..8aa19c54fe --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/main.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +import "models" + +Window { + visible: true + width: 538 + form.margins * 2 + height: 360 + form.margins * 2 + + ToolBar { + id: toolbar + width: parent.width + + ListModel { + id: delegatemenu + ListElement { text: "Shiny delegate" } + ListElement { text: "Scale selected" } + ListElement { text: "Editable items" } + } + + ComboBox { + id: delegateChooser + enabled: form.frame.currentIndex === 3 ? 1 : 0 + model: delegatemenu + width: 150 + anchors.left: parent.left + anchors.leftMargin: 8 + anchors.verticalCenter: parent.verticalCenter + } + + CheckBox { + id: enabledCheck + text: "Enabled" + checked: true + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + } + + SystemPalette {id: syspal} + color: syspal.window + + LargeModel { + id: largeModel + } + + MainForm { + id: form + anchors.top: toolbar.bottom + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.margins: 8 + frame.enabled: enabledCheck.checked + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/models/FlickerModel.qml b/tests/manual/qml/testprojects/uisplit/tableview/models/FlickerModel.qml new file mode 100644 index 0000000000..33c9f7e444 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/models/FlickerModel.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 +import QtQuick.XmlListModel 2.0 + +XmlListModel { + source: "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=" + "Qt" + query: "/rss/channel/item" + namespaceDeclarations: "declare namespace media=\"http://search.yahoo.com/mrss/\";" + XmlRole { name: "title"; query: "title/string()" } + XmlRole { name: "imagesource"; query: "media:thumbnail/@url/string()" } + XmlRole { name: "credit"; query: "media:credit/string()" } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/models/LargeModel.qml b/tests/manual/qml/testprojects/uisplit/tableview/models/LargeModel.qml new file mode 100644 index 0000000000..ec1cdb6bb2 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/models/LargeModel.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +ListModel { + id: largeModel + Component.onCompleted: { + for (var i=0 ; i< 500 ; ++i) + largeModel.append({"name":"Person "+i , "age": Math.round(Math.random()*100), "gender": Math.random()>0.5 ? "Male" : "Female"}) + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/models/NestedModel.qml b/tests/manual/qml/testprojects/uisplit/tableview/models/NestedModel.qml new file mode 100644 index 0000000000..8671da70e6 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/models/NestedModel.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +ListModel { + ListElement{content: ListElement { description: "Core" ; color:"#ffaacc"}} + ListElement{content: ListElement { description: "Second" ; color:"#ffccaa"}} + ListElement{content: ListElement { description: "Third" ; color:"#ffffaa"}} +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tableview.qmlproject b/tests/manual/qml/testprojects/uisplit/tableview/tableview.qmlproject new file mode 100644 index 0000000000..e5a8bf02ca --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tableview.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + mainFile: "main.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegates.qml b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegates.qml new file mode 100644 index 0000000000..85abbe7166 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegates.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +import "../delegates" + +TabDelegatesForm { + anchors.fill: parent + + tableView.model: largeModel + tableView.frameVisible: frameCheckbox.checked + tableView.headerVisible: headerCheckbox.checked + tableView.sortIndicatorVisible: sortableCheckbox.checked + tableView.alternatingRowColors: alternateCheckbox.checked + + tableView.itemDelegate: { + if (delegateChooser.currentIndex == 2) + return editableDelegate; + else + return delegate1; + } + + EditableDelegate { + id: editableDelegate + } + + Delegate1 { + id: delegate1 + } + + Delegate2 { + id: delegate2 + } + +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegatesForm.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegatesForm.ui.qml new file mode 100644 index 0000000000..4095a4bad8 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabDelegatesForm.ui.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +import "../delegates" + +Item { + property alias tableView: tableView + + width: 540 + height: 360 + + TableView { + id: tableView + + anchors.margins: 12 + anchors.fill:parent + + TableViewColumn { + role: "name" + title: "Name" + width: 120 + } + TableViewColumn { + role: "age" + title: "Age" + width: 120 + } + TableViewColumn { + role: "gender" + title: "Gender" + width: 120 + } + + headerDelegate: HeaderDelegate { + } + + rowDelegate: RowDelegate { + } + + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabGenerated.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabGenerated.ui.qml new file mode 100644 index 0000000000..3bcbce2bb3 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabGenerated.ui.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +TableView { + model: largeModel + + width: 540 + height: 360 + + TableViewColumn { + role: "name" + title: "Name" + width: 120 + } + TableViewColumn { + role: "age" + title: "Age" + width: 120 + } + TableViewColumn { + role: "gender" + title: "Gender" + width: 120 + } +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabMultivalue.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabMultivalue.ui.qml new file mode 100644 index 0000000000..a6d6c723b2 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabMultivalue.ui.qml @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +import "../delegates" +import "../models" + +TableView { + model: NestedModel { + } + + width: 540 + height: 360 + + TableViewColumn { + role: "content" + title: "Text and Color" + width: 220 + } + + itemDelegate: MultiValueDelegate { + } + + frameVisible: frameCheckbox.checked + headerVisible: headerCheckbox.checked + sortIndicatorVisible: sortableCheckbox.checked + alternatingRowColors: alternateCheckbox.checked +} diff --git a/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabXmlListModel.ui.qml b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabXmlListModel.ui.qml new file mode 100644 index 0000000000..8d36356671 --- /dev/null +++ b/tests/manual/qml/testprojects/uisplit/tableview/tabs/TabXmlListModel.ui.qml @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2014 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 2.2 +import QtQuick.Window 2.1 +import QtQuick.Controls 1.2 + +import "../models" + +TableView { + model: FlickerModel { + } + + width: 540 + height: 360 + + TableViewColumn { + role: "title" + title: "Title" + width: 120 + } + TableViewColumn { + role: "credit" + title: "Credit" + width: 120 + } + TableViewColumn { + role: "imagesource" + title: "Image source" + width: 200 + visible: true + } + + frameVisible: frameCheckbox.checked + headerVisible: headerCheckbox.checked + sortIndicatorVisible: sortableCheckbox.checked + alternatingRowColors: alternateCheckbox.checked +} + |