\n"
diff --git a/doc/qtcreator/config/qtcreator-project.qdocconf b/doc/qtcreator/config/qtcreator-project.qdocconf
index cff09e5c3bc..479d17ed8b2 100644
--- a/doc/qtcreator/config/qtcreator-project.qdocconf
+++ b/doc/qtcreator/config/qtcreator-project.qdocconf
@@ -43,8 +43,7 @@ imagedirs = ../images \
exampledirs = ../examples
examples.fileextensions += *.qml *.svg
-HTML.extraimages = ../../config/images/commercial.png
-qhp.QtCreator.extraFiles = ../../config/images/commercial.png
+include(../../qtcreator/images/extraimages/qtcreator-extraimages.qdocconf)
depends += qtandroidextras\
qtwidgets \
diff --git a/doc/qtdesignstudio/images/videoicons/9ihYeC0YJ0M.jpg b/doc/qtcreator/images/extraimages/images/9ihYeC0YJ0M.jpg
similarity index 100%
rename from doc/qtdesignstudio/images/videoicons/9ihYeC0YJ0M.jpg
rename to doc/qtcreator/images/extraimages/images/9ihYeC0YJ0M.jpg
diff --git a/doc/qtcreator/images/extraimages/images/RfEYO-5Mw6s.jpg b/doc/qtcreator/images/extraimages/images/RfEYO-5Mw6s.jpg
new file mode 100644
index 00000000000..fecd5b70efe
Binary files /dev/null and b/doc/qtcreator/images/extraimages/images/RfEYO-5Mw6s.jpg differ
diff --git a/doc/qtdesignstudio/images/videoicons/SsFWyUeAA_4.jpg b/doc/qtcreator/images/extraimages/images/SsFWyUeAA_4.jpg
similarity index 100%
rename from doc/qtdesignstudio/images/videoicons/SsFWyUeAA_4.jpg
rename to doc/qtcreator/images/extraimages/images/SsFWyUeAA_4.jpg
diff --git a/doc/qtdesignstudio/images/videoicons/ZzbucmQPU44.jpg b/doc/qtcreator/images/extraimages/images/ZzbucmQPU44.jpg
similarity index 100%
rename from doc/qtdesignstudio/images/videoicons/ZzbucmQPU44.jpg
rename to doc/qtcreator/images/extraimages/images/ZzbucmQPU44.jpg
diff --git a/doc/qtdesignstudio/images/videoicons/aV6kFxH3Xws.jpg b/doc/qtcreator/images/extraimages/images/aV6kFxH3Xws.jpg
similarity index 100%
rename from doc/qtdesignstudio/images/videoicons/aV6kFxH3Xws.jpg
rename to doc/qtcreator/images/extraimages/images/aV6kFxH3Xws.jpg
diff --git a/doc/config/images/commercial.png b/doc/qtcreator/images/extraimages/images/commercial.png
similarity index 100%
rename from doc/config/images/commercial.png
rename to doc/qtcreator/images/extraimages/images/commercial.png
diff --git a/doc/qtcreator/images/extraimages/images/yOUdg1o2KJM.jpg b/doc/qtcreator/images/extraimages/images/yOUdg1o2KJM.jpg
new file mode 100644
index 00000000000..684ebd58e9d
Binary files /dev/null and b/doc/qtcreator/images/extraimages/images/yOUdg1o2KJM.jpg differ
diff --git a/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf b/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf
new file mode 100644
index 00000000000..91688081176
--- /dev/null
+++ b/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf
@@ -0,0 +1,4 @@
+{HTML.extraimages,qhp.QtCreator.extraFiles} += \
+ images/commercial.png \
+ images/RfEYO-5Mw6s.jpg \
+ images/yOUdg1o2KJM.jpg
diff --git a/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf b/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf
new file mode 100644
index 00000000000..6578308433a
--- /dev/null
+++ b/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf
@@ -0,0 +1,8 @@
+{HTML.extraimages,qhp.qtdesignstudio.extraFiles} += \
+ images/commercial.png \
+ images/SsFWyUeAA_4.jpg \
+ images/9ihYeC0YJ0M.jpg \
+ images/aV6kFxH3Xws.jpg \
+ images/ZzbucmQPU44.jpg \
+ images/RfEYO-5Mw6s.jpg \
+ images/yOUdg1o2KJM.jpg
diff --git a/doc/qtcreator/images/icons/textarea-icon16.png b/doc/qtcreator/images/icons/textarea-icon16.png
new file mode 100644
index 00000000000..4afc1fbab56
Binary files /dev/null and b/doc/qtcreator/images/icons/textarea-icon16.png differ
diff --git a/doc/qtcreator/images/icons/textfield-icon16.png b/doc/qtcreator/images/icons/textfield-icon16.png
new file mode 100644
index 00000000000..c4a62a6582b
Binary files /dev/null and b/doc/qtcreator/images/icons/textfield-icon16.png differ
diff --git a/doc/qtcreator/images/qmldesigner-breadcrumbs.png b/doc/qtcreator/images/qmldesigner-breadcrumbs.png
index a3dc4710867..57c02771445 100644
Binary files a/doc/qtcreator/images/qmldesigner-breadcrumbs.png and b/doc/qtcreator/images/qmldesigner-breadcrumbs.png differ
diff --git a/doc/qtcreator/images/qmldesigner-custom-component-properties.png b/doc/qtcreator/images/qmldesigner-custom-component-properties.png
new file mode 100644
index 00000000000..b935f941325
Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-custom-component-properties.png differ
diff --git a/doc/qtcreator/images/qtquick-designer-text-input-properties.png b/doc/qtcreator/images/qtquick-designer-text-input-properties.png
new file mode 100644
index 00000000000..ab88caacef5
Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-text-input-properties.png differ
diff --git a/doc/qtcreator/images/qtquick-designer-text-properties.png b/doc/qtcreator/images/qtquick-designer-text-properties.png
new file mode 100644
index 00000000000..7d348aa266c
Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-text-properties.png differ
diff --git a/doc/qtcreator/qtcreator-online.qdocconf b/doc/qtcreator/qtcreator-online.qdocconf
index 2a0ace23128..b96e6e53979 100644
--- a/doc/qtcreator/qtcreator-online.qdocconf
+++ b/doc/qtcreator/qtcreator-online.qdocconf
@@ -16,5 +16,8 @@ HTML.footer = \
include($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf)
+# Override macros for online use
+include(../config/macros-online.qdocconf)
+
# Add an .html file with sidebar content, used in the online style
HTML.stylesheets += config/style/qt5-sidebar.html
diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc
index 5dd5e5c76ff..6e813743efa 100644
--- a/doc/qtcreator/src/qtcreator-toc.qdoc
+++ b/doc/qtcreator/src/qtcreator-toc.qdoc
@@ -98,6 +98,7 @@
\list
\li \l{Editing 2D Content}
\li \l{Shapes}
+ \li \l{Text}
\li \l{Images}
\li \l{User Interaction Methods}
\li \l{Lists and Other Data Models}
diff --git a/doc/qtcreator/src/qtquick/library/qtquick-shapes.qdoc b/doc/qtcreator/src/qtquick/library/qtquick-shapes.qdoc
index 1bf9458a03a..bce7dce955d 100644
--- a/doc/qtcreator/src/qtquick/library/qtquick-shapes.qdoc
+++ b/doc/qtcreator/src/qtquick/library/qtquick-shapes.qdoc
@@ -26,7 +26,7 @@
/*!
\page quick-shapes.html
\previouspage qtquick-form-editor.html
- \nextpage quick-buttons.html
+ \nextpage quick-text.html
\title Shapes
diff --git a/doc/qtcreator/src/qtquick/library/qtquick-text.qdoc b/doc/qtcreator/src/qtquick/library/qtquick-text.qdoc
new file mode 100644
index 00000000000..4c7ca9492e3
--- /dev/null
+++ b/doc/qtcreator/src/qtquick/library/qtquick-text.qdoc
@@ -0,0 +1,303 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Creator documentation.
+**
+** 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 Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+**
+****************************************************************************/
+
+/*!
+ \page quick-text.html
+ \previouspage quick-shapes.html
+ \nextpage quick-images.html
+
+ \title Text
+
+ You can use several different text types to add read-only or editable text
+ to a UI, such as titles or labels and text input fields with placeholder
+ text. The \l Text type adds formatted text, the \l TextEdit type adds a
+ multiline line edit, and the \l TextInput type adds a single editable line
+ field.
+
+ You can select the font to use and specify extensive properties for each
+ text string, such as size in points or pixels, style name, emphasis,
+ alignment, and spacing.
+
+ For an example of editing the Text type, watch
+ \l{https://www.youtube.com/watch?v=yOUdg1o2KJM}
+ {Qt Design Studio QuickTip: Text Element}.
+
+ To create a label with a background, use the \l Label type from the
+ Qt Quick Controls module.
+
+ \section1 Typography
+
+ For each string that you enter in the \uicontrol Text field, you can
+ select the font to use in the \uicontrol Font field and specify the
+ size, emphasis, aligment, and spacing of the text. Specify the font
+ size in either points or pixels in the \uicontrol Size field.
+
+ \image qtquick-designer-text-properties.png "Text type properties"
+
+ To display custom fonts in the list of available fonts in the
+ \uicontrol Font field, add them in the \uicontrol Assets tab
+ of \uicontrol Library. For more information, see \l {Assets}.
+
+ You can use the buttons in the \uicontrol {Font style} group to emphasize
+ text by making it bold, italic, underlined, or strikethrough.
+
+ Alternatively, select a font variant to use in the \uicontrol {Style name}
+ field, such as \uicontrol Regular or \uicontrol Bold.
+
+ The value of the \uicontrol Word field in the \uicontrol Spacing group
+ changes the default spacing between individual words, whereas the value
+ of the \uicontrol Letter field changes the spacing between individual
+ letters in a word. A positive value increases the spacing by a
+ corresponding amount of pixels, while a negative value decreases it.
+
+ The value of the \uicontrol {Line height} field sets the line height
+ for the text. In the \uicontrol {Line height mode} field, select
+ \uicontrol FixedHeight to set the line height in pixels or
+ \uicontrol ProportionalHeight (default) to set the spacing proportionally
+ to the line (as a multiplier). For example, set to 2 for double spacing.
+
+ \section1 Text Alignment
+
+ You can align text items horizontally and vertically. By default, text is
+ vertically aligned to the top. Horizontal alignment follows the natural
+ alignment of the text. By default, left-to-right text like English is
+ aligned to the left side of the text area, whereas right-to-left text
+ like Arabic is aligned to the right side of the text area.
+
+ You can align text to the left, right, top, or bottom, and center it
+ horizontally or vertically. You can justify horizontal text.
+
+ For a single line of text, the size of the text is the area of the text.
+ In this common case, all alignments are equivalent. To center a text in
+ its parent, use \l{Setting Anchors and Margins}{anchoring} or bind the
+ width of the text item to that of the parent. For more information, see
+ \l{Setting Bindings}.
+
+ \section1 Text and Style Colors
+
+ You can set the color of the text itself and a secondary color used by
+ text styles.
+
+ The color that you pick in the \uicontrol {Style color} field is used as
+ the outline color for outlined text, and as the shadow color for raised
+ or sunken text. You set the font style in the \uicontrol Style field of
+ the \uicontrol Font section.
+
+ For the \uicontrol {Text Edit} and \uicontrol {Text Input} types, you
+ can also set the color of selected text and the text highlight color
+ that is used behind selections in the \uicontrol {Selected text color}
+ and \uicontrol {Selection color} fields.
+
+ For more information about selecting colors, see \l{Picking Colors}. You
+ can only set solid colors for text items.
+
+ \section1 Advanced Text Properties
+
+ The height and width of a text item are determined automatically depending
+ on the values of the properties you set, to accommodate the length of the
+ string that you specify in the \uicontrol Text field and the font size, for
+ example.
+
+ The value of the \uicontrol {Font size mode} field specifies how the font
+ size of the displayed text is determined. Select \uicontrol FixedSize to
+ use the size specified in the \uicontrol Size field in pixels or points.
+ Select \uicontrol HorizontalFit or \uicontrol VerticalFit to use the largest
+ size up to the size specified that fits the width or height of the item.
+ Select \uicontrol Fit to use the largest size up to the size specified that
+ fits within the width and height of the item. The font size of fitted text
+ has a minimum bound specified by the \uicontrol {Minimum size} field and
+ maximum bound specified by the \uicontrol Size field.
+
+ In the \uicontrol {Wrap mode} field, you can wrap the text to the text
+ item's width. The text will only wrap if you set an explicit width for
+ the text item. By default, text is not wrapped. Select \uicontrol WordWrap
+ to restrict wrapping to word boundaries only. Select \uicontrol WrapAnywhere
+ to enable wrapping at any point on a line, even if it occurs in the middle
+ of a word. Select \uicontrol Wrap to wrap at a word boundary, if possible,
+ or at the appropriate point on the line, even in the middle of a word.
+
+ You can use the \uicontrol Elide property with the \uicontrol Wrap
+ option to fit a single line of plain text to a set width. Select
+ \uicontrol ElideRight, and set the \uicontrol {Maximum line count}
+ or the text item height (in the \uicontrol H field). If you set both,
+ the maximum line count will apply unless the lines do not fit in the
+ height allowed.
+
+ If the text is a multi-length string, and you set the \uicontrol Elide
+ property value to something else than \uicontrol ElideNone, the first
+ string that fits will be used, otherwise the last will be elided.
+
+ Multi-length strings are ordered from longest to shortest, separated by the
+ Unicode \e {String Terminator} character \c U009C.
+
+ \section1 Advanced Font Properties
+
+ In the \uicontrol {Font weight} field, you can select the font weight from
+ list predefined values that range between extra-light and extra-bold.
+
+ In the \uicontrol {Font capitalization} field, select \uicontrol MixedCase
+ for normal text rendering where no capitalization changes are applied. You
+ can also set the text in all upper or lower case, or use small caps. The
+ \uicontrol Capitalize option renders the first character of each word as an
+ uppercase character.
+
+ \section1 Developer Text Properties
+
+ Text can be either in plain text or rich text format, depending on the
+ value you set in the \uicontrol Format field. If you select
+ \uicontrol AutoText and the the first line of text contains an HTML tag,
+ the text is treated as rich text. Rich text supports a subset of HTML 4
+ described on the \l {Supported HTML Subset}. Note that plain text offers
+ better performance than rich text.
+
+ In the \uicontrol {Render type} field, you can override the default
+ rendering type for a text item. Select \uicontrol NativeRendering if
+ you prefer text to look native on the target platform and do not
+ require advanced features such as \l {Managing 2D Transformations}
+ {transformation} of the text. Using rotation or scaling in combination
+ with native rendering leads to poor and sometimes pixelated results.
+
+ \section1 Text Input
+
+ You can use the \uicontrol {Text Edit} and \uicontrol {Text Input} types to
+ add text fields where users can enter text.
+
+ The Text Input type displays a single line of editable plain text, whereas
+ the Text Edit type displays a block of editable, formatted text. Both types
+ are used to accept text input.
+
+ \image qtquick-designer-text-input-properties.png "Text input field properties"
+
+ In the \uicontrol {Mouse selection mode} field, you can specify whether
+ individual characters or whole words are selected when selecting text.
+
+ In the \uicontrol {Input mask} field, you can create an input mask that
+ contains mask and meta characters and separators between them. When created
+ or cleared, the text edit or input is filled with a copy of the input mask
+ string, where the meta characters have been removed, and the mask characters
+ have been replaced with the blank character. For example, in an input field
+ for an IP address, you could use the following mask (with the underscore as
+ the blank character): \c {000.000.000.000;_}. For more information about
+ creating input masks, see the documentation for \l QLineEdit::inputMask.
+
+ In the \uicontrol {Echo mode} field, select \uicontrol Password to display
+ platform-dependent password mask characters instead of the actual characters
+ that users enter. Select \uicontrol PasswordEchoOnEdit to display characters
+ as users enter them. The mask character is displayed in the
+ \uicontrol {Pass. char} field.
+
+ In the \uicontrol {Maximum length} field, set the maximum number of
+ characters that users can enter.
+
+ The value of the \uicontrol {Auto scroll} check box determines whether the
+ text edit or input should scroll when the text is longer than the width of
+ the input field.
+
+ If the \uicontrol {Overwrite mode} check box is selected, existing text is
+ overwritten, character-for-character by new text. Otherwise, new text is
+ inserted at the cursor position, displacing existing text. By default, new
+ text does not overwrite existing text.
+
+ To prevent users from changing the text, select the \uicontrol {Read only}
+ check box.
+
+ The value of the \uicontrol {Set active focus on press} check box determines
+ whether the text edit or input should gain active focus on a mouse press.
+
+ By default, the cursor becomes visible when the text edit or input gains
+ active focus, so that other properties can be bound to whether the cursor
+ is currently shown. Because the value of the \uicontrol {Cursor visible}
+ property gets set and unset automatically, any value you set yourself may
+ be overwritten.
+
+ If the \uicontrol {Persistent selection} check box is selected, a text edit
+ or input keeps its selection when active focus moves to another item.
+
+ To use a pointer device for selecting text, select the
+ \uicontrol {Select by mouse} check box.
+
+ \section1 Padding
+
+ The values of the properties in the \uicontrol Padding section specify the
+ padding around the content. The individual padding properties adopt the
+ value of the \uicontrol Padding field, unless you set them explicitly.
+
+ \note If you explicitly set the width or height of a text edit or input,
+ ensure that it is large enough to accommodate the padding values. If the
+ text does not have enough vertical or horizontal space in which to be
+ rendered, it will appear clipped.
+
+ \section1 Summary of Text Components
+
+ The following table lists the QML types that you can use to add text to
+ UIs. The \e Location column contains the tab name where you can find the
+ type in \uicontrol Library. The \e MCU column indicates which types are
+ supported on MCUs.
+
+ \table
+ \header
+ \li Icon
+ \li Name
+ \li Location
+ \li MCU
+ \li Purpose
+ \row
+ \li \inlineimage icons/label-icon16.png
+ \li \l [QtQuickControls]{Label}
+ \li Qt Quick - Controls 2
+ \li
+ \li A text label with inherited styling and font.
+ \row
+ \li \inlineimage text-icon16.png
+ \li \l [QtQuick]{Text}
+ \li Qt Quick - Basic
+ \li \inlineimage ok
+ \li Formatted read-only text.
+ \row
+ \li \inlineimage icons/textarea-icon16.png
+ \li \l [QtQuickControls]{TextArea}{Text Area}
+ \li Qt Quick - Controls 2
+ \li
+ \li Multiple lines of editable formatted text.
+ \row
+ \li \inlineimage text-edit-icon16.png
+ \li \l [QtQuick]{TextEdit}{Text Edit}
+ \li Qt Quick - Basic
+ \li
+ \li A single line of editable formatted text that can be validated.
+ \row
+ \li \inlineimage icons/textfield-icon16.png
+ \li \l [QtQuickControls]{TextField}{Text Field}
+ \li Qt Quick - Controls 2
+ \li
+ \li A single line of editable plain text.
+ \row
+ \li \inlineimage text-input-icon16.png
+ \li \l [QtQuick]{TextInput}{Text Input}
+ \li Qt Quick - Basic
+ \li
+ \li A single line of editable plain text that can be validated.
+ \endtable
+*/
diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc
index 82a90f702e0..e54e3ca020e 100644
--- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc
@@ -119,37 +119,12 @@
\list
\li \l Shapes
+ \li \l Text
\li \l Images
\li \l {User Interaction Methods}
\li \l {Lists and Other Data Models}
\endlist
- \section2 Basic QML Types
-
- You can use the following QML types to create components:
-
- \list
- \li \l [QtQuick]{AnimatedImage}{Animated Image} provides a way to play
- animations stored as images containing a series of frames, such
- as those stored in GIF files.
- \li \l [QtQuick]{BorderImage}{Border Image} uses an image as a border or
- background.
- \li \l [QtQuick]{Image} adds a bitmap to the scene. You can stretch and
- tile images.
- \li \l [QtQuick]{Item} is the most basic of all visual types in QML. Even
- though it has no visual appearance, it defines all the properties
- that are common across visual types, such as the x and y position,
- width and height, anchoring, and key handling.
- \li \l [QtQuick] {Rectangle} adds a rectangle that is painted with a solid
- fill color and an optional border. You can use the radius property
- to create rounded rectangles.
- \li \l [QtQuick]{Text} adds formatted read-only text.
- \li \l [QtQuick]{TextEdit}{Text Edit} adds a single line of editable
- formatted text that can be validated.
- \li \l [QtQuick]{TextInput}{Text Input} adds a single line of editable
- plain text that can be validated.
- \endlist
-
\include qtquick-animation-types.qdocinc qtquick animation types
\if defined(qtdesignstudio)
@@ -203,6 +178,14 @@
\section1 Creating Components in Design Mode
+ You can either use project wizard templates to create custom components and
+ controls or \l{Moving Components into Separate Files}{move subcomponents
+ into separate files} to make them reusable in other components.
+
+ \section2 Creating Components from Scratch
+
+ To use wizard templates to create custom components:
+
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
@@ -224,7 +207,12 @@
\li Edit its properties in \uicontrol Properties.
- The available properties depend on the QML type.
+ \image qmldesigner-custom-component-properties.png
+
+ The available properties depend on the QML type. You can
+ \l{Specifying Dynamic Properties}{add properties for
+ components} in the \uicontrol Properties tab of the
+ \uicontrol {Connection View}.
\endlist
@@ -246,7 +234,7 @@
\include qtdesignstudio-components.qdocinc creating studio components
\endif
- \section1 Moving Components into Separate Files
+ \section2 Moving Components into Separate Files
An alternative way of creating reusable components is to move them into
separate QML files. Right-click a component in the \uicontrol Navigator
@@ -267,14 +255,24 @@
\section1 Moving Within Components
- Components can consist of several other components. To view the component
- hierarchy as a bread crumb path when you edit a component in
- \uicontrol {Form Editor}, select \uicontrol {Go into Component} or press
- \key F2. Click the component names in the path to navigate to them. You
- can easily navigate back to the top level when you are done editing the
+ The QML files that specify components can contain instances of other
+ components specified in separate QML files. You can open the QML file
+ that specifies a component in different ways from different views:
+
+ \list
+ \li In \uicontrol {Form Editor} or \uicontrol Navigator,
+ right-click an instance of a component and then select
+ \uicontrol {Go into Component} in the context-menu or
+ press \key F2.
+ \li In \uicontrol Properties, select \uicontrol {Edit Master Component}.
+ \endlist
+
+ The component hierarchy is displayed as a bread crumb path, where you can
+ click the component names to open the respective files. This enables you
+ to easily navigate back to the top level when you are done editing the
component.
- \image qmldesigner-breadcrumbs.png "Go into Component command"
+ \image qmldesigner-breadcrumbs.png "Component hierarchy"
\section1 Merging Files with Templates
diff --git a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc
index 98059facac7..b64db4fdf5e 100644
--- a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc
@@ -108,4 +108,7 @@
You can move the views anywhere on the screen and save them as
\e workspaces, as instructed in \l {Managing Workspaces}.
+ Watch a video about using the Design mode views:
+
+ \youtube RfEYO-5Mw6s
*/
diff --git a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc
index 757d03d4e67..2c426214a86 100644
--- a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc
+++ b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc
@@ -446,10 +446,6 @@
\li \inlineimage icons/groupbox-icon16.png
\li \l [QtQuickControls]{GroupBox}{Group Box}
\li A titled visual frame around a group of controls.
- \row
- \li \inlineimage icons/label-icon16.png
- \li \l [QtQuickControls]{Label}
- \li A text label with inherited styling and font.
\row
\li \inlineimage icons/page-icon16.png
\li \l [QtQuickControls]{Page}
diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf
index 56c602c2540..cdb97676c2a 100644
--- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf
+++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf
@@ -39,6 +39,8 @@ imagedirs = ../images \
../../../src/plugins/qmldesigner/qtquickplugin/images \
../../../src/plugins/texteditor/images
+include(../../qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf)
+
excludefiles += ../../qtcreator/src/qtcreator.qdoc \
../../qtcreator/src/qtcreator-toc.qdoc
@@ -69,13 +71,6 @@ exampledirs = ../examples/ \
../../qtcreator/examples
examples.fileextensions += *.qml *.svg *.ts *.qm
-{HTML.extraimages,qhp.qtdesignstudio.extraFiles} += ../../config/images/commercial.png \
- ../images/videoicons/SsFWyUeAA_4.jpg \
- ../images/videoicons/9ihYeC0YJ0M.jpg \
- ../images/videoicons/aV6kFxH3Xws.jpg \
- ../images/videoicons/ZzbucmQPU44.jpg
-
-
depends += qtwidgets \
qtcore \
qtqml \
diff --git a/doc/qtdesignstudio/qtdesignstudio-online.qdocconf b/doc/qtdesignstudio/qtdesignstudio-online.qdocconf
index 27121048cb6..5fc198cc452 100644
--- a/doc/qtdesignstudio/qtdesignstudio-online.qdocconf
+++ b/doc/qtdesignstudio/qtdesignstudio-online.qdocconf
@@ -3,6 +3,9 @@ include($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf)
include(config/html-online.qdocconf)
include(config/qtdesignstudio.qdocconf)
+# Override macros for online use
+include(../config/macros-online.qdocconf)
+
# Add an .html file with sidebar content, used in the online style
HTML.stylesheets += config/style/qt5-sidebar.html
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc
index 1cf4f4df8fa..789d0defb42 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-components.qdocinc
@@ -25,9 +25,9 @@
//! [creating studio components]
- \section1 Creating Custom Controls
+ \section2 Creating Custom Controls
- You can use the project wizard to create a starting point for a custom
+ You can use project wizard templates to create a starting point for a custom
\l [QtQuickControls2] {Button}, \l [QtQuickControls2] {Pane},
\l [QtQuickControls2] {StackLayout}{Stacked Layout},
\l [QtQuickControls2] {SwipeView}{Swipe View}, or
@@ -43,8 +43,13 @@
with a capital letter.
\li Edit component properties in the \uicontrol Properties view.
- The available properties depend on the QML type.
+ The available properties depend on the QML type. You can
+ \l{Specifying Dynamic Properties}{add properties for components} in
+ the \uicontrol Properties tab of the \uicontrol {Connection View}.
\endlist
+ For an example of using the \uicontrol Button template to create a button,
+ see \l{Creating a Push Button} in the \l{Log In UI - Part 1} tutorial.
+
//! [creating studio components]
*/
diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
index c883a14dc1e..450332556ba 100644
--- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
+++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc
@@ -82,6 +82,7 @@
\list
\li \l{Editing 2D Content}
\li \l{Shapes}
+ \li \l{Text}
\li \l{Images}
\li \l{User Interaction Methods}
\li \l{Lists and Other Data Models}
diff --git a/doc/qtdesignstudio/src/qtquickdesigner-components/components/qqs-components-border.qdoc b/doc/qtdesignstudio/src/qtquickdesigner-components/components/qqs-components-border.qdoc
index a49d4533c9c..93ce98cb5ad 100644
--- a/doc/qtdesignstudio/src/qtquickdesigner-components/components/qqs-components-border.qdoc
+++ b/doc/qtdesignstudio/src/qtquickdesigner-components/components/qqs-components-border.qdoc
@@ -30,7 +30,7 @@
\inherits ShapePath
\ingroup qtquickstudio-components
- \brief A border drawn in four segments: left, top right, and bottom.
+ \brief A border drawn in four segments: left, top, right, and bottom.
The Border type is used to create borders out of four segments: left,
top, right, and bottom. The \l drawLeft, \l drawTop, \l drawRight, and
@@ -48,7 +48,7 @@
The \l joinStyle property specifies how to connect two border line segments.
- The \l strokeColor, \l strokeWidth, and \l strokeStyle, properties specify
+ The \l strokeColor, \l strokeWidth, and \l strokeStyle properties specify
the appearance of the border line. The \l dashPattern and \l dashOffset
properties specify the appearance of dashed lines.
diff --git a/share/qtcreator/android/sdk_definitions.json b/share/qtcreator/android/sdk_definitions.json
index 056b425f6ca..f1545c2ad69 100644
--- a/share/qtcreator/android/sdk_definitions.json
+++ b/share/qtcreator/android/sdk_definitions.json
@@ -1,12 +1,12 @@
{
"common": {
"sdk_tools_url": {
- "linux": "https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip",
- "linux_sha256": "87f6dcf41d4e642e37ba03cb2e387a542aa0bd73cb689a9e7152aad40a6e7a08",
- "windows": "https://dl.google.com/android/repository/commandlinetools-win-6858069_latest.zip",
- "windows_sha256": "d2f6c9bb7db0362995c0b8dd2fd5949ce23c1dccb7f9392350b5e29b6d5fec7d",
- "mac": "https://dl.google.com/android/repository/commandlinetools-mac-6858069_latest.zip",
- "mac_sha256": "58a55d9c5bcacd7c42170d2cf2c9ae2889c6797a6128307aaf69100636f54a13"
+ "linux": "https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip",
+ "linux_sha256": "89f308315e041c93a37a79e0627c47f21d5c5edbe5e80ea8dc0aac8a649e0e92",
+ "windows": "https://dl.google.com/android/repository/commandlinetools-win-6609375_latest.zip",
+ "windows_sha256": "40bba20275180194bebf89bb58c74d712bb93cc401f36bd2f8f32383acf9826c",
+ "mac": "https://dl.google.com/android/repository/commandlinetools-mac-6609375_latest.zip",
+ "mac_sha256": "2c3822db1c916655223e5ee8ce0fbf6b73d0b99012045c9dc8eaa6a5736c0c55"
},
"sdk_essential_packages": {
"default": ["platform-tools", "platforms;android-30", "cmdline-tools;latest"],
diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py
index b682f4ae002..b2d6e78755f 100644
--- a/share/qtcreator/debugger/dumper.py
+++ b/share/qtcreator/debugger/dumper.py
@@ -556,9 +556,10 @@ class DumperBase():
return size, limit
def vectorData(self, value):
- vector_data_ptr = self.extractPointer(value)
- # vector_data_ptr is what is e.g. stored in a QVector's d_ptr.
- if self.qtVersion() >= 0x050000:
+ if self.qtVersion() >= 0x060000:
+ data, size, alloc = self.qArrayData(value)
+ elif self.qtVersion() >= 0x050000:
+ vector_data_ptr = self.extractPointer(value)
if self.ptrSize() == 4:
(ref, size, alloc, offset) = self.split('IIIp', vector_data_ptr)
else:
@@ -566,6 +567,7 @@ class DumperBase():
alloc = alloc & 0x7ffffff
data = vector_data_ptr + offset
else:
+ vector_data_ptr = self.extractPointer(value)
(ref, alloc, size) = self.split('III', vector_data_ptr)
data = vector_data_ptr + 16
self.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
@@ -573,9 +575,9 @@ class DumperBase():
def qArrayData(self, value):
if self.qtVersion() >= 0x60000:
- dd, data, size = self.split('ppi', value)
+ dd, data, size = self.split('ppp', value)
if dd:
- alloc, i, i = self.split('Pii', dd)
+ _, _, alloc = self.split('iip', dd)
else: # fromRawData
alloc = size
return data, size, alloc
@@ -618,18 +620,12 @@ class DumperBase():
data = self.extractPointer(array_data_ptr + self.ptrSize())
return data, size, alloc
- # addr is the begin of a QByteArrayData structure
def encodeStringHelper(self, value, limit):
- addr = self.extractPointer(value)
- # Should not happen, but we get it with LLDB as result
- # of inferior calls
- if addr == 0:
- return 0, ''
data, size, alloc = self.qArrayData(value)
if alloc != 0:
self.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
- elided, shown = self.computeLimit(size, limit)
- return elided, self.readMemory(data, 2 * shown)
+ elided, shown = self.computeLimit(2 * size, 2 * limit)
+ return elided, self.readMemory(data, shown)
def encodeByteArrayHelper(self, value, limit):
data, size, alloc = self.qArrayData(value)
@@ -690,16 +686,8 @@ class DumperBase():
self.putValue(data, 'latin1', elided=elided)
def encodeString(self, value, limit=0):
- if self.qtVersion() >= 0x60000:
- dd, ptr, size = self.split('ppi', value)
- if not dd:
- return ""
- elided, shown = self.computeLimit(2 * size, 2 * self.displayStringLimit)
- data = self.readMemory(ptr, shown)
- return data
- else:
- elided, data = self.encodeStringHelper(value, limit)
- return data
+ elided, data = self.encodeStringHelper(value, limit)
+ return data
def encodedUtf16ToUtf8(self, s):
return ''.join([chr(int(s[i:i + 2], 16)) for i in range(0, len(s), 4)])
@@ -708,7 +696,7 @@ class DumperBase():
return self.encodedUtf16ToUtf8(self.encodeString(value, limit))
def stringData(self, value): # -> (data, size, alloc)
- return self.qArrayData(value)
+ return self.qArrayData(value)
def extractTemplateArgument(self, typename, position):
level = 0
@@ -744,14 +732,8 @@ class DumperBase():
return inner
def putStringValue(self, value):
- if self.qtVersion() >= 0x60000:
- dd, ptr, size = self.split('ppi', value)
- elided, shown = self.computeLimit(2 * size, 2 * self.displayStringLimit)
- data = self.readMemory(ptr, shown)
- self.putValue(data, 'utf16', elided=elided)
- else:
- elided, data = self.encodeStringHelper(value, self.displayStringLimit)
- self.putValue(data, 'utf16', elided=elided)
+ elided, data = self.encodeStringHelper(value, self.displayStringLimit)
+ self.putValue(data, 'utf16', elided=elided)
def putPtrItem(self, name, value):
with SubItem(self, name):
@@ -1902,7 +1884,7 @@ class DumperBase():
= self.split('ppppIIp' + 'pppppp', dd)
if qobjectPtr:
- qobjectType = self.createType('QObject')
+ qobjectType = self.createType('@QObject')
with SubItem(self, '[parent]'):
if not self.isCli:
self.putSortGroup(9)
@@ -2063,8 +2045,8 @@ class DumperBase():
# Dynamic properties.
if extraData:
- byteArrayType = self.createType('QByteArray')
- variantType = self.createType('QVariant')
+ byteArrayType = self.createType('@QByteArray')
+ variantType = self.createType('@QVariant')
if self.qtVersion() >= 0x50600:
values = self.vectorChildrenGenerator(
extraData + 2 * ptrSize, variantType)
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index 1a114704f53..2b9078db218 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -1309,7 +1309,11 @@ class Dumper(DumperBase):
result = 'registers=['
for group in frame.GetRegisters():
for reg in group:
- value = ''.join(["%02x" % x for x in reg.GetData().uint8s])
+ data = reg.GetData()
+ if data.GetByteOrder() == lldb.eByteOrderLittle:
+ value = ''.join(["%02x" % x for x in reversed(data.uint8s)])
+ else:
+ value = ''.join(["%02x" % x for x in data.uint8s])
result += '{name="%s"' % reg.GetName()
result += ',value="0x%s"' % value
result += ',size="%s"' % reg.GetByteSize()
diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py
index f749fa83281..cfc9bd4178e 100644
--- a/share/qtcreator/debugger/qttypes.py
+++ b/share/qtcreator/debugger/qttypes.py
@@ -68,11 +68,8 @@ def qdump__QByteArray(d, value):
if size > 0:
d.putExpandable()
- if d.qtVersion() >= 0x60000:
- elided, shown = d.computeLimit(size, d.displayStringLimit)
- p = d.readMemory(data, shown)
- else:
- elided, p = d.encodeByteArrayHelper(value, d.displayStringLimit)
+ elided, shown = d.computeLimit(size, d.displayStringLimit)
+ p = d.readMemory(data, shown)
displayFormat = d.currentItemFormat()
if displayFormat == DisplayFormat.Automatic or displayFormat == DisplayFormat.Latin1String:
@@ -246,7 +243,7 @@ def qdump__Qt__ItemDataRole(d, value):
def qdump__QStandardItemData(d, value):
- role, pad, val = value.split('{@Qt::ItemDataRole}@{QVariant}')
+ role, pad, val = value.split('{@Qt::ItemDataRole}@{@QVariant}')
d.putPairContents(role.value(), (role, val), 'role', 'value')
@@ -576,7 +573,7 @@ def qdump__QKeyEvent(d, value):
# ushort reserved:15;
(vtable, privateD, t, flags, modState, ts, txt, k, scanCode,
virtualKey, modifiers,
- c, autor) = value.split("ppHHiQ{QString}{int}IIIHH")
+ c, autor) = value.split("ppHHiQ{@QString}{int}IIIHH")
#d.putStringValue(txt)
#data = d.encodeString(txt)
@@ -826,7 +823,7 @@ def qdump__QHash(d, value):
def qdump__QVariantHash(d, value):
- qdumpHelper_QHash(d, value, d.createType('QString'), d.createType('QVariant'))
+ qdumpHelper_QHash(d, value, d.createType('@QString'), d.createType('@QVariant'))
def qdumpHelper_QHash(d, value, keyType, valueType):
@@ -888,6 +885,10 @@ def qdumpHelper_QHash_5(d, value, keyType, valueType):
def qdumpHelper_QHash_6(d, value, keyType, valueType):
dptr = d.extractPointer(value)
+ if dptr == 0:
+ d.putItemCount(0)
+ return
+
ref, _, size, buckets, seed, spans = d.split('i@qqqp', dptr)
d.check(0 <= size and size <= 100 * 1000 * 1000)
@@ -972,29 +973,29 @@ def qdump__QHostAddress(d, value):
if tiVersion is not None:
if tiVersion >= 16:
# After a6cdfacf
- p, scopeId, a6, a4, protocol = d.split('p{QString}16s{quint32}B', dd)
+ p, scopeId, a6, a4, protocol = d.split('p{@QString}16s{@quint32}B', dd)
mayNeedParse = False
elif tiVersion >= 5:
# Branch 5.8.0 at f70b4a13 TI: 15
# Branch 5.7.0 at b6cf0418 TI: 5
(ipString, scopeId, a6, a4, protocol, isParsed) \
- = d.split('{QString}{QString}16s{quint32}B{bool}', dd)
+ = d.split('{@QString}{@QString}16s{@quint32}B{bool}', dd)
else:
(ipString, scopeId, a4, pad, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}I16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}I16sI{bool}', dd)
elif qtVersion >= 0x050600: # 5.6.0 at f3aabb42
if d.ptrSize() == 8 or d.isWindowsTarget():
(ipString, scopeId, a4, pad, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}I16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}I16sI{bool}', dd)
else:
(ipString, scopeId, a4, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}16sI{bool}', dd)
elif qtVersion >= 0x050000: # 5.2.0 at 62feb088
(ipString, scopeId, a4, a6, protocol, isParsed) \
- = d.split('{QString}{QString}{quint32}16sI{bool}', dd)
+ = d.split('{@QString}{@QString}{@quint32}16sI{bool}', dd)
else: # 4.8.7 at b05d05f
(a4, a6, protocol, pad, ipString, isParsed, pad, scopeId) \
- = d.split('{quint32}16sB@{QString}{bool}@{QString}', dd)
+ = d.split('{@quint32}16sB@{@QString}{bool}@{@QString}', dd)
if mayNeedParse:
ipStringData, ipStringSize, ipStringAlloc = d.stringData(ipString)
@@ -1047,7 +1048,7 @@ def qdump__QList(d, value):
def qdump__QVariantList(d, value):
- qdumpHelper_QList(d, value, d.createType('QVariant'))
+ qdumpHelper_QList(d, value, d.createType('@QVariant'))
def qdumpHelper_QList(d, value, innerType):
@@ -1189,8 +1190,8 @@ def qdump__QLocale(d, value):
decimal, group, listt, percent, zero,
minus, plus, exponential) \
= d.split('2s{short}2s'
- + '{QChar}{QChar}{short}{QChar}{QChar}'
- + '{QChar}{QChar}{QChar}', data)
+ + '{@QChar}{@QChar}{short}{@QChar}{@QChar}'
+ + '{@QChar}{@QChar}{@QChar}', data)
try:
d.putStringValue(d.call('const char *', value, 'name'))
except:
@@ -1328,7 +1329,7 @@ def qform__QVariantMap():
def qdump__QVariantMap(d, value):
- qdumpHelper_QMap(d, value, d.createType('QString'), d.createType('QVariant'))
+ qdumpHelper_QMap(d, value, d.createType('@QString'), d.createType('@QVariant'))
def qdump__QMetaMethod(d, value):
@@ -1431,7 +1432,7 @@ def qdump__QRectF(d, value):
def qdump__QRegExp(d, value):
# value.priv.engineKey.pattern
privAddress = d.extractPointer(value)
- (eng, pattern) = d.split('p{QString}', privAddress)
+ (eng, pattern) = d.split('p{@QString}', privAddress)
d.putStringValue(pattern)
d.putExpandable()
if d.isExpanded():
@@ -1442,7 +1443,7 @@ def qdump__QRegExp(d, value):
# Might fail (LLDB, Core files, ...), still cache might be warm.
pass
(patternSyntax, caseSensitive, minimal, pad, t, captures) \
- = d.split('{int}{int}B@{QString}{QStringList}', privAddress + 2 * d.ptrSize())
+ = d.split('{int}{int}B@{@QString}{@QStringList}', privAddress + 2 * d.ptrSize())
d.putSubItem('syntax', patternSyntax.cast(d.qtNamespace() + 'QRegExp::PatternSyntax'))
d.putSubItem('captures', captures)
@@ -1455,15 +1456,15 @@ def qdump__QRegion(d, value):
if d.qtVersion() >= 0x060000:
ref, _, rgn = d.split('i@p', d_ptr)
numRects, innerArea, rects, extents, innerRect = \
- d.split('ii{QList}{QRect}{QRect}', rgn)
+ d.split('ii{@QList<@QRect>}{@QRect}{@QRect}', rgn)
elif d.qtVersion() >= 0x050400: # Padding removed in ee324e4ed
ref, _, rgn = d.split('i@p', d_ptr)
numRects, innerArea, rects, extents, innerRect = \
- d.split('ii{QVector}{QRect}{QRect}', rgn)
+ d.split('ii{@QVector<@QRect>}{@QRect}{@QRect}', rgn)
elif d.qtVersion() >= 0x050000:
ref, _, rgn = d.split('i@p', d_ptr)
numRects, _, rects, extents, innerRect, innerArea = \
- d.split('i@{QVector}{QRect}{QRect}i', rgn)
+ d.split('i@{@QVector<@QRect>}{@QRect}{@QRect}i', rgn)
else:
if d.isWindowsTarget():
ref, _, rgn = d.split('i@p', d_ptr)
@@ -1473,7 +1474,7 @@ def qdump__QRegion(d, value):
numRects = 0
else:
numRects, _, rects, extents, innerRect, innerArea = \
- d.split('i@{QVector}{QRect}{QRect}i', rgn)
+ d.split('i@{@QVector<@QRect>}{@QRect}{@QRect}i', rgn)
d.putItemCount(numRects)
if d.isExpanded():
@@ -1622,13 +1623,13 @@ def qdump__QStack(d, value):
def qdump__QPolygonF(d, value):
data, size, _ = d.vectorData(value)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPointF'))
+ d.putPlotData(data, size, d.createType('@QPointF'))
def qdump__QPolygon(d, value):
data, size, _ = d.vectorData(value)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPoint'))
+ d.putPlotData(data, size, d.createType('@QPoint'))
def qdump__QGraphicsPolygonItem(d, value):
@@ -1642,7 +1643,7 @@ def qdump__QGraphicsPolygonItem(d, value):
offset = 308
data, size, alloc = d.vectorData(dptr + offset)
d.putItemCount(size)
- d.putPlotData(data, size, d.createType('QPointF'))
+ d.putPlotData(data, size, d.createType('@QPointF'))
def qedit__QString(d, value, data):
@@ -1664,7 +1665,7 @@ def qdump__QString(d, value):
if (size > 0):
d.putExpandable()
if d.isExpanded():
- d.putArrayData(data, size, d.createType('QChar'))
+ d.putArrayData(data, size, d.createType('@QChar'))
def qdump__QStaticStringData(d, value):
@@ -1704,13 +1705,13 @@ def qdump__QStringRef(d, value):
if stringptr == 0:
d.putValue('(null)')
return
- (data, ssize, alloc) = d.stringData(d.createValue(stringptr, 'QString'))
+ data, ssize, alloc = d.stringData(d.createValue(stringptr, '@QString'))
d.putValue(d.readMemory(data + 2 * pos, 2 * size), 'utf16')
d.putPlainChildren(value)
def qdump__QStringList(d, value):
- qdumpHelper_QList(d, value, d.createType('QString'))
+ qdumpHelper_QList(d, value, d.createType('@QString'))
d.putBetterType(value.type)
@@ -1773,8 +1774,8 @@ def qdump__QUrl(d, value):
if d.qtVersion() < 0x050000:
d.call('void', value, 'port') # Warm up internal cache.
d.call('void', value, 'path')
- st = '{QString}'
- ba = '{QByteArray}'
+ st = '{@QString}'
+ ba = '{@QByteArray}'
(ref, dummy,
scheme, userName, password, host, path, # QString
query, # QByteArray
@@ -1785,7 +1786,7 @@ def qdump__QUrl(d, value):
= d.split('i@' + st * 5 + ba + st + ba * 5 + 'i', privAddress)
else:
(ref, port, scheme, userName, password, host, path, query, fragment) \
- = d.split('ii' + '{QString}' * 7, privAddress)
+ = d.split('ii' + '{@QString}' * 7, privAddress)
userNameEnc = d.encodeString(userName)
hostEnc = d.encodeString(host)
@@ -2000,7 +2001,49 @@ qdumpHelper_QVariants_F = [
def qdump__QVariant(d, value):
- (data, typeStuff) = d.split('8sI', value)
+ if d.qtVersion() >= 0x060000:
+ qdumpHelper__QVariant6(d, value)
+ else:
+ qdumpHelper__QVariant45(d, value)
+
+def qdumpHelper__QVariant6(d, value):
+ data, typeStuff = d.split('24sp', value)
+ packedType = typeStuff >> 2
+ metaTypeInterface = typeStuff - (typeStuff & 3)
+
+ if metaTypeInterface == 0:
+ qdumpHelper_QVariant_0(d, value)
+ return
+
+ revision, alignment, size, flags, variantType, metaObjectPtr, name = \
+ d.split('HHIIIpp', metaTypeInterface)
+
+ # Well-known simple type.
+ if variantType <= 6:
+ qdumpHelper_QVariants_A[variantType](d, value)
+ return None
+
+ # Extended Core type (Qt 5+)
+ if variantType >= 31 and variantType <= 38:
+ qdumpHelper_QVariants_D[variantType - 31](d, value)
+ return None
+
+ typeName = d.extractCString(name).decode('utf8')
+ isShared = bool(typeStuff & 0x1)
+
+ if isShared:
+ # indirectly stored items (QRectF, ...)
+ ptr = d.extractPointer(value)
+ _, data = d.split('8s{%s}' % typeName, ptr)
+ d.putItem(data)
+ else:
+ d.putItem(d.createValue(data, typeName))
+
+ d.putBetterType('%sQVariant (%s)' % (d.qtNamespace(), typeName))
+
+
+def qdumpHelper__QVariant45(d, value):
+ data, typeStuff = d.split('8sI', value)
variantType = typeStuff & 0x3fffffff
isShared = bool(typeStuff & 0x40000000)
@@ -2192,7 +2235,7 @@ def qdump__QXmlAttributes__Attribute(d, value):
d.putExpandable()
if d.isExpanded():
with Children(d):
- (qname, uri, localname, val) = value.split('{QString}' * 4)
+ (qname, uri, localname, val) = value.split('{@QString}' * 4)
d.putSubItem('qname', qname)
d.putSubItem('uri', uri)
d.putSubItem('localname', localname)
@@ -2200,8 +2243,8 @@ def qdump__QXmlAttributes__Attribute(d, value):
def qdump__QXmlAttributes(d, value):
- vptr, atts = value.split('p{QList}')
- _, att_size, _ = d.describeStruct('{QString}' * 4)
+ vptr, atts = value.split('p{@QList<@QXmlAttributes::Attribute>}')
+ _, att_size, _ = d.describeStruct('{@QString}' * 4)
innerType = d.createType(d.qtNamespace() + 'QXmlAttributes::Attribute',
att_size)
qdumpHelper_QList(d, atts, innerType)
@@ -2265,7 +2308,7 @@ def qdump__QV4__Heap__String(d, value):
# Note: There's also the 'Identifier' case. And the largestSubLength != 0 case.
(baseClass, textOrLeft, idOrRight, subtype, stringHash, largestSub, length, mm) \
= value.split('QppIIIIp')
- textPtr = d.split('{QStringDataPtr}', textOrLeft)[0]
+ textPtr = d.split('{@QStringDataPtr}', textOrLeft)[0]
qdump__QStringData(d, d.createValue(textOrLeft, d.qtNamespace() + 'QStringData'))
if d.isExpanded():
with Children(d):
@@ -3066,7 +3109,7 @@ def qdump__QJsonValue(d, value):
return
if t == 3:
d.putType('QJsonValue (String)')
- string = value.split('{QString}')[0]
+ string = value.split('{@QString}')[0]
elided, base = d.encodeString(string, d.displayStringLimit)
d.putValue(base, 'utf16', elided=elided)
return
@@ -3121,14 +3164,14 @@ def qdump__QSqlResultPrivate(d, value):
error1, error2, error3, \
forwardOnly, pad, precisionPolicy, bindCount, \
binds, executedQuery, types, values, indexes, holders = \
- value.split('ppppi@{QString}bb@pppb@iiii{QString}ppp')
+ value.split('ppppi@{@QString}bb@pppb@iiii{@QString}ppp')
d.putStringValue(sql)
d.putPlainChildren(value)
def qdump__QSqlField(d, value):
- val, dptr = value.split('{QVariant}p')
+ val, dptr = value.split('{@QVariant}p')
qdump__QVariant(d, val)
d.putBetterType(d.currentType.value.replace('QVariant', 'QSqlField'))
d.putPlainChildren(value)
@@ -3166,7 +3209,7 @@ def qdump__qfloat16(d, value):
def qdumpHelper_QCbor_string(d, container_ptr, element_index, is_bytes):
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
@@ -3202,7 +3245,7 @@ def qdumpHelper_QCbor_array(d, container_ptr, is_cbor):
if not container_ptr:
d.putItemCount(0)
return
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
@@ -3223,7 +3266,7 @@ def qdumpHelper_QCbor_map(d, container_ptr, is_cbor):
if not container_ptr:
d.putItemCount(0)
return
- # d.split('i@{QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
+ # d.split('i@{@QByteArray::size_type}pp', container_ptr) doesn't work with CDB,
# so be explicit:
pos = container_ptr + (2 * d.ptrSize() if d.qtVersion() >= 0x060000 else 8)
elements_data_ptr, elements_size, _ = d.vectorData(pos + d.ptrSize())
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
index b59ff161cdf..6879ddacdfe 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
@@ -700,7 +700,13 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
renderImage = m_modelNodePreviewImageCache[m_modelNodePreviewImageCommand.componentPath()];
} else {
QObject *instanceObj = nullptr;
- if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()) {
+ bool createdFromComponent = false;
+ ServerNodeInstance instance = instanceForId(m_modelNodePreviewImageCommand.instanceId());
+ if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()
+ && instance.isSubclassOf("QQuick3DNode")) {
+ // Create a new instance for Node components, as using Nodes in multiple
+ // import scenes simultaneously isn't supported. And even if it was, we still
+ // wouldn't want the children of the Node to appear in the preview.
QQmlComponent component(engine());
component.loadUrl(QUrl::fromLocalFile(m_modelNodePreviewImageCommand.componentPath()));
instanceObj = qobject_cast(component.create());
@@ -708,8 +714,8 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
qWarning() << "Could not create preview component: " << component.errors();
return;
}
+ createdFromComponent = true;
} else {
- ServerNodeInstance instance = instanceForId(m_modelNodePreviewImageCommand.instanceId());
instanceObj = instance.internalObject();
}
QSize renderSize = m_modelNodePreviewImageCommand.size();
@@ -758,7 +764,7 @@ void Qt5InformationNodeInstanceServer::doRenderModelNode3DImageView()
ready = QQmlProperty::read(m_modelNode3DImageViewData.rootItem, "ready").value();
}
QMetaObject::invokeMethod(m_modelNode3DImageViewData.rootItem, "destroyView");
- if (!m_modelNodePreviewImageCommand.componentPath().isEmpty()) {
+ if (createdFromComponent) {
// If component changes, puppet will need a reset anyway, so we can cache the image
m_modelNodePreviewImageCache.insert(m_modelNodePreviewImageCommand.componentPath(), renderImage);
delete instanceObj;
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
index 620ed0352b3..f95f69cb84f 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceserver.cpp
@@ -259,6 +259,8 @@ bool Qt5NodeInstanceServer::initRhi(RenderViewData &viewData)
// redirect Qt Quick rendering into our texture
viewData.window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(viewData.texTarget));
+#else
+ Q_UNUSED(viewData)
#endif
return true;
}
@@ -294,6 +296,8 @@ QImage Qt5NodeInstanceServer::grabRenderControl(RenderViewData &viewData)
rd->cb->resourceUpdate(readbackBatch);
viewData.renderControl->endFrame();
+#else
+ Q_UNUSED(viewData)
#endif
return renderImage;
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextEditSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextEditSpecifics.qml
index 6a09b44a29c..2703191cda0 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextEditSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextEditSpecifics.qml
@@ -34,6 +34,7 @@ Column {
StandardTextSection {
showVerticalAlignment: true
showFormatProperty: true
+ richTextEditorAvailable: true
}
Section {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml
index 7b79e76f0c3..96a36c16b18 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/TextSpecifics.qml
@@ -37,6 +37,7 @@ Column {
showElide: true
showFontSizeMode: true
showLineHeight: true
+ richTextEditorAvailable: true
}
Section {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
index c15f1268113..cbd6fe9d650 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml
@@ -40,6 +40,8 @@ Section {
property bool showFormatProperty: false
property bool showFontSizeMode: false
property bool showLineHeight: false
+ property bool richTextEditorAvailable: false
+ id: root
SectionLayout {
@@ -61,9 +63,10 @@ Section {
onClicked: {
richTextDialogLoader.show()
}
+ visible: root.richTextEditorAvailable
}
- RichTextEditor{
+ RichTextEditor {
onRejected: {
hideWidget()
}
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json
index 1ad41e72302..5ebf0852168 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/scroll/wizard.json
@@ -160,7 +160,7 @@
"type": "ComboBox",
"data":
{
- "index": 0,
+ "index": 1,
"items":
[
{
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json
index e3966ca5231..2f0d0353f54 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/stack/wizard.json
@@ -178,7 +178,7 @@
"type": "ComboBox",
"data":
{
- "index": 0,
+ "index": 1,
"items":
[
{
diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json
index 67dd9fb711a..804916d77a8 100644
--- a/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json
+++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/swipe/wizard.json
@@ -178,7 +178,7 @@
"type": "ComboBox",
"data":
{
- "index": 0,
+ "index": 1,
"items":
[
{
diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp
index d19137cfaeb..b8b9a4e81e5 100644
--- a/src/libs/cplusplus/FindUsages.cpp
+++ b/src/libs/cplusplus/FindUsages.cpp
@@ -402,8 +402,11 @@ Usage::Type FindUsages::getType(int line, int column, int tokenIndex)
}
if (const auto declarator = (*it)->asDeclarator()) {
if (containsToken(declarator->core_declarator)) {
- if (declarator->initializer)
+ if (declarator->initializer && (!declarator->postfix_declarator_list
+ || !declarator->postfix_declarator_list->value
+ || !declarator->postfix_declarator_list->value->asFunctionDeclarator())) {
return Usage::Type::Initialization;
+ }
return Usage::Type::Declaration;
}
if (const auto decl = (*(it + 1))->asSimpleDeclaration()) {
diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp
index cdd60967b76..32e916eb89d 100644
--- a/src/libs/qmljs/qmljslink.cpp
+++ b/src/libs/qmljs/qmljslink.cpp
@@ -492,8 +492,11 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
for (const auto &toImport : libraryInfo.imports()) {
QString importName = toImport.module;
ComponentVersion vNow = toImport.version;
- // there was a period in which no version == auto, should we add || !vNow.isValid() to the if?
- if (toImport.flags & QmlDirParser::Import::Auto)
+ /* There was a period in which no version == auto
+ * Required for QtQuick imports less than 2.15
+ */
+ if ((toImport.flags & QmlDirParser::Import::Auto)
+ || !vNow.isValid())
vNow = version;
Import subImport;
subImport.valid = true;
diff --git a/src/libs/ssh/sftptransfer.cpp b/src/libs/ssh/sftptransfer.cpp
index 853907eaa0d..02391943348 100644
--- a/src/libs/ssh/sftptransfer.cpp
+++ b/src/libs/ssh/sftptransfer.cpp
@@ -180,9 +180,8 @@ void SftpTransfer::doStart()
+ QtcProcess::quoteArgUnix(sourceFileOrLinkTarget).toLocal8Bit() + ' '
+ QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit() + '\n');
}
- d->sftpProc.start(sftpBinary.toString(),
- QStringList{"-b", QDir::toNativeSeparators(batchFile.fileName())}
- << d->connectionArgs);
+ d->sftpProc.setStandardInputFile(batchFile.fileName());
+ d->sftpProc.start(sftpBinary.toString(), d->connectionArgs);
emit started();
}
diff --git a/src/libs/utils/crumblepath.cpp b/src/libs/utils/crumblepath.cpp
index f8f027d7f70..378f41545ba 100644
--- a/src/libs/utils/crumblepath.cpp
+++ b/src/libs/utils/crumblepath.cpp
@@ -177,7 +177,7 @@ CrumblePath::CrumblePath(QWidget *parent) : QWidget(parent)
layout->setSpacing(0);
setLayout(layout);
- setStyleSheet("QPushButton { margin: 12; }");
+ setStyleSheet("QPushButton { padding-left: 12; padding-right: 12; }");
}
CrumblePath::~CrumblePath()
diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp
index 16e911eb8a1..81a29d14d2a 100644
--- a/src/libs/utils/synchronousprocess.cpp
+++ b/src/libs/utils/synchronousprocess.cpp
@@ -39,6 +39,7 @@
#include
+#include
#include
#include
@@ -803,7 +804,11 @@ QString SynchronousProcess::locateBinary(const QString &path, const QString &bin
QString SynchronousProcess::normalizeNewlines(const QString &text)
{
QString res = text;
- res.replace(QLatin1String("\r\n"), QLatin1String("\n"));
+ const auto newEnd = std::unique(res.begin(), res.end(), [](const QChar &c1, const QChar &c2) {
+ return c1 == '\r' && c2 == '\r'; // QTCREATORBUG-24556
+ });
+ res.chop(std::distance(newEnd, res.end()));
+ res.replace("\r\n", "\n");
return res;
}
diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp
index 8766305885e..ae0cb36c003 100644
--- a/src/plugins/coreplugin/outputwindow.cpp
+++ b/src/plugins/coreplugin/outputwindow.cpp
@@ -627,7 +627,7 @@ private:
void Internal::CorePlugin::testOutputFormatter()
{
const QString input =
- "B to be handled by B\r\n"
+ "B to be handled by B\r\r\n"
"not to be handled\n\n\n\n"
"A to be handled by A\n"
"continuation for A\r\n"
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp
index 30250f27d76..8a751aa4879 100644
--- a/src/plugins/debugger/debuggerprotocol.cpp
+++ b/src/plugins/debugger/debuggerprotocol.cpp
@@ -198,6 +198,9 @@ QString GdbMi::parseCString(const QChar *&from, const QChar *to)
void GdbMi::parseValue(const QChar *&from, const QChar *to)
{
+ if (from == to)
+ return;
+
//qDebug() << "parseValue: " << QString(from, to - from);
switch (from->unicode()) {
case '{':
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
index 0985dd80715..1fa94bf97d3 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
+++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
@@ -568,12 +568,8 @@ void LineEditField::setup(JsonFieldPage *page, const QString &name)
bool LineEditField::validate(MacroExpander *expander, QString *message)
{
- if (!JsonFieldPage::Field::validate(expander, message))
- return false;
-
if (m_isValidating)
return true;
-
m_isValidating = true;
auto w = qobject_cast(widget());
@@ -594,9 +590,9 @@ bool LineEditField::validate(MacroExpander *expander, QString *message)
m_currentText = w->text();
}
+ const bool baseValid = JsonFieldPage::Field::validate(expander, message);
m_isValidating = false;
-
- return !w->text().isEmpty();
+ return baseValid && !w->text().isEmpty();
}
void LineEditField::initializeData(MacroExpander *expander)
diff --git a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
index 024dd605028..af4f6edac82 100644
--- a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
@@ -113,14 +113,9 @@ double ZoomAction::setPreviousZoomFactor(double zoom)
return zoom;
}
-bool parentIsFormEditor(QWidget *parent)
+bool parentIsToolBar(QWidget *parent)
{
- while (parent) {
- if (qobject_cast(parent))
- return true;
- parent = qobject_cast(parent->parent());
- }
- return false;
+ return qobject_cast(parent) != nullptr;
}
QComboBox *createZoomComboBox(QWidget *parent)
@@ -135,7 +130,7 @@ QComboBox *createZoomComboBox(QWidget *parent)
QWidget *ZoomAction::createWidget(QWidget *parent)
{
- if (!m_combo && parentIsFormEditor(parent)) {
+ if (!m_combo && parentIsToolBar(parent)) {
m_combo = createZoomComboBox(parent);
m_combo->setProperty("hideborder", true);
m_combo->setCurrentIndex(indexOf(1.0));
diff --git a/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp
index 0470798aeca..f14acc16396 100644
--- a/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp
+++ b/src/plugins/qmldesigner/components/connectioneditor/bindingmodel.cpp
@@ -101,6 +101,7 @@ void BindingModel::bindingRemoved(const BindingProperty &bindingProperty)
void BindingModel::selectionChanged(const QList &selectedNodes)
{
+ Q_UNUSED(selectedNodes)
m_handleDataChanged = false;
resetModel();
m_handleDataChanged = true;
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
index e858ae56376..63c7e05d603 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
@@ -512,8 +512,13 @@ QPicture FormEditorWidget::renderToPicture() const
QPainter painter{&picture};
const QTransform viewportTransform = m_graphicsView->viewportTransform();
- const QRectF boundingRect = rootItemRect();
+ auto items = m_formEditorView->scene()->allFormEditorItems();
+ QRectF boundingRect;
+ for (auto &item : items)
+ boundingRect |= item->childrenBoundingRect();
+
+ picture.setBoundingRect(boundingRect.toRect());
m_graphicsView->render(&painter, boundingRect, viewportTransform.mapRect(boundingRect.toRect()));
return picture;
diff --git a/src/plugins/qmldesigner/designercore/instances/baseconnectionmanager.cpp b/src/plugins/qmldesigner/designercore/instances/baseconnectionmanager.cpp
index 76d641fe30f..794c1a436c0 100644
--- a/src/plugins/qmldesigner/designercore/instances/baseconnectionmanager.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/baseconnectionmanager.cpp
@@ -38,6 +38,7 @@ void BaseConnectionManager::setUp(NodeInstanceServerInterface *nodeInstanceServe
ProjectExplorer::Target *,
AbstractView *view)
{
+ Q_UNUSED(view)
m_nodeInstanceServer = nodeInstanceServer;
m_isActive = true;
}
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp
index 2a855b9e8c6..65191293691 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.cpp
+++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp
@@ -258,6 +258,9 @@ bool QmlDesignerPlugin::delayedInitialize()
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::PathTool);
d->viewManager.registerFormEditorToolTakingOwnership(new QmlDesigner::TransitionTool);
+ if (DesignerSettings::getValue(DesignerSettingsKey::STANDALONE_MODE).toBool())
+ emitUsageStatistics("StandaloneMode");
+
return true;
}
diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri
index 20e7cc14dca..28c2d0d3263 100644
--- a/src/shared/clang/clang_installation.pri
+++ b/src/shared/clang/clang_installation.pri
@@ -131,11 +131,6 @@ defineReplace(extractWarnings) {
return($$result)
}
-CLANGTOOLING_LIBS=-lclangTooling -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
- -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
- -lclangASTMatchers -lclangToolingCore -lclangAST -lclangLex -lclangBasic
-win32:CLANGTOOLING_LIBS += -lversion
-
BIN_EXTENSION =
win32: BIN_EXTENSION = .exe
@@ -208,12 +203,17 @@ isEmpty(LLVM_VERSION) {
isEmpty(QTC_CLANG_BUILDMODE_MISMATCH)|!equals(QTC_CLANG_BUILDMODE_MISMATCH, 1) {
CLANGFORMAT_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang/Format/Format.h
exists($$CLANGFORMAT_MAIN_HEADER) {
- CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
- ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions -lclangTooling -lclangToolingCore \
- -lclangRewrite -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
- -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
- -lclangASTMatchers -lclangAST -lclangLex -lclangBasic
- win32:CLANGFORMAT_LIBS += -lversion
+ exists($$LLVM_LIBDIR/*clangBasic*) {
+ CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
+ ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions -lclangTooling -lclangToolingCore \
+ -lclangRewrite -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
+ -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
+ -lclangASTMatchers -lclangAST -lclangLex -lclangBasic
+ win32:CLANGFORMAT_LIBS += -lversion
+ } else {
+ CLANGFORMAT_LIBS = -lclang-cpp
+ ALL_CLANG_LIBS = -lclang-cpp
+ }
}
}
win32:ALL_CLANG_LIBS += -lversion
@@ -240,6 +240,14 @@ isEmpty(LLVM_VERSION) {
isEmpty(QTC_CLANG_BUILDMODE_MISMATCH)|!equals(QTC_CLANG_BUILDMODE_MISMATCH, 1) {
QTC_ENABLE_CLANG_REFACTORING=$$(QTC_ENABLE_CLANG_REFACTORING)
!isEmpty(QTC_ENABLE_CLANG_REFACTORING) {
+ exists($$LLVM_LIBDIR/*clangBasic*) {
+ CLANGTOOLING_LIBS=-lclangTooling -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
+ -lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
+ -lclangASTMatchers -lclangToolingCore -lclangAST -lclangLex -lclangBasic
+ win32:CLANGTOOLING_LIBS += -lversion
+ } else {
+ CLANGTOOLING_LIBS = -lclang-cpp
+ }
!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR}
LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS
}
diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp
index a179992abb8..8ac1f633d7d 100644
--- a/tests/auto/cplusplus/findusages/tst_findusages.cpp
+++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp
@@ -2033,6 +2033,8 @@ struct S {
void nonConstFunc();
static void staticFunc1() {}
static void staticFunc2();
+ virtual void pureVirtual() = 0;
+ virtual void pureVirtual2() = 0 {}
};
void func1(int &);
void func2(const int &);
@@ -2112,7 +2114,7 @@ int main()
Class * const structS = doc->globalSymbolAt(0)->asClass();
QVERIFY(structS);
QCOMPARE(structS->name()->identifier()->chars(), "S");
- QCOMPARE(structS->memberCount(), 11);
+ QCOMPARE(structS->memberCount(), 13);
Declaration * const sv = structS->memberAt(1)->asDeclaration();
QVERIFY(sv);
@@ -2164,6 +2166,20 @@ int main()
QCOMPARE(find.usages().at(0).type, Usage::Type::Write);
QCOMPARE(find.usages().at(1).type, Usage::Type::Declaration);
+ // Make sure that pure virtual declaration is not mistaken for an assignment.
+ Declaration * const pureVirtual = structS->memberAt(11)->asDeclaration();
+ QVERIFY(pureVirtual);
+ QCOMPARE(pureVirtual->name()->identifier()->chars(), "pureVirtual");
+ find(pureVirtual);
+ QCOMPARE(find.usages().size(), 1);
+ QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration);
+ Function * const pureVirtual2 = structS->memberAt(12)->asFunction();
+ QVERIFY(pureVirtual2);
+ QCOMPARE(pureVirtual2->name()->identifier()->chars(), "pureVirtual2");
+ find(pureVirtual2);
+ QCOMPARE(find.usages().size(), 1);
+ QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration);
+
Function * const main = doc->globalSymbolAt(6)->asFunction();
QVERIFY(main);
QCOMPARE(main->memberCount(), 1);
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 8a4fc4b6cd1..5a08803e264 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -2864,21 +2864,21 @@ void tst_Dumpers::dumper_data()
+ CoreProfile()
- + Check("m0", "<0 items>", "@QMap>")
+ + Check("m0", "<0 items>", "@QMap>")
- + Check("m1", "<2 items>", "@QMap>")
+ + Check("m1", "<2 items>", "@QMap>")
+ CheckPairish("m1.0.key", "11", "unsigned int")
- + CheckPairish("m1.0.value", "<1 items>", "@QList")
+ + CheckPairish("m1.0.value", "<1 items>", "@QList<@QString>")
+ CheckPairish("m1.0.value.0", "[0]", "\"11\"", "@QString")
+ CheckPairish("m1.1.key", "22", "unsigned int")
- + CheckPairish("m1.1.value", "<1 items>", "@QList")
+ + CheckPairish("m1.1.value", "<1 items>", "@QList<@QString>")
+ CheckPairish("m1.1.value.0", "[0]", "\"22\"", "@QString")
+ Check("m2", "<2 items>", "@QMap")
+ Check("m2.0", "[0] 11", FloatValue("31.0"), "")
+ Check("m2.1", "[1] 22", FloatValue("32.0"), "")
- + Check("m3", "<2 items>", TypeDef("@QMap>", "T"))
+ + Check("m3", "<2 items>", TypeDef("@QMap>", "T"))
+ Check("m4", "<1 items>", "@QMap<@QString, float>")
+ CheckPairish("m4.0.key", "\"22.0\"", "@QString")
@@ -4003,7 +4003,7 @@ void tst_Dumpers::dumper_data()
//+ Check("this.@1.@1", "[@QObject]", "\"This is thread #3\"", "@QObject");
- QTest::newRow("QVariant")
+ QTest::newRow("QVariant1")
<< Data("#include \n"
"#include \n"
"#include \n"
@@ -4017,9 +4017,7 @@ void tst_Dumpers::dumper_data()
"QVariant v0;\n\n"
- "QVariant::Type t1 = QVariant::String;\n"
- "QVariant v1 = QVariant(t1, (void*)0);\n"
- //"*(QString*)v1.data() = QString(\"Some string\");\n\n"
+ "QVariant v1 = QVariant(QString(\"A string\"));\n"
"MyType my;\n"
"my[1] = (QStringList() << \"Hello\");\n"
@@ -4033,7 +4031,7 @@ void tst_Dumpers::dumper_data()
"list << 1 << 2 << 3;\n"
"QVariant v3 = QVariant::fromValue(list);",
- "&my, &v0, &v1, &v2, &t, &s, &list, &v3, &t1")
+ "&my, &v0, &v1, &v2, &t, &s, &list, &v3")
+ CoreProfile()
@@ -7444,6 +7442,8 @@ void tst_Dumpers::dumper_data()
"QApplication app(argc, argv);\n"
"QGraphicsScene sc;\n"
+ "QPolygon p0;\n"
+ "QPolygonF p1;\n"
"QPolygonF pol;\n"
"pol.append(QPointF(1, 2));\n"
"pol.append(QPointF(2, 2));\n"
@@ -7456,6 +7456,8 @@ void tst_Dumpers::dumper_data()
+ GuiProfile()
+ + Check("p0", "<0 items>", "@QPolygon")
+ + Check("p1", "<0 items>", "@QPolygonF")
+ Check("pol", "<5 items>", "@QPolygonF")
+ Check("p", "<5 items>", "@QGraphicsPolygonItem");
diff --git a/tests/manual/debugger/gui/mainwindow.cpp b/tests/manual/debugger/gui/mainwindow.cpp
index 723a0b67c98..f16a891b5f8 100644
--- a/tests/manual/debugger/gui/mainwindow.cpp
+++ b/tests/manual/debugger/gui/mainwindow.cpp
@@ -269,7 +269,7 @@ void MainWindow::on_actionDumperBP_triggered()
QStringList sl;
QString s = "hallo";
for (int c = 'a'; c < 'c'; c++) {
- s += c + 23;
+ s += char(c + 23);
stdS += c;
sl.push_back(s);
stdStringList.push_back(std::string(1, c));
diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp
index db3f531ac50..5d782d4190e 100644
--- a/tests/manual/debugger/simple/simple_test_app.cpp
+++ b/tests/manual/debugger/simple/simple_test_app.cpp
@@ -4017,12 +4017,14 @@ namespace qstring {
void testQStringRef()
{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QString str = "Hello";
QStringRef ref(&str, 1, 2);
BREAK_HERE;
// Check ref "el" QStringRef.
// Continue.
dummyStatement(&str, &ref);
+#endif
}
void testQString()
@@ -4067,10 +4069,7 @@ namespace formats {
{
const wchar_t *w = L"aöa";
QString u;
- if (sizeof(wchar_t) == 4)
- u = QString::fromUcs4((uint *)w);
- else
- u = QString::fromUtf16((ushort *)w);
+ u = QString::fromWCharArray(w);
BREAK_HERE;
// Check u "aöa" QString.
// CheckType w wchar_t *.
@@ -4270,12 +4269,9 @@ namespace qvariant {
void testQVariant1()
{
QVariant value;
- QVariant::Type t = QVariant::String;
- value = QVariant(t, (void*)0);
- *(QString*)value.data() = QString("Some string");
+ value = QVariant(QString("Some string"));
int i = 1;
BREAK_HERE;
- // Check t QVariant::String (10) QVariant::Type.
// Check value "Some string" QVariant (QString).
// Continue.
@@ -5360,10 +5356,7 @@ namespace basic {
// Windows: Select UTF-16 in "Change Format for Type" in L&W context menu.
// Other: Select UCS-6 in "Change Format for Type" in L&W context menu.
- if (sizeof(wchar_t) == 4)
- u = QString::fromUcs4((uint *)w);
- else
- u = QString::fromUtf16((ushort *)w);
+ u = QString::fromWCharArray(w);
// Make sure to undo "Change Format".
dummyStatement(s, w, &ww, &cw, &cc, &cs);
diff --git a/tests/manual/debugger/simple/simple_test_app.pro b/tests/manual/debugger/simple/simple_test_app.pro
index fa3be4deda9..af8e8895721 100644
--- a/tests/manual/debugger/simple/simple_test_app.pro
+++ b/tests/manual/debugger/simple/simple_test_app.pro
@@ -6,9 +6,13 @@ DESTDIR = .
SOURCES += simple_test_app.cpp
-QT += network xml
+QT += network
!isEmpty(QT.script.name): QT += script
+greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
+else: QT += xml
+
+
osx {
DEFINES += USE_CXX11
QMAKE_CXXFLAGS += -stdlib=libc++
diff --git a/tests/unit/unittest/compileroptionsbuilder-test.cpp b/tests/unit/unittest/compileroptionsbuilder-test.cpp
index ba12feb9065..5cc01800a4a 100644
--- a/tests/unit/unittest/compileroptionsbuilder-test.cpp
+++ b/tests/unit/unittest/compileroptionsbuilder-test.cpp
@@ -582,7 +582,8 @@ TEST_F(CompilerOptionsBuilder, AddDefineFunctionMacrosMsvc)
compilerOptionsBuilder.addDefineFunctionMacrosMsvc();
- ASSERT_THAT(compilerOptionsBuilder.options(), Contains(QString{"-D__FUNCTION__=\"\""}));
+ ASSERT_THAT(compilerOptionsBuilder.options(),
+ Contains(QString{"-D__FUNCTION__=\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\""}));
}
TEST_F(CompilerOptionsBuilder, AddProjectConfigFileInclude)
@@ -683,9 +684,9 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptionsCl)
"/std:c++17",
"-fms-compatibility-version=19.00",
"-DprojectFoo=projectBar",
- "-D__FUNCSIG__=\"\"",
- "-D__FUNCTION__=\"\"",
- "-D__FUNCDNAME__=\"\"",
+ "-D__FUNCSIG__=\"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\"",
+ "-D__FUNCTION__=\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\"",
+ "-D__FUNCDNAME__=\"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\"",
"-I", IsPartOfHeader("wrappedQtHeaders"),
"-I", IsPartOfHeader(toNative("wrappedQtHeaders/QtCore").toStdString()),
"-I", toNative("/tmp/path"),
@@ -723,9 +724,9 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptionsClWithExceptions)
"-fexceptions",
"-fms-compatibility-version=19.00",
"-DprojectFoo=projectBar",
- "-D__FUNCSIG__=\"\"",
- "-D__FUNCTION__=\"\"",
- "-D__FUNCDNAME__=\"\"",
+ "-D__FUNCSIG__=\"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\"",
+ "-D__FUNCTION__=\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\"",
+ "-D__FUNCDNAME__=\"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\"",
"-I", IsPartOfHeader("wrappedQtHeaders"),
"-I", IsPartOfHeader(toNative("wrappedQtHeaders/QtCore").toStdString()),
"-I", toNative("/tmp/path"),