diff --git a/share/qtcreator/qml/qmlobserver/startup/Logo.qml b/share/qtcreator/qml/qmlobserver/startup/Logo.qml index dfe594e49983e879d3fbd3f33b432454f874aa2e..2bd7051e1108f8b190aac7455653c575b8d6401d 100644 --- a/share/qtcreator/qml/qmlobserver/startup/Logo.qml +++ b/share/qtcreator/qml/qmlobserver/startup/Logo.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 Rectangle { id: myApp diff --git a/share/qtcreator/welcomescreen/develop.qml b/share/qtcreator/welcomescreen/develop.qml index c8f05a62688856bee157d01a8905262dd962efdf..e2a58eb9d83ed606d453155e890dad922c43cc28 100644 --- a/share/qtcreator/welcomescreen/develop.qml +++ b/share/qtcreator/welcomescreen/develop.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 import widgets 1.0 Rectangle { diff --git a/share/qtcreator/welcomescreen/dummydata/examplesModel.qml b/share/qtcreator/welcomescreen/dummydata/examplesModel.qml index c1c2beb0a339a41a5dcd5f6ee3dc040a5375940d..a3cbf216c8bfcf61b5a077948c86f2c1f618359f 100644 --- a/share/qtcreator/welcomescreen/dummydata/examplesModel.qml +++ b/share/qtcreator/welcomescreen/dummydata/examplesModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/dummydata/pagesModel.qml b/share/qtcreator/welcomescreen/dummydata/pagesModel.qml index c97b256619d2d6e44f35a29606a134c8dc2b39fe..ac9a628593922458ce02680ab231d0f430be0157 100644 --- a/share/qtcreator/welcomescreen/dummydata/pagesModel.qml +++ b/share/qtcreator/welcomescreen/dummydata/pagesModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/dummydata/projectList.qml b/share/qtcreator/welcomescreen/dummydata/projectList.qml index 8a806fe0133c1e94f2c9801afcdd10fe5814e4d7..75411e8d55eddb4e213ab07f42b7b55ae298a141 100644 --- a/share/qtcreator/welcomescreen/dummydata/projectList.qml +++ b/share/qtcreator/welcomescreen/dummydata/projectList.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/dummydata/sessionList.qml b/share/qtcreator/welcomescreen/dummydata/sessionList.qml index 1a6db9dbbc7b27de2d814e5a40f9a7cfb6275a4b..07352b2130695057e6c1cb32243f97f8049bf07f 100644 --- a/share/qtcreator/welcomescreen/dummydata/sessionList.qml +++ b/share/qtcreator/welcomescreen/dummydata/sessionList.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/dummydata/tutorialsModel.qml b/share/qtcreator/welcomescreen/dummydata/tutorialsModel.qml index 9bce3ea4231f5f21019b9c242d42098712445d31..c2930d980e73a432e377a0161bc2ef6e20570aa7 100644 --- a/share/qtcreator/welcomescreen/dummydata/tutorialsModel.qml +++ b/share/qtcreator/welcomescreen/dummydata/tutorialsModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/examples.qml b/share/qtcreator/welcomescreen/examples.qml index 868c6c9373f9d318bdff6f370b6032ad846b51e1..ec6a9921c10af98d31e352b69ac358afda71ffa0 100644 --- a/share/qtcreator/welcomescreen/examples.qml +++ b/share/qtcreator/welcomescreen/examples.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 import widgets 1.0 Rectangle { @@ -82,6 +82,8 @@ Rectangle { anchors.rightMargin: 80 anchors.right: parent.right model: qtVersionModel + textRole: "text" + onCurrentIndexChanged: { if (comboBox.model === undefined) diff --git a/share/qtcreator/welcomescreen/gettingstarted.qml b/share/qtcreator/welcomescreen/gettingstarted.qml index 346970602937e666070335fdcfb1f41316c4a535..cf77902554dc2b1896119c287eefab45786e0946 100644 --- a/share/qtcreator/welcomescreen/gettingstarted.qml +++ b/share/qtcreator/welcomescreen/gettingstarted.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 import widgets 1.0 Rectangle { diff --git a/share/qtcreator/welcomescreen/tutorials.qml b/share/qtcreator/welcomescreen/tutorials.qml index af2d36041830c896a4e43fd5c32d962b96d5f106..b18bfbf625e3699d14faa0ee28c99b1929b2768b 100644 --- a/share/qtcreator/welcomescreen/tutorials.qml +++ b/share/qtcreator/welcomescreen/tutorials.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 import widgets 1.0 Rectangle { diff --git a/share/qtcreator/welcomescreen/welcomescreen.qml b/share/qtcreator/welcomescreen/welcomescreen.qml index 308f9d7565957e2e3f732ca320fd252b722c2003..b6ef3a86f023083cdf0c7b8a5eccca4c1fa8b867 100644 --- a/share/qtcreator/welcomescreen/welcomescreen.qml +++ b/share/qtcreator/welcomescreen/welcomescreen.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 import widgets 1.0 Rectangle { @@ -36,13 +36,13 @@ Rectangle { color: "#edf0f2" id: root + property var fonts: CustomFonts {} + property var colors: CustomColors { } + Rectangle { id: canvas 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.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter diff --git a/share/qtcreator/welcomescreen/widgets/ComboBox.qml b/share/qtcreator/welcomescreen/widgets/ComboBox.qml index c68d3ff286e3e2ce03a87248beca800ab2dd516c..544c3f498b9154b5ea9f330a227eb097006b9c60 100644 --- a/share/qtcreator/welcomescreen/widgets/ComboBox.qml +++ b/share/qtcreator/welcomescreen/widgets/ComboBox.qml @@ -27,8 +27,8 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import qtcomponents 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 -ChoiceList { +ComboBox { } diff --git a/share/qtcreator/welcomescreen/widgets/CustomColors.qml b/share/qtcreator/welcomescreen/widgets/CustomColors.qml index df18527df5a959b28a76ea53bd1e0f55dff464c5..d4d85c347fc4d6f803100f0bfe6d08f24bbbca7e 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomColors.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomColors.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 QtObject { property color linkColor: "#445ba8" diff --git a/share/qtcreator/welcomescreen/widgets/CustomFonts.qml b/share/qtcreator/welcomescreen/widgets/CustomFonts.qml index 3b48a38bf386448583a93070e91588803dc1f890..9fa639139991523491e7020f5345ad4eb1aedeca 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomFonts.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomFonts.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 QtObject { property alias linkFont: linkText.font diff --git a/share/qtcreator/welcomescreen/widgets/CustomTab.qml b/share/qtcreator/welcomescreen/widgets/CustomTab.qml index a4ee1b6031f716a214add673eb152de6d65230d2..b76cffedc6c38e60f427ebaf16ad76e0c654b4fd 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomTab.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomTab.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 Row { id: customTab diff --git a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml index d36b3f0a3305cfb78f0c56488fe459cb4e2fb862..b022235e38f8b47ff00eba29fa0d4f4a1dab29a3 100644 --- a/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml +++ b/share/qtcreator/welcomescreen/widgets/CustomizedGridView.qml @@ -27,64 +27,36 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import qtcomponents 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 +import QtQuick 2.1 +import QtQuick.Controls 1.0 +ScrollView { x: Math.max((width - (cellWidth * columns)) / 2, 0); - - delegate: Delegate { - id: delegate - - property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 - property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" - - property string mockupSource: model.imageSource - property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" - - imageSource: model.imageSource === undefined ? helpSource : mockupSource - videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource - - caption: model.name; - description: model.description - isVideo: model.isVideo === true - videoLength: model.videoLength !== undefined ? model.videoLength : "" - tags: model.tags - } - - WheelArea { - id: wheelarea - anchors.fill: parent - verticalMinimumValue: vscrollbar.minimumValue - verticalMaximumValue: vscrollbar.maximumValue - - 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 + property alias model: gridView.model + GridView { + id: gridView + interactive: false + cellHeight: 240 + cellWidth: 216 + property int columns: Math.max(Math.floor(width / cellWidth), 1) + + delegate: Delegate { + id: delegate + + property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1 + property string sourcePrefix: isHelpImage ? "image://helpimage/" : "" + + property string mockupSource: model.imageSource + property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : "" + + imageSource: model.imageSource === undefined ? helpSource : mockupSource + videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource + + caption: model.name; + description: model.description + isVideo: model.isVideo === true + videoLength: model.videoLength !== undefined ? model.videoLength : "" + tags: model.tags + } } } diff --git a/share/qtcreator/welcomescreen/widgets/Delegate.qml b/share/qtcreator/welcomescreen/widgets/Delegate.qml index ec76af2fd53d28ea9039d6ca5ec2e4518ad9613f..39936e0ce066d95eaf59bd4c8c0f2de4f75de6af 100644 --- a/share/qtcreator/welcomescreen/widgets/Delegate.qml +++ b/share/qtcreator/welcomescreen/widgets/Delegate.qml @@ -27,8 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import qtcomponents 1.0 +import QtQuick 2.1 Rectangle { id: delegate @@ -64,17 +63,6 @@ Rectangle { searchBar.text += " " + tagStr } - CustomColors { - id: colors - } - - CustomFonts { - id: fonts - } - - QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent } - - BorderImage { id: image1 x: 11 @@ -228,6 +216,7 @@ Rectangle { id: mousearea1 anchors.fill: parent hoverEnabled: true + cursorShape: Qt.PointingHandCursor onEntered: { delegate.state="hover" } diff --git a/share/qtcreator/welcomescreen/widgets/GettingStartedItem.qml b/share/qtcreator/welcomescreen/widgets/GettingStartedItem.qml index d48b4d199d84111218002a488c847a1c5878481b..00b4f404fb5c3184545a579e218bd3cd94f6b046 100644 --- a/share/qtcreator/welcomescreen/widgets/GettingStartedItem.qml +++ b/share/qtcreator/welcomescreen/widgets/GettingStartedItem.qml @@ -1,5 +1,4 @@ -import QtQuick 1.1 -import qtcomponents 1.0 +import QtQuick 2.1 Item { id: gettingStartedItem @@ -13,16 +12,6 @@ Item { signal clicked - CustomColors { - id: colors - } - - CustomFonts { - id: fonts - } - - QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent } - Rectangle { y: 170 width: 20 @@ -106,6 +95,7 @@ Item { MouseArea { anchors.fill: parent hoverEnabled: true + cursorShape: Qt.PointingHandCursor onEntered: { gettingStartedItem.state="hover" } diff --git a/share/qtcreator/welcomescreen/widgets/IconAndLink.qml b/share/qtcreator/welcomescreen/widgets/IconAndLink.qml index c9d934c276b0ec8c542a95d0ba9e696666757422..f865f1e4a7c1c34d38cae5fbc61facf077c2a632 100644 --- a/share/qtcreator/welcomescreen/widgets/IconAndLink.qml +++ b/share/qtcreator/welcomescreen/widgets/IconAndLink.qml @@ -1,4 +1,4 @@ -import QtQuick 1.1 +import QtQuick 2.1 import widgets 1.0 Row { diff --git a/share/qtcreator/welcomescreen/widgets/LinkedText.qml b/share/qtcreator/welcomescreen/widgets/LinkedText.qml index e01388cfd46fa76c726ebd4781c4b169d2b40746..fa47a67c700c664fef7bd4457e7df2f8398f2b5e 100644 --- a/share/qtcreator/welcomescreen/widgets/LinkedText.qml +++ b/share/qtcreator/welcomescreen/widgets/LinkedText.qml @@ -27,8 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import qtcomponents 1.0 +import QtQuick 2.1 Text { id: root @@ -52,14 +51,6 @@ Text { property bool enlargeMouseArea: true - CustomFonts { - id: fonts - } - - CustomColors { - id: colors - } - Rectangle { color: "#909090" radius: 6 @@ -89,8 +80,7 @@ Text { anchors.margins: enlargeMouseArea ? -8 : 0 hoverEnabled: true - QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent } - + cursorShape: Qt.PointingHandCursor onEntered: { if (!root.active) mouseArea.state = "hovered" diff --git a/share/qtcreator/welcomescreen/widgets/LinksBar.qml b/share/qtcreator/welcomescreen/widgets/LinksBar.qml index 4fb39136ecf416258ac9dcb796fee6bea32a8462..8b0e7a6642772e5f3abf582eb90fc116c16f0c04 100644 --- a/share/qtcreator/welcomescreen/widgets/LinksBar.qml +++ b/share/qtcreator/welcomescreen/widgets/LinksBar.qml @@ -27,8 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import qtcomponents 1.0 as Components +import QtQuick 2.1 Item { id: tabBar diff --git a/share/qtcreator/welcomescreen/widgets/Logo.qml b/share/qtcreator/welcomescreen/widgets/Logo.qml index deaff82529bef0e5899869c53f1b2d17c371aeec..080bb9c361602e4993091b0a8cbe3d3c31d89fda 100644 --- a/share/qtcreator/welcomescreen/widgets/Logo.qml +++ b/share/qtcreator/welcomescreen/widgets/Logo.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 Image { id: logo diff --git a/share/qtcreator/welcomescreen/widgets/PageCaption.qml b/share/qtcreator/welcomescreen/widgets/PageCaption.qml index 7e10e6fb83adfb29c9a8df9e290a30793f46595b..7a4ec89daa2e775b13728108071932915420ce67 100644 --- a/share/qtcreator/welcomescreen/widgets/PageCaption.qml +++ b/share/qtcreator/welcomescreen/widgets/PageCaption.qml @@ -27,16 +27,16 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import QtQuick 1.0 +import QtQuick 2.1 Item { id: pageCaption width: 960 height: 40 - property int textOffset: captionText.x + captionText.width + property int textOffset: captionText.x + captionText.width property alias caption: captionText.text + Text { id: captionText y: 9 @@ -55,8 +55,4 @@ Item { anchors.left: parent.left anchors.right: parent.right } - - CustomColors { - id: colors - } } diff --git a/share/qtcreator/welcomescreen/widgets/PageLoader.qml b/share/qtcreator/welcomescreen/widgets/PageLoader.qml index f720a06231fbb77da2c9bd7594ebd235738ccd3d..c981e2b60b994d16242dd6fb363423b272b2cbea 100644 --- a/share/qtcreator/welcomescreen/widgets/PageLoader.qml +++ b/share/qtcreator/welcomescreen/widgets/PageLoader.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 Item { id: pageLoader diff --git a/share/qtcreator/welcomescreen/widgets/ProjectItem.qml b/share/qtcreator/welcomescreen/widgets/ProjectItem.qml index b1ba42c46cde4f04d51abaf6c9941f1cf0e3f3e7..9a60ea4385cf956bb6d54ceaeb3423a9e755eb04 100644 --- a/share/qtcreator/welcomescreen/widgets/ProjectItem.qml +++ b/share/qtcreator/welcomescreen/widgets/ProjectItem.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 Item { id: projectItem @@ -48,10 +48,6 @@ Item { anchors.verticalCenter: projectNameText.verticalCenter } - CustomFonts { - id: fonts - } - LinkedText { id: projectNameText y: 2 diff --git a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml index 9baaaa4086a26e46688b44afc438cf64f79bacd8..f2d72d0af316367b728a973ab38a51d288c6841f 100644 --- a/share/qtcreator/welcomescreen/widgets/RecentProjects.qml +++ b/share/qtcreator/welcomescreen/widgets/RecentProjects.qml @@ -27,23 +27,21 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import qtcomponents 1.0 +import QtQuick 2.1 +import QtQuick.Controls 1.0 -ScrollArea { - property bool scrollBarVisible: projectList.verticalScrollBar.visible +ScrollView { id: projectList - property alias model: repeater.model - Behavior on verticalScrollBar.opacity { - PropertyAnimation { + property bool scrollBarVisible: false//projectList.verticalScrollBar.visible + property alias model: repeater.model +// Behavior on verticalScrollBar.opacity { +// PropertyAnimation { - } - } +// } +// } - frame: false - horizontalScrollBar.visible: false - clip: true +// frameVisible: false Column { id: column diff --git a/share/qtcreator/welcomescreen/widgets/SearchBar.qml b/share/qtcreator/welcomescreen/widgets/SearchBar.qml index 3eb11b36c27367c2d1242d2c9e93f5fdf449defc..ef8d23c1af32da229feb370a9fa280220fa1510b 100644 --- a/share/qtcreator/welcomescreen/widgets/SearchBar.qml +++ b/share/qtcreator/welcomescreen/widgets/SearchBar.qml @@ -27,35 +27,42 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import qtcomponents 1.0 +import QtQuick 2.1 Rectangle { id: searchBar + width: 930 - height: 31 + height: 27 color: "#ffffff" radius: 6 border.color: "#cccccc" - property alias placeholderText: lineEdit.placeholderText - property alias text: lineEdit.text - CustomFonts { - id: fonts - } + property alias placeholderText: placeHolderText.text + property alias text: lineEdit.text - TextField { + TextInput { id: lineEdit - placeholderText: qsTr("Search...") + anchors.topMargin: 1 anchors.left: parent.left anchors.right: parent.right anchors.rightMargin: 12 anchors.leftMargin: 12 - anchors.verticalCenter: parent.verticalCenter - background: Item {} + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + renderType: Text.NativeRendering font.pixelSize: 14 - font.bold: false font.family: "Helvetica" } + Text { + id: placeHolderText + visible: !lineEdit.text.length + text: qsTr("Search...") + anchors.fill: lineEdit + font: lineEdit.font + verticalAlignment: Text.AlignVCenter + renderType: Text.NativeRendering + color: "gray" + } } diff --git a/share/qtcreator/welcomescreen/widgets/SessionItem.qml b/share/qtcreator/welcomescreen/widgets/SessionItem.qml index c9d97460313258082ca6734e2c761074d6bd1eff..6835974e0fce10407aedaac50a232afb2ed01751 100644 --- a/share/qtcreator/welcomescreen/widgets/SessionItem.qml +++ b/share/qtcreator/welcomescreen/widgets/SessionItem.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 Item { x: 5 @@ -36,10 +36,6 @@ Item { height: column.height property alias name: text.text - CustomFonts { - id: fonts - } - Column { id: column spacing: 4 @@ -100,14 +96,13 @@ Item { Item { z: -1 property int margin: 6 - height: innerColumn.height + margin * 2 + height: expanded ? innerColumn.height + margin * 2 : 0 width: delegate.ListView.view.width - 8 - margin * 2 opacity: delegate.expanded ? 1 : 0 - Behavior on opacity { + Behavior on height { ParallelAnimation { - PauseAnimation { duration: delegate.expanded ? 100 : 0; } - PropertyAnimation { duration: 100; } + PropertyAnimation { duration: 160 ; easing.type: Easing.OutCubic } } } diff --git a/share/qtcreator/welcomescreen/widgets/Sessions.qml b/share/qtcreator/welcomescreen/widgets/Sessions.qml index ee66d45652a9f9fb9a2f356bcdb63c29345d6a50..d83243efd99e3cc514fcbfe595b85ba97a50a8df 100644 --- a/share/qtcreator/welcomescreen/widgets/Sessions.qml +++ b/share/qtcreator/welcomescreen/widgets/Sessions.qml @@ -27,33 +27,25 @@ ** ****************************************************************************/ -import QtQuick 1.0 -import qtcomponents 1.0 +import QtQuick 2.1 +import widgets 1.0 Item { - property alias model: root.model + id: root + property var model property int topMargin: 6 - height: Math.min(root.contentHeight + topMargin, parent.height - 260) - - property alias scrollBarVisible: vscrollbar.visible + height: Math.min(content.contentHeight + topMargin, parent.height - 260) ListView { - id: root + id: content + model: root.model anchors.fill: parent anchors.topMargin: topMargin - snapMode: ListView.SnapToItem - property int delegateHeight: currentItem.height + spacing - //property int delegateHeight: 22 - - interactive: false - spacing: 4 - cacheBuffer: 800 //We need a big cache to avoid artefacts caused by delegate recreation clip: true - delegate: SessionItem { function fullSessionName() { @@ -64,35 +56,7 @@ Item { newSessionName = qsTr("%1 (current session)").arg(sessionName); return newSessionName; } - name: fullSessionName() } - - WheelArea { - id: wheelarea - anchors.fill: parent - verticalMinimumValue: vscrollbar.minimumValue - verticalMaximumValue: vscrollbar.maximumValue - onVerticalValueChanged: root.contentY = verticalValue - } - - ScrollBar { - id: vscrollbar - orientation: Qt.Vertical - property int availableHeight : root.height - visible: root.contentHeight > availableHeight - maximumValue: root.contentHeight > availableHeight ? root.contentHeight - availableHeight : 0 - minimumValue: 0 - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - singleStep: root.delegateHeight - anchors.topMargin: styleitem.style === "mac" ? 1 : 0 - onValueChanged: root.contentY = value - anchors.rightMargin: styleitem.frameoffset - anchors.bottomMargin: styleitem.frameoffset - value: root.contentY - } } - } diff --git a/share/qtcreator/welcomescreen/widgets/ToolTip.qml b/share/qtcreator/welcomescreen/widgets/ToolTip.qml index 165dcb8ede46b46efc0a1de9a120f30952f946e8..24a3b9edd7deb9bd8246a45e3d07fde602a8ccb6 100644 --- a/share/qtcreator/welcomescreen/widgets/ToolTip.qml +++ b/share/qtcreator/welcomescreen/widgets/ToolTip.qml @@ -27,14 +27,12 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 Item { id: toolTip property alias text: text.text - - property int margin: 4 width: text.width + margin * 2 diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleDelegate.qml b/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleDelegate.qml index 09f3ca0e3d29fd2ef827b6f7872594379395f991..cadd814b3d55a8c4236ee25479414699bf9a1249 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleDelegate.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleDelegate.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 import QmlDesigner 1.0 DummyContextObject { diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleGridView.qml b/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleGridView.qml index 6a0564b3cc063b847b4221c0755518f5a5e4f037..6640143b751eb0f67094593358c326d12521bf57 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleGridView.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/context/ExampleGridView.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.0 +import QtQuick 2.1 import QmlDesigner 1.0 DummyContextObject { diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/examplesModel.qml b/share/qtcreator/welcomescreen/widgets/dummydata/examplesModel.qml index beec98855dc31cddf96d019e8ac9e5f9d335919e..1e6872369467166c067bf2bd95b7e17181489971 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/examplesModel.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/examplesModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/mockupTags.qml b/share/qtcreator/welcomescreen/widgets/dummydata/mockupTags.qml index 017d2b636a764af8e7ddf51c2e43e7179cd400b9..8b410ccda5665880e8e00d38ddae1aa0a618ab24 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/mockupTags.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/mockupTags.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/pagesModel.qml b/share/qtcreator/welcomescreen/widgets/dummydata/pagesModel.qml index c98b7f2c459d4b67245ad9294d71a6bdb48fb32f..de41e0dbd091ab427e37e2e124e9b938fda58ed3 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/pagesModel.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/pagesModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 ListModel { ListElement { diff --git a/share/qtcreator/welcomescreen/widgets/dummydata/tabsModel.qml b/share/qtcreator/welcomescreen/widgets/dummydata/tabsModel.qml index e575f6aaca101702596c212fe772718fcb882f2f..c13d74b742848d6b696b8be4cb867d88cd8d06d2 100644 --- a/share/qtcreator/welcomescreen/widgets/dummydata/tabsModel.qml +++ b/share/qtcreator/welcomescreen/widgets/dummydata/tabsModel.qml @@ -27,7 +27,7 @@ ** ****************************************************************************/ -import QtQuick 1.1 +import QtQuick 2.1 ListModel { ListElement { diff --git a/src/libs/utils/iwelcomepage.h b/src/libs/utils/iwelcomepage.h index d05e8b952082ed40d5cfe7a65387fe43aebc110c..2a7db339749ac27f95eac96f09d8548b28b44beb 100644 --- a/src/libs/utils/iwelcomepage.h +++ b/src/libs/utils/iwelcomepage.h @@ -35,7 +35,7 @@ #include <QObject> QT_FORWARD_DECLARE_CLASS(QUrl) -QT_FORWARD_DECLARE_CLASS(QDeclarativeEngine) +QT_FORWARD_DECLARE_CLASS(QQmlEngine) namespace Utils { @@ -63,7 +63,7 @@ public: virtual QUrl pageLocation() const = 0; virtual QString title() const = 0; virtual int priority() const { return 0; } - virtual void facilitateQml(QDeclarativeEngine *) {} + virtual void facilitateQml(QQmlEngine *) {} virtual bool hasSearchBar() const { return false; } virtual Id id() const = 0; }; diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 592481aac1039e18a220c00fb732f2bee6f746b7..51cd8994d1d676c7d5e42bb0bd616bc7f148331b 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -4,7 +4,6 @@ TEMPLATE = subdirs SUBDIRS = \ coreplugin \ - welcome \ find \ texteditor \ cppeditor \ @@ -70,7 +69,8 @@ contains(QT_CONFIG, declarative)|!isEmpty(QT.declarative.name) { greaterThan(QT_MAJOR_VERSION, 4) { SUBDIRS += \ - qmldesigner + qmldesigner \ + welcome } else { include(../private_headers.pri) exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) { diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 0f0d0441226aff744a817456cc006b428420f7cb..7c49ff9e2f3284d13e2a47504b0e99b3208db17d 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -2,6 +2,7 @@ import qbs Project { name: "Plugins" + references: [ "analyzerbase/analyzerbase.qbs", "android/android.qbs", @@ -56,6 +57,11 @@ Project { "updateinfo/updateinfo.qbs", "valgrind/valgrind.qbs", "vcsbase/vcsbase.qbs", - "welcome/welcome.qbs" ] + + Group { + condition: qtcore.versionMajor >= 5 + references: [ "welcome/welcome.qbs" ] + } + } diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 7f1644ad4c98fb9f276ad722b53e7031249d6545..93a7950966fad4cabe20bb63f6de63f1e896fd4c 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -70,7 +70,6 @@ #include "projectnodes.h" #include "sessiondialog.h" #include "projectexplorersettingspage.h" -#include "projectwelcomepage.h" #include "corelistenercheckingforrunningbuild.h" #include "buildconfiguration.h" #include "miniprojecttargetselector.h" @@ -90,6 +89,10 @@ # include "wincetoolchain.h" #endif +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#include "projectwelcomepage.h" +#endif + #include <extensionsystem/pluginspec.h> #include <coreplugin/icore.h> #include <coreplugin/editormanager/ieditor.h> @@ -228,8 +231,11 @@ struct ProjectExplorerPluginPrivate { QString m_projectFilterString; Internal::MiniProjectTargetSelector * m_targetSelector; Internal::ProjectExplorerSettings m_projectExplorerSettings; - Internal::ProjectWelcomePage *m_welcomePage; + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) + Internal::ProjectWelcomePage *m_welcomePage; +#endif IMode *m_projectsMode; TaskHub *m_taskHub; @@ -284,8 +290,10 @@ ProjectExplorerPlugin::ProjectExplorerPlugin() ProjectExplorerPlugin::~ProjectExplorerPlugin() { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) removeObject(d->m_welcomePage); delete d->m_welcomePage; +#endif removeObject(this); // Force sequence of deletion: delete d->m_kitManager; // remove all the profile informations @@ -348,9 +356,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards())); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) d->m_welcomePage = new ProjectWelcomePage; connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager())); addObject(d->m_welcomePage); +#endif connect(DocumentManager::instance(), SIGNAL(currentFileChanged(QString)), this, SLOT(setCurrentFile(QString))); @@ -1085,7 +1095,9 @@ void ProjectExplorerPlugin::closeAllProjects() SessionManager::closeAllProjects(); updateActions(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) ModeManager::activateMode(Core::Constants::MODE_WELCOME); +#endif } void ProjectExplorerPlugin::extensionsInitialized() @@ -1212,9 +1224,11 @@ void ProjectExplorerPlugin::showSessionManager() updateActions(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) IMode *welcomeMode = ModeManager::mode(Core::Constants::MODE_WELCOME); if (ModeManager::currentMode() == welcomeMode) updateWelcomePage(); +#endif } void ProjectExplorerPlugin::setStartupProject(Project *project) @@ -1443,7 +1457,9 @@ void ProjectExplorerPlugin::setCurrentNode(Node *node) void ProjectExplorerPlugin::updateWelcomePage() { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) d->m_welcomePage->reloadWelcomeScreenData(); +#endif } void ProjectExplorerPlugin::currentModeChanged(IMode *mode, IMode *oldMode) @@ -1564,9 +1580,10 @@ void ProjectExplorerPlugin::restoreSession() connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)), SLOT(currentModeChanged(Core::IMode*,Core::IMode*))); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString))); connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString))); - +#endif d->m_arguments = arguments; QTimer::singleShot(0, this, SLOT(restoreSession2())); updateActions(); diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro index 324d8c2d2ece17f20276edc55f9e9c1800eb29b6..0c0eae361d3b397d55df7d6e5845e534b76b2669 100644 --- a/src/plugins/projectexplorer/projectexplorer.pro +++ b/src/plugins/projectexplorer/projectexplorer.pro @@ -1,4 +1,4 @@ -QT += xml script declarative +QT += xml script include(../../qtcreatorplugin.pri) include(customwizard/customwizard.pri) @@ -84,7 +84,6 @@ HEADERS += projectexplorer.h \ cesdkhandler.h \ gccparser.h \ projectexplorersettingspage.h \ - projectwelcomepage.h \ baseprojectwizarddialog.h \ miniprojecttargetselector.h \ targetselector.h \ @@ -214,7 +213,6 @@ SOURCES += projectexplorer.cpp \ cesdkhandler.cpp \ gccparser.cpp \ projectexplorersettingspage.cpp \ - projectwelcomepage.cpp \ corelistenercheckingforrunningbuild.cpp \ baseprojectwizarddialog.cpp \ miniprojecttargetselector.cpp \ @@ -302,6 +300,11 @@ equals(TEST, 1) { outputparser_test.h } +greaterThan(QT_MAJOR_VERSION, 4) { + QT += quick + HEADERS += projectwelcomepage.h + SOURCES += projectwelcomepage.cpp +} macx:LIBS += -framework Carbon RESOURCES += projectexplorer.qrc diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs index 449e3975c0c926208c57bbbd3fd63febd4c8304d..3faba5ea1aaaae63e3d3ba80593a9359e1a9c6ac 100644 --- a/src/plugins/projectexplorer/projectexplorer.qbs +++ b/src/plugins/projectexplorer/projectexplorer.qbs @@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin QtcPlugin { name: "ProjectExplorer" - Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script", "declarative"] } + Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script", "quick"] } Depends { name: "Core" } Depends { name: "Locator" } Depends { name: "Find" } @@ -109,7 +109,6 @@ QtcPlugin { "projectmodels.cpp", "projectmodels.h", "projectnodes.cpp", "projectnodes.h", "projecttreewidget.cpp", "projecttreewidget.h", - "projectwelcomepage.cpp", "projectwelcomepage.h", "projectwindow.cpp", "projectwindow.h", "projectwizardpage.cpp", "projectwizardpage.h", "projectwizardpage.ui", "removetaskhandler.cpp", "removetaskhandler.h", @@ -136,6 +135,15 @@ QtcPlugin { "toolchainoptionspage.cpp", "toolchainoptionspage.h", "vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h", ] + + Group { + condition: qtcore.versionMajor >= 5 + references: [ + "projectwelcomepage.cpp", + "projectwelcomepage.h" + ] + } + } Group { diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp index 9578c88df922d04fc6abd0ac72eeaab2dc3dc686..db71fccfa868bb2072c5a683534831981229fba3 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.cpp +++ b/src/plugins/projectexplorer/projectwelcomepage.cpp @@ -31,8 +31,8 @@ #include <utils/stringutils.h> -#include <QDeclarativeEngine> -#include <QDeclarativeContext> +#include <QQmlContext> +#include <QQmlEngine> #include <QFileInfo> #include <QDir> @@ -212,12 +212,12 @@ ProjectWelcomePage::ProjectWelcomePage() : { } -void ProjectWelcomePage::facilitateQml(QDeclarativeEngine *engine) +void ProjectWelcomePage::facilitateQml(QQmlEngine *engine) { m_sessionModel = new SessionModel(this); m_projectModel = new ProjectModel(ProjectExplorerPlugin::instance(), this); - QDeclarativeContext *ctx = engine->rootContext(); + QQmlContext *ctx = engine->rootContext(); ctx->setContextProperty(QLatin1String("sessionList"), m_sessionModel); ctx->setContextProperty(QLatin1String("projectList"), m_projectModel); ctx->setContextProperty(QLatin1String("projectWelcomePage"), this); diff --git a/src/plugins/projectexplorer/projectwelcomepage.h b/src/plugins/projectexplorer/projectwelcomepage.h index 6ce2f856e35f649f5ed64685df83560c27cc928c..96a6f6c0278796f0f50b28e23502c674eccfa9fd 100644 --- a/src/plugins/projectexplorer/projectwelcomepage.h +++ b/src/plugins/projectexplorer/projectwelcomepage.h @@ -35,7 +35,7 @@ #include <utils/iwelcomepage.h> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; QT_END_NAMESPACE namespace ProjectExplorer { @@ -87,7 +87,7 @@ class ProjectWelcomePage : public Utils::IWelcomePage public: ProjectWelcomePage(); - void facilitateQml(QDeclarativeEngine *engine); + void facilitateQml(QQmlEngine *engine); QUrl pageLocation() const; QWidget *page() { return 0; } QString title() const { return tr("Develop"); } diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index d6cbedb306e32f89f6ca57580c14502ba61b2105..71286c838ea7c6d4497eac60f2703ce83ffc868a 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -61,9 +61,9 @@ #include <QPushButton> #include <QMessageBox> #include <QApplication> -#include <QDeclarativeImageProvider> -#include <QDeclarativeEngine> -#include <QDeclarativeContext> +#include <QQuickImageProvider> +#include <QQmlEngine> +#include <QQmlContext> #include <QDesktopServices> using namespace Utils; @@ -170,11 +170,11 @@ public: bool m_shutdown; }; -class HelpImageProvider : public QDeclarativeImageProvider +class HelpImageProvider : public QQuickImageProvider { public: HelpImageProvider() - : QDeclarativeImageProvider(QDeclarativeImageProvider::Image) + : QQuickImageProvider(QQuickImageProvider::Image) { } @@ -231,7 +231,7 @@ int GettingStartedWelcomePage::priority() const return 4; } -void GettingStartedWelcomePage::facilitateQml(QDeclarativeEngine *engine) +void GettingStartedWelcomePage::facilitateQml(QQmlEngine *engine) { m_engine = engine; } @@ -288,7 +288,7 @@ QUrl ExamplesWelcomePage::pageLocation() const return QUrl::fromLocalFile(resourcePath + QLatin1String("/welcomescreen/tutorials.qml")); } -void ExamplesWelcomePage::facilitateQml(QDeclarativeEngine *engine) +void ExamplesWelcomePage::facilitateQml(QQmlEngine *engine) { m_engine = engine; m_engine->addImageProvider(QLatin1String("helpimage"), new HelpImageProvider); @@ -299,7 +299,7 @@ void ExamplesWelcomePage::facilitateQml(QDeclarativeEngine *engine) proxy->sort(0); proxy->setFilterCaseSensitivity(Qt::CaseInsensitive); - QDeclarativeContext *rootContenxt = m_engine->rootContext(); + QQmlContext *rootContenxt = m_engine->rootContext(); if (m_showExamples) { proxy->setShowTutorialsOnly(false); rootContenxt->setContextProperty(QLatin1String("examplesModel"), proxy); diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.h b/src/plugins/qtsupport/gettingstartedwelcomepage.h index b35a4cd6d549c64e62cc26b7480098c053558a0b..515cac9b5d076960be00270343f246b1760d4d7a 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.h +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.h @@ -35,7 +35,7 @@ #include <QStringList> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; class QFileInfo; QT_END_NAMESPACE @@ -54,11 +54,11 @@ public: QUrl pageLocation() const; QString title() const; int priority() const; - void facilitateQml(QDeclarativeEngine *); + void facilitateQml(QQmlEngine *); Id id() const; private: - QDeclarativeEngine *m_engine; + QQmlEngine *m_engine; }; @@ -74,7 +74,7 @@ public: QString title() const; int priority() const; bool hasSearchBar() const; - void facilitateQml(QDeclarativeEngine *); + void facilitateQml(QQmlEngine *); Id id() const; Q_INVOKABLE QStringList tagList() const; Q_INVOKABLE void openUrl(const QUrl &url); @@ -92,7 +92,7 @@ public slots: private: ExamplesListModel *examplesModel() const; QString copyToAlternativeLocation(const QFileInfo &fileInfo, QStringList &filesToOpen, const QStringList &dependencies); - QDeclarativeEngine *m_engine; + QQmlEngine *m_engine; bool m_showExamples; }; diff --git a/src/plugins/qtsupport/qtsupport.pro b/src/plugins/qtsupport/qtsupport.pro index d98993eddde43680041cc10c0561e088ef16e7b6..af48b82a6f2ae152a9a7d2060b8ea7bdf915c88d 100644 --- a/src/plugins/qtsupport/qtsupport.pro +++ b/src/plugins/qtsupport/qtsupport.pro @@ -1,5 +1,5 @@ DEFINES += QTSUPPORT_LIBRARY -QT += network declarative +QT += network include(../../qtcreatorplugin.pri) @@ -27,7 +27,6 @@ HEADERS += \ qtsupportconstants.h \ profilereader.h \ qtparser.h \ - gettingstartedwelcomepage.h \ exampleslistmodel.h \ screenshotcropper.h \ qtconfigwidget.h \ @@ -52,11 +51,16 @@ SOURCES += \ debugginghelperbuildtask.cpp \ profilereader.cpp \ qtparser.cpp \ - gettingstartedwelcomepage.cpp \ exampleslistmodel.cpp \ screenshotcropper.cpp \ qtconfigwidget.cpp +greaterThan(QT_MAJOR_VERSION, 4) { + QT += quick + HEADERS += gettingstartedwelcomepage.h + SOURCES += gettingstartedwelcomepage.cpp +} + FORMS += \ showbuildlog.ui \ qtversioninfo.ui \ diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs index e09ef1d726ba0f205d69248969c3527511cb0619..74924118c0e80b91108db954ad9fb79d66335618 100644 --- a/src/plugins/qtsupport/qtsupport.qbs +++ b/src/plugins/qtsupport/qtsupport.qbs @@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin QtcPlugin { name: "QtSupport" - Depends { name: "Qt"; submodules: ["widgets", "declarative"] } + Depends { name: "Qt"; submodules: ["widgets", "quick"] } Depends { name: "Core" } Depends { name: "ProjectExplorer" } Depends { name: "TextEditor" } @@ -70,8 +70,6 @@ QtcPlugin { "debugginghelperbuildtask.h", "exampleslistmodel.cpp", "exampleslistmodel.h", - "gettingstartedwelcomepage.cpp", - "gettingstartedwelcomepage.h", "profilereader.cpp", "profilereader.h", "qmldebugginglibrary.cpp", @@ -112,6 +110,15 @@ QtcPlugin { "images/qt_qrc.png", ] + Group { + condition: qtcore.versionMajor >= 5 + files: [ + "gettingstartedwelcomepage.cpp", + "gettingstartedwelcomepage.h" + ] + } + + Export { Depends { name: "cpp" } cpp.includePaths: "../../shared" diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index ac2bccae381ce6a77bf3088ab00d41b7fe5eab6f..ada53bc6144014d63955e4f6684a67b216960b12 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -38,8 +38,6 @@ #include "profilereader.h" -#include "gettingstartedwelcomepage.h" - #include <coreplugin/icore.h> #include <coreplugin/mimedatabase.h> #include <coreplugin/variablemanager.h> @@ -47,6 +45,10 @@ #include <projectexplorer/projectexplorer.h> #include <projectexplorer/target.h> +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) +#include "gettingstartedwelcomepage.h" +#endif + #include <QtPlugin> static const char kHostBins[] = "CurrentProject:QT_HOST_BINS"; @@ -75,18 +77,16 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes addAutoReleasedObject(new QtOptionsPage); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) ExamplesWelcomePage *welcomePage; welcomePage = new ExamplesWelcomePage; addAutoReleasedObject(welcomePage); - - welcomePage = new ExamplesWelcomePage; welcomePage->setShowExamples(true); - addAutoReleasedObject(welcomePage); GettingStartedWelcomePage *gettingStartedWelcomePage = new GettingStartedWelcomePage; addAutoReleasedObject(gettingStartedWelcomePage); - addAutoReleasedObject(new CustomExecutableRunConfigurationFactory); +#endif ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation); diff --git a/src/plugins/welcome/welcome.pro b/src/plugins/welcome/welcome.pro index 9920c75f6830be0caa14ead6166f6db7288e7b83..b201120c74a9d6bbecb2af3c150a5affae08a60d 100644 --- a/src/plugins/welcome/welcome.pro +++ b/src/plugins/welcome/welcome.pro @@ -1,4 +1,4 @@ -QT += network declarative +QT += network quick include(../../qtcreatorplugin.pri) diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs index 20b0400f548666ffc25f3ac437bf645cf824a3c7..93ca3f4e61b6028645067346d36472a72f6ad0dc 100644 --- a/src/plugins/welcome/welcome.qbs +++ b/src/plugins/welcome/welcome.qbs @@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin QtcPlugin { name: "Welcome" - Depends { name: "Qt"; submodules: ["widgets", "network", "declarative"] } + Depends { name: "Qt"; submodules: ["widgets", "network", "quick"] } Depends { name: "Core" } Depends { name: "ProjectExplorer" } diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index befdf9d5dc85ad3419658af6447553ec0542f0e0..3ade9ca053148a07f7249302824198c120d07b57 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -61,10 +61,10 @@ #include <QUrl> #include <QtPlugin> -#include <QDeclarativeView> -#include <QDeclarativeContext> -#include <QDeclarativeEngine> -#include <QDeclarativeNetworkAccessManagerFactory> +#include <QtQuick/QQuickView> +#include <QtQml/QQmlContext> +#include <QtQml/QQmlEngine> +#include <QtQml/QQmlNetworkAccessManagerFactory> enum { debug = 0 }; @@ -76,10 +76,10 @@ static const char currentPageSettingsKeyC[] = "WelcomeTab"; namespace Welcome { namespace Internal { -class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory +class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory { public: - NetworkAccessManagerFactory(): QDeclarativeNetworkAccessManagerFactory() {} + NetworkAccessManagerFactory(): QQmlNetworkAccessManagerFactory() {} QNetworkAccessManager* create(QObject *parent) { return new Utils::NetworkAccessManager(parent); } }; @@ -103,7 +103,7 @@ public: Q_SCRIPTABLE QString platform() const; - bool eventFilter(QObject *, QEvent *); +// bool eventFilter(QObject *, QEvent *); public slots: void setActivePlugin(int pos) @@ -121,10 +121,10 @@ private slots: void welcomePluginAdded(QObject*); private: - void facilitateQml(QDeclarativeEngine *engine); + void facilitateQml(QQmlEngine *engine); QWidget *m_modeWidget; - QDeclarativeView *m_welcomePage; + QQuickView *m_welcomePage; QList<QObject*> m_pluginList; int m_activePlugin; NetworkAccessManagerFactory *m_networkAccessManagerFactory; @@ -146,40 +146,46 @@ WelcomeMode::WelcomeMode() : setContextHelpId(QLatin1String("Qt Creator Manual")); setContext(Core::Context(Core::Constants::C_WELCOME_MODE)); - m_welcomePage = new QDeclarativeView; - m_welcomePage->setResizeMode(QDeclarativeView::SizeRootObjectToView); - // filter to forward dragEnter events - m_welcomePage->installEventFilter(this); - m_welcomePage->viewport()->installEventFilter(this); + m_welcomePage = new QQuickView; + m_welcomePage->setResizeMode(QQuickView::SizeRootObjectToView); + +// filter to forward dragEnter events +// m_welcomePage->installEventFilter(this); +// m_welcomePage->viewport()->installEventFilter(this); m_modeWidget = new QWidget; QVBoxLayout *layout = new QVBoxLayout; layout->setMargin(0); layout->setSpacing(0); - m_modeWidget->setLayout(layout); Utils::StyledBar* styledBar = new Utils::StyledBar(m_modeWidget); layout->addWidget(styledBar); - QScrollArea *scrollArea = new QScrollArea(m_modeWidget); - scrollArea->setFrameShape(QFrame::NoFrame); - layout->addWidget(scrollArea); - scrollArea->setWidget(m_welcomePage); - scrollArea->setWidgetResizable(true); + + // QScrollArea *scrollArea = new QScrollArea(m_modeWidget); + // scrollArea->setFrameShape(QFrame::NoFrame); + // layout->addWidget(scrollArea); + // scrollArea->setWidget(m_welcomePage); + // scrollArea->setWidgetResizable(true); + m_welcomePage->setMinimumWidth(880); m_welcomePage->setMinimumHeight(548); + QWidget *container = QWidget::createWindowContainer(m_welcomePage, m_modeWidget); + layout->addWidget(container); + m_modeWidget->setLayout(layout); + connect(PluginManager::instance(), SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*))); setWidget(m_modeWidget); } -bool WelcomeMode::eventFilter(QObject *, QEvent *e) -{ - if (e->type() == QEvent::DragEnter) { - e->ignore(); - return true; - } - return false; -} +//bool WelcomeMode::eventFilter(QObject *, QEvent *e) +//{ +// if (e->type() == QEvent::DragEnter) { +// e->ignore(); +// return true; +// } +// return false; +//} WelcomeMode::~WelcomeMode() { @@ -194,7 +200,7 @@ bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b) return a->priority() < b->priority(); } -void WelcomeMode::facilitateQml(QDeclarativeEngine * /*engine*/) +void WelcomeMode::facilitateQml(QQmlEngine * /*engine*/) { } @@ -227,7 +233,7 @@ void WelcomeMode::initPlugins() if (activePlugin() > 1) setActivePlugin(1); - QDeclarativeContext *ctx = m_welcomePage->rootContext(); + QQmlContext *ctx = m_welcomePage->rootContext(); ctx->setContextProperty(QLatin1String("welcomeMode"), this); QList<Utils::IWelcomePage*> duplicatePlugins = PluginManager::getObjects<Utils::IWelcomePage>(); @@ -255,7 +261,7 @@ void WelcomeMode::initPlugins() } - QDeclarativeEngine *engine = m_welcomePage->engine(); + QQmlEngine *engine = m_welcomePage->engine(); QStringList importPathList = engine->importPathList(); importPathList << resourcePath() + QLatin1String("/welcomescreen"); engine->setImportPathList(importPathList); @@ -322,7 +328,7 @@ void WelcomeMode::welcomePluginAdded(QObject *obj) } m_pluginList.insert(insertPos, plugin); // update model through reset - QDeclarativeContext *ctx = m_welcomePage->rootContext(); + QQmlContext *ctx = m_welcomePage->rootContext(); ctx->setContextProperty(QLatin1String("pagesModel"), QVariant::fromValue(m_pluginList)); } } diff --git a/src/plugins/welcome/welcomeplugin.h b/src/plugins/welcome/welcomeplugin.h index c320d1f7115af57082b9aeda29f86dee8a392010..c69eff7f385c47fd8e5ada9942cc994e84e3a0ed 100644 --- a/src/plugins/welcome/welcomeplugin.h +++ b/src/plugins/welcome/welcomeplugin.h @@ -33,7 +33,7 @@ #include <extensionsystem/iplugin.h> QT_BEGIN_NAMESPACE -class QDeclarativeEngine; +class QQmlEngine; QT_END_NAMESPACE namespace Welcome {