Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4.9'
Browse files Browse the repository at this point in the history
Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
  • Loading branch information
e4z9 committed Mar 21, 2019
2 parents aa69f1a + 1656402 commit b3baed5
Show file tree
Hide file tree
Showing 47 changed files with 2,847 additions and 1,299 deletions.
1 change: 1 addition & 0 deletions dist/changes-4.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ General
* Added option to run external tools in build or run environment of
active project (QTCREATORBUG-18394, QTCREATORBUG-19892)
* Improved selection colors in dark themes (QTCREATORBUG-18888)
* Added -temporarycleansettings (alias -tcs) command line option

Editing

Expand Down
Binary file modified doc/images/qtcreator-clang-format-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/qtcreator-code-style-clang-format.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 38 additions & 15 deletions doc/src/editors/creator-clangformat.qdocinc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
Expand All @@ -26,29 +26,56 @@
/*!
//! [clang format]

\section2 Automatic Indentation
\section2 Automatic Formatting and Indentation

The experimental Clang Format plugin uses the
\l{https://clang.llvm.org/docs/LibFormat.html}{LibFormat}
library for automatic indentation.
library for automatic formatting and indentation.

To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {C++} > \uicontrol {ClangFormat}. Then restart \QC to load the
plugin.

To specify global settings for Clang Format:
\note If you enable the plugin, do not use the \l{Beautifying Source Code}
{Beautifier}, because combining the two can provide unexpected results.

You can use Clang Format to enforce a coding style for a project or the
whole organization. Create a \c {.clang-format} file that contains the
\l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
{Clang Format Style Options} to use and save it in the root folder of the
project or one of its parent folders. The plugin searches for the Clang
format file recursively from the directory that contains the source file
up to the file system root.

To specify settings for automatic formatting and indentation:

\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++} >
\uicontrol {Clang Format}.
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++}.
\image qtcreator-clang-format-options.png "C++ Clang Format options"
\li Double-click a value to modify it.
\li Select the \uicontrol {Format instead of indenting} check box to
use the \key {Ctrl+I} keyboard shortcut to format code instead of
indenting it.
\li Select the \uicontrol {Format while typing} check box to apply the
formatting while you type code.
\li Select the \uicontrol {Format edited code on file save} check box
to apply the formatting to the edited code when you save the file.
\li Select the \uicontrol {Override Clang Format configuration file}
check box to create a local configuration file that overrides the
one stored in the file system.
\note This is not recommended, because it defeats the purpose of
a Clang format file.
\li To modify the values in the file, select them in the left-side
column and enter the new values.
\li To view examples of the new values in the right-hand column, select
\uicontrol Apply.
\endlist

You can also specify formatting separately for each project.
Create a \c {.clang-format} file that contains the
\l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
{Clang Format Style Options} to use and save it in the project directory.
To override the \c {.clang-format} file for a project, select
\uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol {Code Style} >
\uicontrol {Override Clang Format configuration file}.

\image qtcreator-code-style-clang-format.png

You can create \c {.clang-format} files that contain the configuration
options of a certain predefined style from the command line. For example,
Expand All @@ -58,9 +85,5 @@
clang-format -style=llvm -dump-config > .clang-format
\endcode

To view the \c {.clang-format} file for a project, select
\uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol {Clang Format}.

//! [clang format]
*/
8 changes: 5 additions & 3 deletions doc/src/editors/creator-code-refactoring.qdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
Expand Down Expand Up @@ -49,7 +49,8 @@

To find instances of a specific symbol in your Qt C++ project, place the
cursor on the symbol in the editor and select \uicontrol Tools >
\uicontrol {C++} > \uicontrol {Find Usages} or press \key {Ctrl+Shift+U}.
\uicontrol {C++} > \uicontrol {Find References to Symbol Under Cursor} or
press \key {Ctrl+Shift+U}.

\note You can also select \uicontrol Edit > \uicontrol {Find/Replace} >
\uicontrol {Advanced Find} > \uicontrol {C++ Symbols} to search for
Expand All @@ -63,7 +64,8 @@

To find instances of a specific QML type in a project, place the cursor on
the type and select \uicontrol Tools > \uicontrol {QML/JS} >
\uicontrol {Find Usages} or press \key {Ctrl+Shift+U}.
\uicontrol {Find References to Symbol Under Cursor} or press
\key {Ctrl+Shift+U}.

\section1 Viewing Search Results

Expand Down
28 changes: 21 additions & 7 deletions doc/src/editors/creator-coding-edit-mode.qdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
Expand Down Expand Up @@ -192,16 +192,25 @@
\uicontrol Options > \uicontrol {Text Editor} > \uicontrol Behavior >
\uicontrol {Enable mouse navigation}.

You can also select the symbol and press \key F2, or right-click the symbol
There are several additional ways of moving between symbol definitions and
declarations. All the functions described below are also available from the
\uicontrol Tools > \uicontrol C++ menu. The functions supported for QML and
JavaScript code are available from the \uicontrol Tools > \uicontrol QML/JS
menu.

You can select the symbol and press \key F2, or right-click the symbol
and select \uicontrol {Follow Symbol Under Cursor} to move to its definition
or declaration. This feature is supported for namespaces, classes,
functions, variables, include statements, and macros.
or declaration. To follow the symbol in the next split, select
\uicontrol {Follow Symbol Under Cursor in Next Split}. Following symbols is
supported for namespaces, classes, functions, variables, include statements,
and macros.

To switch between the definition and declaration of a function, place the
cursor on either and press \key {Shift+F2} or right-click and select
\uicontrol {Switch Between Function Declaration/Definition}. For example,
this allows you to navigate from anywhere within a function body directly to
the function declaration.
\uicontrol {Switch Between Function Declaration/Definition} or
\uicontrol {Open Function Declaration/Definition in Next Split}.
For example, this allows you to navigate from anywhere within a function
body directly to the function declaration.

Links are opened in the same split by default. To open links in the next
split, prepend \key {Ctrl+E} to the shortcut. For example, press
Expand All @@ -214,6 +223,11 @@
another split. If you change the default behavior, the shortcuts for opening
link targets in the next split are used to open them in the current split.

To switch between C++ header and source files, right-click anywhere in a
file and select \uicontrol {Switch Header/Source} or
\uicontrol {Open Corresponding Header/Source in Next Split}. You can also
press \key F4 or \key {Ctrl+E,F4}, respectively.

\section1 Reparsing Externally Changed Files

If source files are modified from outside \QC, the opened files will be
Expand Down
4 changes: 2 additions & 2 deletions doc/src/howto/creator-keyboard-shortcuts.qdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
Expand Down Expand Up @@ -427,7 +427,7 @@
\li Alt+C, Alt+P
\endif
\row
\li Find usages
\li Find references to symbol under cursor
\li Ctrl+Shift+U
\row
\li Follow symbol under cursor
Expand Down
9 changes: 9 additions & 0 deletions doc/src/howto/creator-only/creator-cli.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@
\li Override the default path from where user-independent settings are read
(for example written by the installer).

\row
\li -temporarycleansettings
\li Use clean settings for debug or testing reasons. The settings
will be deleted when \QC exits.

\row
\li -color <color>
\li Core plugin: override the selected UI color.
Expand All @@ -165,6 +170,10 @@
\li Core plugin: apply a dark color theme to \QC, without using
stylesheets.

\row
\li -notour
\li Welcome plugin: Skip the UI tour on startup.

\row
\li -debug <pid>
\li Debugger plugin: attach to the process with the given process
Expand Down
5 changes: 5 additions & 0 deletions doc/src/howto/creator-only/creator-ui.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@

\image qtcreator-application-output.png

If you specify command line arguments in the run settings that are passed
to the application when running it, they are displayed as a part of the
application output. For more information, see
\l{Specifying Run Settings for Desktop Device Types}.

Select toolbar buttons to run applications, to attach the debugger to the
running application, and to stop running or debugging.

Expand Down
6 changes: 3 additions & 3 deletions doc/src/howto/creator-only/qtcreator-faq.qdoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
Expand Down Expand Up @@ -327,8 +327,8 @@

Typically, users also work on multiple classes or functions that are
related, even though they are defined or declared in different files.
\QC provides two shortcuts for that: \key F2 to follow the symbol
and \key Ctrl+Shift+U to find usages.
\QC provides two shortcuts for that: \key F2 to follow the symbol under
cursor and \key Ctrl+Shift+U to find references to it.

In addition, developers can:

Expand Down
6 changes: 6 additions & 0 deletions doc/src/howto/creator-sidebar-views.qdocinc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@
\li Add and remove subprojects.
\endif
\li Search from the selected directory.
\li Expand or collapse the tree view to show or hide all files and
folders.
\li Close all files in a project.
\li Close projects.
\endlist

Expand Down Expand Up @@ -312,5 +315,8 @@
the current file, right-click in the editor and select
\uicontrol {Open Include Hierarchy} or press \key {Ctrl+Shift+I}.

To keep the view synchronized with the file currently opened in the editor,
select \uicontrol {Synchronize with Editor}.

//! [include hierarchy view]
*/
12 changes: 12 additions & 0 deletions doc/src/projects/creator-only/creator-projects-generic.qdoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@

\li .creator

\li \l{Forwarding Flags to Clang Code Model}{.cflags}

\li \l{Forwarding Flags to Clang Code Model}{.cxxflags}

\endlist

\endlist
Expand Down Expand Up @@ -126,6 +130,14 @@
#define NAME value
\endcode

\section1 Forwarding Flags to Clang Code Model

The \c {.cxxflags} and \c {.cflags} files contain command line flags for the
Clang code model, one flag per line.

For example, specify the \c {-std=c++11} to set the language version
for parsing as C++11.

\section1 Providing Deployment Information

If you want to run your application on an embedded Linux device, you first need to
Expand Down
3 changes: 2 additions & 1 deletion share/qtcreator/debugger/gdbbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def __call__(self, d, value):
d.putType(value.nativeValue.type.name)
val = printer.to_string()
if isinstance(val, str):
d.putValue(val)
# encode and avoid extra quotes ('"') at beginning and end
d.putValue(d.hexencode(val), 'utf8:1:0')
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
d.putValue(val)
else: # Assuming LazyString
Expand Down
51 changes: 51 additions & 0 deletions share/qtcreator/qml/qmlpuppet/mockfiles/Dialog.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/

import QtQuick 2.1

Rectangle {
property string title

property var clickedButton

property var modality
property var standardButtons

property alias contentItem: contentArea

property int maximumWidth: 0
property int minimumWidth: 0

property int maximumHeight: 0
property int minimumHeight: 0

Item {
id: contentArea
anchors.top: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.top
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
|| typeName == "QtQuick.Controls/Drawer"
|| typeName == "QtQuick.Controls/Dialog"
|| typeName == "QtQuick.Controls/Menu"
|| typeName == "QtQuick.Controls/Pane"
|| typeName == "QtQuick.Controls/ToolTip")
polishTypeName = "QtQuick/Item";

const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"}};
const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"},
{"QtQuick.Dialogs/Dialog","qrc:/qtquickplugin/mockfiles/Dialog.qml"}};

QObject *object = nullptr;

Expand Down
1 change: 1 addition & 0 deletions share/qtcreator/qml/qmlpuppet/qmlpuppet.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<file>mockfiles/Window.qml</file>
<file>mockfiles/SwipeView.qml</file>
<file>mockfiles/GenericBackend.qml</file>
<file>mockfiles/Dialog.qml</file>
</qresource>
</RCC>
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,17 @@ Rectangle {
__panel.visible = false
}

property string oldValue

onEditingFinished: {
if (text != delegateStateName)
statesEditorModel.renameState(internalNodeId, text)
}
if (stateNameField.oldValue === stateNameField.text)
return

stateNameField.oldValue = stateNameField.text

if (stateNameField.text != delegateStateName)
statesEditorModel.renameState(internalNodeId, stateNameField.text)
}
}

Item {
Expand Down
Loading

0 comments on commit b3baed5

Please sign in to comment.