Commit cdd19fe6 authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/3.0'

Conflicts:
	src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp

Change-Id: If62ec06ea069a7eba6735101e5334b0c1f66861f
parents a309b3cf 73127334
......@@ -92,93 +92,93 @@
./android update sdk
\endcode
\section1 Developing with Qt 4
\section1 Developing with Qt 5
The Necessitas SDK automatically sets the paths to the required software
in \QC, but you need to add the Qt version. \QC can then create the
necessary kits for you.
You must download and install the latest Android NDK and SDK, and update the
SDK to get the API and tools packages needed for development. In addition,
you must install Qt for Android as part of Qt 5.2, or later.
For more information, see \l{Qt for Android}.
To configure connections between \QC and Android devices:
\list 1
\li Select \gui Tools > \gui Options > \gui {Build & Run} >
\gui {Qt Versions} > \gui Add to add the path to \c qmake path in
the Qt for Android SDK.
\li Select \gui Tools > \gui Options > \gui Android to check the paths
to the required software.
\li Select \gui Tools > \gui Options > \gui Android to add paths to the
Android NDK and SDK.
\image qtcreator-options-android.png "Android options"
\image qtcreator-options-android1.png "Android options"
\li Select the \gui {Automatically create kits for Android tool chains}
check box to allow \QC to create the kits for you. \QC displays a
warning if it cannot find a suitable Qt version.
\li To create an application, select \gui File >
\gui {New File or Project} > \gui Applications >
\li Select \gui File > \gui {New File or Project} > \gui Applications >
\gui {Qt Quick Application} > \gui Choose, and
follow the instructions of the wizard. For more information, see
\l{Creating Qt Quick Projects}.
\li To specify information for the Android manifest file, select
\gui Projects > \gui Run for the \gui Android kit.
\li Select \gui Details to view the
\gui {Package configurations}. For more information about the
options you have, see
\l{Specifying Settings for Qt 4 Packages}.
\li To specify settings for deploying applications to Android, select
\gui Projects > \gui Run for the \gui Android kit, and then select
\gui Details to view the \gui {Deploy configurations}. For more
information about the options you have, see
\l{Deploying Applications to Android Devices}.
\endlist
\li Enable debugging on your Android device.
\section1 Developing with Qt 5
Debugging is enabled in different ways on different Android devices.
Look for \gui {USB Debugging} under \gui {Developer Options}. On
some devices \gui {Developer Options} is hidden and becomes visible
when you tap the \gui {Build number} field in \gui Settings >
\gui About several times.
You must download and install the latest Android NDK and SDK, and update the
SDK to get the API and tools packages needed for development. In addition,
you must install Qt for Android as part of Qt 5.2, or later.
\li Connect the Android device to the development PC with a USB cable.
You might be asked to select a device in the
\gui {Select Android Devices} dialog.
\endlist
For more information, see \l{Qt for Android}.
\section1 Developing with Qt 4
The Necessitas SDK automatically sets the paths to the required software
in \QC, but you need to add the Qt version. \QC can then create the
necessary kits for you.
To configure connections between \QC and Android devices:
\list 1
\li Select \gui Tools > \gui Options > \gui Android to add paths to the
Android NDK and SDK.
\li Select \gui Tools > \gui Options > \gui {Build & Run} >
\gui {Qt Versions} > \gui Add to add the path to \c qmake path in
the Qt for Android SDK.
\image qtcreator-options-android1.png "Android options"
\li Select \gui Tools > \gui Options > \gui Android to check the paths
to the required software.
\image qtcreator-options-android.png "Android options"
\li Select the \gui {Automatically create kits for Android tool chains}
check box to allow \QC to create the kits for you. \QC displays a
warning if it cannot find a suitable Qt version.
\li Select \gui File > \gui {New File or Project} > \gui Applications >
\li To create an application, select \gui File >
\gui {New File or Project} > \gui Applications >
\gui {Qt Quick Application} > \gui Choose, and
follow the instructions of the wizard. For more information, see
\l{Creating Qt Quick Projects}.
\li To specify information for the Android manifest file, select
\gui Projects > \gui Run for the \gui Android kit.
\li Select \gui Details to view the
\gui {Package configurations}. For more information about the
options you have, see
\l{Specifying Settings for Qt 4 Packages}.
\li To specify settings for deploying applications to Android, select
\gui Projects > \gui Run for the \gui Android kit, and then select
\gui Details to view the \gui {Deploy configurations}. For more
information about the options you have, see
\l{Deploying Applications to Android Devices}.
\li Enable debugging on your Android device.
Debugging is enabled in different ways on different Android devices.
Look for \gui {USB Debugging} under \gui {Developer Options}. On
some devices \gui {Developer Options} is hidden and becomes visible
when you tap the \gui {Build number} field in \gui Settings >
\gui About several times.
\li Connect the Android device to the development PC with a USB cable.
You might be asked to select a device in the
\gui {Select Android Devices} dialog.
\endlist
\section1 Selecting Android Devices
......
......@@ -39,6 +39,17 @@
\image creator_android_tutorial_ex_app.png
\section1 Setting up the Development Environment
To be able to build and run the application, you must download and install
the latest Android NDK and SDK, and update the SDK to get the API and tools
packages needed for development. In addition, you must install the
Java SE Development Kit (JDK) and Apache Ant. After you have installed all
these tools, you must specify the paths to them in \QC.
For detailed instructions, see \l{Qt for Android} and
\l{Connecting Android Devices}.
\section1 Creating the Project
\list 1
......
......@@ -57,7 +57,8 @@
\li \b {\l{Tutorials}}
Now you are ready to start developing your own applications.
Pick a tutorial to follow in \l{Tutorials}
Pick a tutorial to follow in \l{Tutorials}. To start developing
for Android devices, select \l{Creating an Android Application}.
\endtable
*/
......@@ -33,14 +33,21 @@
You can test that your \QSDK installation is successful by opening an existing
example application project.
To run an example application on an Android or iOS device, you must set up
the development environment for Android or iOS. For more information, see
\l{Connecting Android Devices} and \l{Connecting iOS Devices}.
\list 1
\li In the \gui Welcome mode, select \gui Examples (1).
\image qtcreator-gs-build-example-open.png "Selecting an example"
\li Select an example in the list of examples. You can also search for
examples (2).
\li Select an example in the list of examples.
You can also search for examples (2). Enter the \gui android or
\gui iOS keyword in the search field to list all the examples tested
for Android or iOS.
\note The project opens in the \gui Edit mode, and the documentation
for the example hides these instructions. To return to these
......@@ -67,7 +74,10 @@
If build errors occur, check that a \l{Adding Qt Versions}
{Qt version} and \l{Adding Compilers}{compiler} are installed and
configured and that the necessary kits are configured.
configured and that the necessary kits are configured. If you are
building for an \l{Connecting Android Devices}{Android device} or
\l{Connecting iOS Devices}{iOS device}, check that the development
environment has been set up correctly.
The \gui Build progress bar on the toolbar turns green when the
project is successfully built. The application opens on the device.
......
......@@ -32,7 +32,9 @@
\QC provides a cross-platform, complete integrated development environment
(IDE) for application developers to create applications for multiple desktop
and mobile device platforms. It is available for Linux, Mac OS X and Windows
and mobile device platforms, such as \l{Connecting Android Devices}{Android}
and \l{Connecting iOS Devices}{iOS}. It is available for Linux, Mac OS X and
Windows
operating systems. For more information, see \l{Supported Platforms}.
\table
......
......@@ -43,6 +43,8 @@ import HelperWidgets 2.0
ButtonRow {
enabled: anchorBackend.hasParent
opacity: enabled ? 1 : 0.5
id: buttonRow
ButtonRowButton {
......
......@@ -31,7 +31,7 @@ import QtQuick 2.1
import QtQuick.Controls 1.0 as Controls
import QtQuick.Layouts 1.0
Row {
RowLayout {
id: buttonRow
......@@ -40,6 +40,7 @@ Row {
property int initalChecked: 0
property int checkedIndex: -1
spacing: 0
onCheckedIndexChanged: {
__checkButton(checkedIndex)
......
......@@ -62,25 +62,28 @@ Item {
return index() === (parent.children.length - 1);
}
RoundedPanel {
roundLeft: isFirst() && buttonRowButton.roundLeftButton
roundRight: isLast()
Item {
anchors.fill: parent
visible: checked
RoundedPanel {
roundLeft: isFirst() && buttonRowButton.roundLeftButton
roundRight: isLast()
anchors.fill: parent
z: checked ? 1 : 0
gradient: Gradient {
GradientStop {color: '#444' ; position: 0}
GradientStop {color: '#333' ; position: 1}
gradient: Gradient {
GradientStop {color: '#444' ; position: 0}
GradientStop {color: '#333' ; position: 1}
}
}
}
RoundedPanel {
roundLeft: isFirst()
roundRight: isLast()
RoundedPanel {
roundLeft: isFirst()
roundRight: isLast()
anchors.fill: parent
visible: !checked
anchors.fill: parent
z: !checked ? 1 : 0
}
}
Image {
......
......@@ -71,7 +71,6 @@ Section {
SectionLayout {
columns: 2
rows: 3
Label {
text: qsTr("Font")
}
......@@ -104,18 +103,26 @@ Section {
sizeWidget.setPointPixelSize();
}
SpinBox {
minimumValue: 0
visible: !sizeWidget.pixelSize
maximumValue: 400
backendValue: pointSize
}
Item {
width: sizeSpinBox.width
height: sizeSpinBox.height
SpinBox {
id: sizeSpinBox
minimumValue: 0
//visible: !sizeWidget.pixelSize
z: !sizeWidget.pixelSize ? 1 : 0
maximumValue: 400
backendValue: pointSize
}
SpinBox {
minimumValue: 0
visible: sizeWidget.pixelSize
maximumValue: 400
backendValue: pixelSize
SpinBox {
minimumValue: 0
//visible: sizeWidget.pixelSize
z: sizeWidget.pixelSize ? 1 : 0
maximumValue: 400
backendValue: pixelSize
}
}
Controls.ComboBox {
......
......@@ -39,11 +39,12 @@ Section {
SectionLayout {
rows: 4
OriginControl {
backendValue: backendValues.transformOrigin
Label {
text: qsTr("Origin")
}
SecondColumnLayout {
OriginControl {
backendValue: backendValues.transformOrigin
}
Label {
......
......@@ -60,7 +60,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.topAnchored;
enabled: anchorBackend.topAnchored;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-top.png"
......@@ -116,7 +117,8 @@ Section {
}
RowLayout {
visible: anchorBackend.bottomAnchored;
enabled: anchorBackend.bottomAnchored;
opacity: enabled ? 1 : 0.5
anchors.left: parent.left
anchors.right: parent.right
......@@ -174,7 +176,8 @@ Section {
}
RowLayout {
visible: anchorBackend.leftAnchored;
enabled: anchorBackend.leftAnchored;
opacity: enabled ? 1 : 0.5
anchors.left: parent.left
anchors.right: parent.right
......@@ -234,7 +237,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.rightAnchored;
enabled: anchorBackend.rightAnchored;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-right.png"
......@@ -291,7 +295,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.horizontalCentered;
enabled: anchorBackend.horizontalCentered;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-horizontal.png"
......@@ -348,7 +353,8 @@ Section {
RowLayout {
anchors.left: parent.left
anchors.right: parent.right
visible: anchorBackend.verticalCentered;
enabled: anchorBackend.verticalCentered;
opacity: enabled ? 1 : 0.5
IconLabel {
source: "../HelperWidgets/images/anchor-vertical.png"
......
......@@ -111,10 +111,12 @@ void TypeDescriptionReader::readDocument(UiProgram *ast)
version = ComponentVersion(versionString.left(dotIdx).toInt(),
versionString.mid(dotIdx + 1).toInt());
}
if (version > ComponentVersion(1, 1)) {
addError(import->versionToken, tr("Expected version 1.1 or lower."));
if (version.majorVersion() != 1) {
addError(import->versionToken, tr("Major version different from 1 not supported."));
return;
}
if (version.minorVersion() > 1)
addWarning(import->versionToken, tr("Reading only version 1.1 parts."));
if (!ast->members || !ast->members->member || ast->members->next) {
addError(SourceLocation(), tr("Expected document to contain a single object definition."));
......
......@@ -2862,6 +2862,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
branches << tr("<Detached HEAD>");
QString headSha;
// split "82bfad2f51d34e98b18982211c82220b8db049b<tab>refs/heads/master"
bool headFound = false;
foreach (const QString &line, resp.stdOut.split(QLatin1Char('\n'))) {
if (line.endsWith(QLatin1String("\tHEAD"))) {
QTC_CHECK(headSha.isNull());
......@@ -2871,7 +2872,6 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
const QString pattern = QLatin1String("\trefs/heads/");
const int pos = line.lastIndexOf(pattern);
bool headFound = false;
if (pos != -1) {
const QString branchName = line.mid(pos + pattern.count());
if (!headFound && line.startsWith(headSha)) {
......
......@@ -269,6 +269,12 @@ bool selectionNotEmptyAndHasWidthOrHeightProperty(const SelectionContext &contex
&& selectionHasProperty1or2(context, widthProperty, heightProperty);
}
bool singleSelectionItemIsNotAnchoredAndSingleSelectionNotRoot(const SelectionContext &context)
{
return singleSelectionItemIsNotAnchored(context)
&& singleSelectionNotRoot(context);
}
bool selectionNotEmptyAndHasXorYProperty(const SelectionContext &context)
{
return selectionNotEmpty(context)
......@@ -335,7 +341,7 @@ void DesignerActionManager::createDefaultDesignerActions()
addDesignerAction(new MenuDesignerAction(anchorsCategoryDisplayName, anchorsCategory,
priorityAnchorsCategory, &singleSelectionAndInBaseState));
addDesignerAction(new ModelNodeAction
(anchorsFillDisplayName, anchorsCategory, 200, &anchorsFill, &singleSelectionItemIsNotAnchored));
(anchorsFillDisplayName, anchorsCategory, 200, &anchorsFill, &singleSelectionItemIsNotAnchoredAndSingleSelectionNotRoot));
addDesignerAction(new ModelNodeAction
(anchorsResetDisplayName, anchorsCategory, 180, &anchorsReset, &singleSelectionItemIsAnchored));
......
......@@ -374,17 +374,23 @@ void anchorsFill(const SelectionContext &selectionState)
if (!selectionState.view())
return;
RewriterTransaction transaction(selectionState.view(), QByteArrayLiteral("DesignerActionManager|anchorsFill"));
try {
RewriterTransaction transaction(selectionState.view(), QByteArrayLiteral("DesignerActionManager|anchorsFill"));
ModelNode modelNode = selectionState.currentSingleSelectedNode();
ModelNode modelNode = selectionState.currentSingleSelectedNode();
QmlItemNode node = modelNode;
if (node.isValid()) {
node.anchors().fill();
backupPropertyAndRemove(modelNode, "x");
backupPropertyAndRemove(modelNode, "y");
backupPropertyAndRemove(modelNode, "width");
backupPropertyAndRemove(modelNode, "height");
QmlItemNode node = modelNode;
if (node.isValid()) {
node.anchors().fill();
backupPropertyAndRemove(modelNode, "x");
backupPropertyAndRemove(modelNode, "y");
backupPropertyAndRemove(modelNode, "width");
backupPropertyAndRemove(modelNode, "height");
}
transaction.commit();
} catch (RewritingException &e) { //better save then sorry
QMessageBox::warning(0, "Error", e.description());
}
}
......
......@@ -171,12 +171,15 @@ void PluginDumper::onLoadPluginTypes(const QString &libraryPath, const QString &
// add default qmltypes file if it exists
const QLatin1String defaultQmltypesFileName("plugins.qmltypes");
const QString defaultQmltypesPath = makeAbsolute(defaultQmltypesFileName, canonicalLibraryPath);
if (QFile::exists(defaultQmltypesPath))
if (!plugin.typeInfoPaths.contains(defaultQmltypesPath) && QFile::exists(defaultQmltypesPath))
plugin.typeInfoPaths += defaultQmltypesPath;
// add typeinfo files listed in qmldir
foreach (const QmlDirParser::TypeInfo &typeInfo, libraryInfo.typeInfos())
plugin.typeInfoPaths += makeAbsolute(typeInfo.fileName, canonicalLibraryPath);
foreach (const QmlDirParser::TypeInfo &typeInfo, libraryInfo.typeInfos()) {
QString pathNow = makeAbsolute(typeInfo.fileName, canonicalLibraryPath);
if (!plugin.typeInfoPaths.contains(pathNow) && QFile::exists(pathNow))
plugin.typeInfoPaths += pathNow;
}
// watch plugin libraries
foreach (const QmlDirParser::Plugin &plugin, snapshot.libraryInfo(canonicalLibraryPath).plugins()) {
......
......@@ -414,6 +414,7 @@ void ValgrindGlobalSettings::readSettings()
defaults.insert(QLatin1String(callgrindCostFormatC), CostDelegate::FormatRelative);
defaults.insert(QLatin1String(callgrindCycleDetectionC), true);
defaults.insert(QLatin1String(callgrindShortenTemplates), true);
// Read stored values
QSettings *settings = Core::ICore::settings();
......
......@@ -1531,7 +1531,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive))
mode = QIODevice::Append;
}
return writeFile(QString(), resolvePath(args.at(0).toQString(m_tmp1)), mode, contents);
QString path = resolvePath(args.at(0).toQString(m_tmp1));
path.detach(); // make sure to not leak m_tmp1 into the map of written files.
return writeFile(QString(), path, mode, contents);
}
case T_TOUCH: {
if (args.count() != 2) {
......
......@@ -1090,28 +1090,7 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
}
no_cache:
// Look for mkspecs/ in source and build. First to win determines the root.
QString sdir = inDir;
QString dir = m_outputDir;
while (dir != m_buildRoot) {
if ((dir != sdir && QFileInfo(sdir, QLatin1String("mkspecs")).isDir())
|| QFileInfo(dir, QLatin1String("mkspecs")).isDir()) {
if (dir != sdir)
m_sourceRoot = sdir;
m_buildRoot = dir;
break;
}
if (dir == superdir)
break;
QFileInfo qsdfi(sdir);
QFileInfo qdfi(dir);
if (qsdfi.isRoot() || qdfi.isRoot())
break;
sdir = qsdfi.path();
dir = qdfi.path();
}
dir = m_outputDir;
forever {
QString stashfile = dir + QLatin1String("/.qmake.stash");
if (dir == (!superdir.isEmpty() ? superdir : m_buildRoot) || m_vfs->exists(stashfile)) {
......
......@@ -150,6 +150,9 @@
:Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_DiffEditor::DiffViewEditorWidget {type='DiffEditor::DiffViewEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_DiffEditor::DiffViewEditorWidget2 {occurrence='2' type='DiffEditor::DiffViewEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_DiffEditor::Internal::DiffShowEditorWidget {type='DiffEditor::Internal::DiffShowEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Find::Internal::SearchResultTreeView {type='Find::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditor' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
......
......@@ -30,12 +30,6 @@
import __builtin__
import re
processExited = False
def __handleProcessExited__(*args):
global processExited
processExited = True
def openQmakeProject(projectPath, targets=Targets.desktopTargetClasses(), fromWelcome=False):
cleanUpUserFiles(projectPath)
if fromWelcome:
......@@ -383,7 +377,7 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None):