Commit d13b22e6 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.6'

 Conflicts:
	src/plugins/coreplugin/editormanager/editormanager.cpp

Change-Id: Ibdf433b54e36e58182b7094f78d47ed3e8c81684
parents 2afae6f2 0bcddcd0
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
Image {
source: "Bluebubble.svg"
smooth: true
property real centerX
property real centerY
property real bubbleCenter
}
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
Item {
id: id
width: 640
height: 480
property alias bubble: bubble
property alias mainWindow: mainWindow
Rectangle {
id: mainWindow
color: "#ffffff"
anchors.rightMargin: 0
anchors.bottomMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.fill: parent
}
Bubble {
id: bubble
x: 10
y: 18
}
}
TEMPLATE = app
QT += qml quick widgets
QT += qml quick sensors svg xml
CONFIG += c++11
SOURCES += main.cpp
......@@ -11,4 +13,3 @@ QML_IMPORT_PATH =
# Default rules for deployment.
include(deployment.pri)
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}
/**************************************************************************
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
** Contact: http://www.qt.io/licensing/
**
** This file is part of Qt Creator
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
......@@ -16,10 +17,10 @@
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of The Qt Company Ltd and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
** * Neither the name of The Qt Company Ltd nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
......@@ -33,90 +34,80 @@
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
**************************************************************************/
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtSensors 5.0
import QtQuick.Dialogs 1.2
import QtSensors 5.5
ApplicationWindow {
title: qsTr("Accelerate Bubble")
id: mainWindow
visible: true
width: 640
height: 480
visible: true
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("&Open")
onTriggered: console.log("Open action triggered");
}
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
title: qsTr("Accelerate Bubble")
Image {
id: bubble
source: "Bluebubble.svg"
smooth: true
property real centerX: mainWindow.width / 2
property real centerY: mainWindow.height / 2
property real bubbleCenter: bubble.width / 2
x: centerX - bubbleCenter
y: centerY - bubbleCenter
MainForm {
anchors.fill: parent
bubble {
id: bubble
centerX: mainWindow.width / 2
centerY: mainWindow.height / 2
bubbleCenter: bubble.width / 2
x: bubble.centerX - bubble.bubbleCenter
y: bubble.centerY - bubble.bubbleCenter
Behavior on y {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
Behavior on y {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
Behavior on x {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
Behavior on x {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
}
Accelerometer {
id: accel
dataRate: 100
active:true
}
}
onReadingChanged: {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
Accelerometer {
id: accel
dataRate: 100
active: true
if (isNaN(newX) || isNaN(newY))
return;
onReadingChanged: {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (newX < 0)
newX = 0
if (isNaN(newX) || isNaN(newY))
return;
if (newX > mainWindow.width - bubble.width)
newX = mainWindow.width - bubble.width
if (newX < 0)
newX = 0
if (newY < 18)
newY = 18
if (newX > mainWindow.width - bubble.width)
newX = mainWindow.width - bubble.width
if (newY > mainWindow.height - bubble.height)
newY = mainWindow.height - bubble.height
if (newY < 18)
newY = 18
bubble.x = newX
bubble.y = newY
}
}
if (newY > mainWindow.height - bubble.height)
newY = mainWindow.height - bubble.height
bubble.x = newX
bubble.y = newY
}
}
function calcPitch(x, y, z) {
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
}
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
function calcPitch(x, y, z) {
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
}
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
}
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>MainForm.ui.qml</file>
<file>Bubble.qml</file>
<file>Bluebubble.svg</file>
</qresource>
</RCC>
doc/images/qtcreator-compile-pane.png

70.2 KB | W: | H:

doc/images/qtcreator-compile-pane.png

8.54 KB | W: | H:

doc/images/qtcreator-compile-pane.png
doc/images/qtcreator-compile-pane.png
doc/images/qtcreator-compile-pane.png
doc/images/qtcreator-compile-pane.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -142,7 +142,7 @@
\li Select \uicontrol Tools > \uicontrol Options >
\uicontrol {C++} > \uicontrol {Code Model},
and select the parser to use for files of each type.
and select \uicontrol {Use Clang Code Model}.
\li To process pre-compiled headers before processing any project files,
deselect the \uicontrol {Ignore pre-compiled headers} check box.
......
......@@ -1510,7 +1510,7 @@
defined file pattern only in the project you are currently
editing.
\li \uicontrol {Files on File System} recursively searches files
\li \uicontrol {Files in File System} recursively searches files
matching the defined file pattern in the selected directory.
\li \uicontrol {Current File} searches only the current file.
......
......@@ -354,7 +354,8 @@
To search within the \uicontrol{Application Output} and \uicontrol{Compile Output}
panes, press \key {Ctrl+F} when the pane is active. Enter search criteria in
the \uicontrol Find field and click the left and right arrows to search down and
up in the pane.
up in the pane. In these panes, you can also use the zoom buttons to increase and
decrease the text size of the output.
To open the \uicontrol{General Messages} and \l{Using Version Control Systems}
{Version Control} panes, select
......
......@@ -72,6 +72,12 @@
\uicontrol {Clean Project}. To clean the build directory and then build the
project, select \uicontrol Build > \uicontrol {Rebuild All} or \uicontrol {Rebuild Project}.
To build and clean projects without dependencies, select the
\uicontrol {Build Without Dependencies},
\uicontrol {Rebuild Without Dependencies}, and
\uicontrol {Clean Without Dependencies} options in the context menu in the
\uicontrol Projects view.
To run qmake to generate new Makefiles, select \uicontrol Build > \uicontrol qmake.
*/
......@@ -93,20 +93,39 @@
Normally, there is no need to pass any command line arguments for projects
that are already built, as CMake caches that information.
\section1 Editing CMake Configuration Files
You can open CMake configuration files in \QC for editing. The following
features are supported:
\list
\li Pressing \key F2 when the cursor is on a filename to open the file
\li Keyword completion
\li Auto-indentation
\li Matching parentheses and quotes
\endlist
\section1 Building CMake Projects
\QC builds CMake projects by running \c make, \c mingw32-make,
\c nmake, or \c ninja depending on your platform. The build errors and
warnings are parsed and displayed in the \uicontrol Issues output pane.
By default, \QC builds the \b{all} target. You can specify which
targets to build in \uicontrol Projects mode, under
\uicontrol {Build Settings}.
By default, \QC uses the \uicontrol All \l{glossary-build-config}
{build configuration}. You can select another build configuration in
\uicontrol Projects > \uicontrol {Edit build configuration}. In addition to
debug and release build configurations, you can create a release build that
contains debug information or a release build with the smallest possible
size.
\image qtcreator-cmake-build-settings.png
\QC supports multiple build configurations. You can change the build
directory after the initial import.
You can change the build directory after the initial import.
The build and run kit that you select determines which CMake tool is used
for building. For more information, see \l {Adding Kits}.
......
......@@ -51,6 +51,11 @@
\li Select projects that must be built before the current project is
built.
\li Select the \uicontrol {Synchronize configuration} check box to
use the same kit as well as the same build and deploy
configuration to build and deploy all dependent projects loaded
in a session.
\endlist
\QC calculates the build order based on the dependencies that you
......
......@@ -57,113 +57,122 @@
Program certificate that you receive from Apple. For more information, see
\l{Connecting iOS Devices}.
\section1 Creating the Project
\include creator-tutorial-create-qq-project.qdocinc
\list 1
\section1 Creating the Accelbubble Main View
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Application > \uicontrol {Qt Quick Controls Application}
> \uicontrol Choose.
The main view of the application displays an SVG bubble image that moves
around the screen when you tilt the device.
\li In the \uicontrol Name field, type \e {accelbubble}.
To use \l{accelbubble/Bluebubble.svg}{Bluebubble.svg} in your project,
copy it to the project directory (same subdirectory as the QML file).
The image appears in \uicontrol Resources. You can also use any other
image or a QML type, instead.
\li In the \uicontrol {Create in} field, enter the path for the project
files, and then click \uicontrol Next (or \uicontrol Continue on
OS X).
To create the UI in the \uicontrol Design mode:
\li In the \uicontrol {Minimal required Qt version} field, select the Qt
version to develop with.
\list 1
\note This page determines the set of files that the wizard
generates and their contents. The instructions in this tutorial
might not apply if you select the \uicontrol {With .ui.qml file}
check box.
\li In the \uicontrol Projects view, double-click the MainForm.ui.qml
file to open it in \QMLD.
\li Select \l{glossary-buildandrun-kit}{kits} for Android ARM and iPhone
OS, and click \uicontrol{Next}.
\li In the \uicontrol Navigator, select \uicontrol RowLayout and press
\key Delete to delete it.
\note Kits are listed if they have been specified in \uicontrol Tools >
\uicontrol Options > \uicontrol {Build & Run} > \uicontrol Kits (on Windows and Linux)
or in \uicontrol {Qt Creator} > \uicontrol Preferences \uicontrol {Build & Run} >
\uicontrol Kits (on OS X).
\li In \uicontrol Library > \uicontrol {QML Types}, select
\uicontrol Rectangle and drag and drop it to the \uicontrol Item in
the navigator.
\li Select \uicontrol Next in the following dialogs to use the default
settings.
\li Select the rectangle in the navigator to edit its properties:
\li Review the project settings, and click \uicontrol{Finish} (or \uicontrol Done on
OS X).
\list a
\endlist
\li In the \uicontrol Id field enter \e mainWindow, to be able
to reference the rectangle from other places.
\QC generates a default QML file that you can modify to create the main view
of the application.
\li Select the \uicontrol Layout tab, and then click
the \inlineimage qmldesigner-anchor-fill-screen.png
(\uicontrol {Fill to Parent}) button to anchor the rectangle
to the item.
\section1 Creating the Main View
\endlist
The main view of the application displays an SVG bubble image at the center
of the main window.
\li In \uicontrol Library > \uicontrol Resources, select Bluebubble.svg
and drag and drop it to \e mainWindow in the navigator.
To use \l{accelbubble/Bluebubble.svg}{Bluebubble.svg} in your project,
copy it to the project directory (same subdirectory as the QML file).
The image appears in \uicontrol Resources. You can also use any other
image or a QML type, instead.
\li In the \uicontrol Properties pane, \uicontrol Id field, enter
\e bubble to be able to reference the image from other places.
\li Select the \inlineimage qmldesigner-export-item-button.png
(\uicontrol Export) button in the navigator to export the
\e mainWindow and \e bubble as properties.
\endlist
We want to modify the properties of the bubble in ways that are not
supported by \QMLD, and therefore we create a custom QML type for it:
\list 1
\li In the \uicontrol Projects view, double-click the main.qml file
to open it in the code editor.
\li Select \uicontrol Edit to open MainForm.ui.qml in the code editor.
\li Click \uicontrol Design to open the file in \QMLD.
\li Right-click \uicontrol Image and select \uicontrol Refactoring >
\uicontrol {Move Component into Separate File}.
\li In the \uicontrol Navigator, select \uicontrol Label and press
\key Delete to delete it.
\li In the \uicontrol {Component name} field, enter \e Bubble and
select \uicontrol OK to create \e Bubble.qml.
\li Select \uicontrol ApplicationWindow to edit its properties.
\endlist
\list a
\QC creates a reference to Bubble.qml in MainForm.ui.qml.
\li In the \uicontrol Id field, enter \e mainWindow, to be able to
reference the window from other places.
To check your code, you can compare MainForm.ui.qml with the
\l{accelbubble/MainForm.ui.qml}{MainForm.ui.qml} example file and Bubble.qml
with the \l{accelbubble/Bubble.qml}{Bubble.qml} example file.
\li In the \uicontrol Title field, type \e {Accelerate Bubble}.
The UI is now ready and you can switch to editing the main.qml and
Bubble.qml files in the \uicontrol Edit mode, as described in the
following section.
\endlist
\section1 Moving the Bubble
\li In \uicontrol Library > \uicontrol Resources, select Bluebubble.svg
and drag and drop it to the canvas.
The new project wizard adds boilerplate code to the main.qml file to create
menu items and push buttons. Modify the boilerplate code by removing
obsolete code and by adding new code. You removed the push buttons from the
UI Form, so you also need to remove the corresponding code from main.qml (or
the application cannot be built).
\li In the \uicontrol Properties pane, \uicontrol Id field, enter \e bubble to be