Commit cf56178d authored by Jens Bache-Wiig's avatar Jens Bache-Wiig Committed by Thomas Hartmann

Port welcome screen to Qt Quick 2

This ports the welcome screen to use QtQuick 2.0.
I have disabled the plugin on Qt4 builds.

Change-Id: Ia921d0747c8f7d4441c88fc9fb77b822496091f4
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 328a24ed
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
Rectangle { Rectangle {
id: myApp id: myApp
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Rectangle { Rectangle {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
ListModel { ListModel {
ListElement { ListElement {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
ListModel { ListModel {
ListElement { ListElement {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
ListModel { ListModel {
ListElement { ListElement {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
ListModel { ListModel {
ListElement { ListElement {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
ListModel { ListModel {
ListElement { ListElement {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Rectangle { Rectangle {
...@@ -82,6 +82,8 @@ Rectangle { ...@@ -82,6 +82,8 @@ Rectangle {
anchors.rightMargin: 80 anchors.rightMargin: 80
anchors.right: parent.right anchors.right: parent.right
model: qtVersionModel model: qtVersionModel
textRole: "text"
onCurrentIndexChanged: { onCurrentIndexChanged: {
if (comboBox.model === undefined) if (comboBox.model === undefined)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Rectangle { Rectangle {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Rectangle { Rectangle {
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Rectangle { Rectangle {
...@@ -36,13 +36,13 @@ Rectangle { ...@@ -36,13 +36,13 @@ Rectangle {
color: "#edf0f2" color: "#edf0f2"
id: root id: root
property var fonts: CustomFonts {}
property var colors: CustomColors { }
Rectangle { Rectangle {
id: canvas id: canvas
width: Math.min(1024, parent.width) width: Math.min(1024, parent.width)
//this is a workaround for QTCREATORBUG-6803
anchors.topMargin: (root.height > 700) ? 0 : 0
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
import qtcomponents 1.0 import QtQuick.Controls 1.0
ChoiceList { ComboBox {
} }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
QtObject { QtObject {
property color linkColor: "#445ba8" property color linkColor: "#445ba8"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
QtObject { QtObject {
property alias linkFont: linkText.font property alias linkFont: linkText.font
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
Row { Row {
id: customTab id: customTab
......
...@@ -27,64 +27,36 @@ ...@@ -27,64 +27,36 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
import qtcomponents 1.0 import QtQuick.Controls 1.0
GridView {
id: gridView
interactive: false
clip: true
cellHeight: 240
cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
cacheBuffer: 1000
ScrollView {
x: Math.max((width - (cellWidth * columns)) / 2, 0); x: Math.max((width - (cellWidth * columns)) / 2, 0);
property alias model: gridView.model
delegate: Delegate { GridView {
id: delegate id: gridView
interactive: false
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 cellHeight: 240
property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" delegate: Delegate {
id: delegate
imageSource: model.imageSource === undefined ? helpSource : mockupSource
videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
caption: model.name;
description: model.description property string mockupSource: model.imageSource
isVideo: model.isVideo === true property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags imageSource: model.imageSource === undefined ? helpSource : mockupSource
} videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource
WheelArea { caption: model.name;
id: wheelarea description: model.description
anchors.fill: parent isVideo: model.isVideo === true
verticalMinimumValue: vscrollbar.minimumValue videoLength: model.videoLength !== undefined ? model.videoLength : ""
verticalMaximumValue: vscrollbar.maximumValue tags: model.tags
}
onVerticalValueChanged: gridView.contentY = verticalValue
verticalValue: gridView.contentY
}
ScrollBar {
id: vscrollbar
orientation: Qt.Vertical
property int availableHeight : gridView.height
visible: contentHeight > availableHeight
maximumValue: contentHeight > availableHeight ? gridView.contentHeight - availableHeight : 0
minimumValue: 0
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.topMargin: styleitem.style == "mac" ? 1 : 0
onValueChanged: gridView.contentY = value
anchors.rightMargin: styleitem.frameoffset
anchors.bottomMargin: hscrollbar.visible ? hscrollbar.height : styleitem.frameoffset
value: gridView.contentY
} }
} }
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import qtcomponents 1.0
Rectangle { Rectangle {
id: delegate id: delegate
...@@ -64,17 +63,6 @@ Rectangle { ...@@ -64,17 +63,6 @@ Rectangle {
searchBar.text += " " + tagStr searchBar.text += " " + tagStr
} }
CustomColors {
id: colors
}
CustomFonts {
id: fonts
}
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
BorderImage { BorderImage {
id: image1 id: image1
x: 11 x: 11
...@@ -228,6 +216,7 @@ Rectangle { ...@@ -228,6 +216,7 @@ Rectangle {
id: mousearea1 id: mousearea1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: { onEntered: {
delegate.state="hover" delegate.state="hover"
} }
......
import QtQuick 1.1 import QtQuick 2.1
import qtcomponents 1.0
Item { Item {
id: gettingStartedItem id: gettingStartedItem
...@@ -13,16 +12,6 @@ Item { ...@@ -13,16 +12,6 @@ Item {
signal clicked signal clicked
CustomColors {
id: colors
}
CustomFonts {
id: fonts
}
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
Rectangle { Rectangle {
y: 170 y: 170
width: 20 width: 20
...@@ -106,6 +95,7 @@ Item { ...@@ -106,6 +95,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: { onEntered: {
gettingStartedItem.state="hover" gettingStartedItem.state="hover"
} }
......
import QtQuick 1.1 import QtQuick 2.1
import widgets 1.0 import widgets 1.0
Row { Row {
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import qtcomponents 1.0
Text { Text {
id: root id: root
...@@ -52,14 +51,6 @@ Text { ...@@ -52,14 +51,6 @@ Text {
property bool enlargeMouseArea: true property bool enlargeMouseArea: true
CustomFonts {
id: fonts
}
CustomColors {
id: colors
}
Rectangle { Rectangle {
color: "#909090" color: "#909090"
radius: 6 radius: 6
...@@ -89,8 +80,7 @@ Text { ...@@ -89,8 +80,7 @@ Text {
anchors.margins: enlargeMouseArea ? -8 : 0 anchors.margins: enlargeMouseArea ? -8 : 0
hoverEnabled: true hoverEnabled: true
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent } cursorShape: Qt.PointingHandCursor
onEntered: { onEntered: {
if (!root.active) if (!root.active)
mouseArea.state = "hovered" mouseArea.state = "hovered"
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import qtcomponents 1.0 as Components
Item { Item {
id: tabBar id: tabBar
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1
Image { Image {
id: logo id: logo
......
...@@ -27,16 +27,16 @@ ...@@ -27,16 +27,16 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.1 import QtQuick 2.1
import QtQuick 1.0
Item { Item {
id: pageCaption id: pageCaption
width: 960 width: 960
height: 40 height: 40
property int textOffset: captionText.x + captionText.width
property int textOffset: captionText.x + captionText.width
property alias caption: captionText.text property alias caption: captionText.text
Text { Text {
id: captionText id: captionText
y: 9 y: 9
...@@ -55,8 +55,4 @@ Item { ...@@ -55,8 +55,4 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
} }
CustomColors {
id: colors
}
} }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
** **
****************************************************************************/ ****************************************************************************/
import QtQuick 1.0 import QtQuick 2.1