diff --git a/doc/qtcreator/config/qtcreator-project.qdocconf b/doc/qtcreator/config/qtcreator-project.qdocconf index 75e09636d59..0200307c301 100644 --- a/doc/qtcreator/config/qtcreator-project.qdocconf +++ b/doc/qtcreator/config/qtcreator-project.qdocconf @@ -2,6 +2,15 @@ project = qtcreator description = "$IDE_DISPLAY_NAME Manual" url = http://doc.qt.io/$IDE_ID +#Words to ignore for auto-linking +ignorewords += \ + macOS \ + WebChannel \ + WebSocket \ + WebSockets \ + OpenGL \ + MinGW + headerdirs = sourcedirs = ../src \ ../../qtdesignstudio/src/qtquick3d-editor diff --git a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc index 65e3bd226e8..a214bd896c6 100644 --- a/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc +++ b/doc/qtcreator/src/debugger/creator-debugger-common.qdocinc @@ -145,6 +145,7 @@ \endlist + \if defined(qtcreator) \section2 Specifying Breakpoint Settings You can specify settings for breakpoints in \uicontrol Tools > @@ -177,6 +178,7 @@ For more information on breakpoints, see \l{http://sourceware.org/gdb/onlinedocs/gdb/Breakpoints.html#Breakpoints} {Breakpoints, Watchpoints, and Catchpoints} in GDB documentation. + \endif \section2 Moving Breakpoints diff --git a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc index 24660d3cee1..bfee108f3c4 100644 --- a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc @@ -107,8 +107,7 @@ that is not UTF-8 encoded: \uicontrol {Error: Could not decode "filename" with "UTF-8"-encoding. Editing not possible.} - To resolve the issue, use a file conversion tool such as - \l{http://recode.progiciels-bpi.ca/index.html}{Recode} to convert the file + To resolve the issue, use a file conversion tool to convert the file encoding to UTF-8 when developing Qt 5 applications. Otherwise, conversion of string constants to QStrings might not work as expected. diff --git a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc index 0782c8ff821..faf769614ba 100644 --- a/doc/qtcreator/src/overview/creator-acknowledgements.qdoc +++ b/doc/qtcreator/src/overview/creator-acknowledgements.qdoc @@ -107,10 +107,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \endcode - The source code of KSyntaxHighlighting can be found + The source code of KSyntaxHighlighting can be found here: \list - \li \l{https://cgit.kde.org/syntax-highlighting.git} + \li \l{https://invent.kde.org/frameworks/syntax-highlighting} \li QtCreator/src/libs/3rdparty/syntax-highlighting \li \l{https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/libs/3rdparty/syntax-highlighting} \endlist @@ -132,9 +132,9 @@ \li \b{LLVM/Clang} \list - \li \l{http://llvm.org/svn/llvm-project/llvm} - \li \l{http://llvm.org/svn/llvm-project/cfe/trunk} - \li \l{http://llvm.org/svn/llvm-project/clang-tools-extra/trunk} + \li \l{https://llvm.org/svn/llvm-project/llvm} + \li \l{https://llvm.org/svn/llvm-project/cfe/trunk} + \li \l{https://llvm.org/svn/llvm-project/clang-tools-extra/trunk} \endlist Copyright (C) 2003-2019 LLVM Team diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index 8ea2cbda706..168942dae50 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -504,10 +504,9 @@ can be selected. \endlist - You can also use the - \l {https://doc-snapshots.qt.io/qt5-5.13/qml-qtquick-dialogs-dialog.html} - {Dialog} type in the Qt Quick Dialogs module to wrap arbitrary content into - a dialog window including a row of platform-tailored buttons. + You can also use the \l Dialog type in the Qt Quick Dialogs module to wrap + arbitrary content into a dialog window including a row of platform-tailored + buttons. \include qtquick-animation-types.qdocinc qtquick animation types diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-export.qdoc b/doc/qtcreator/src/qtquick/qtquick-export.qdoc similarity index 97% rename from doc/qtcreator/src/qtquick/creator-only/qtquick-export.qdoc rename to doc/qtcreator/src/qtquick/qtquick-export.qdoc index db641f080fa..f3adc6b50ff 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-export.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-export.qdoc @@ -26,7 +26,11 @@ /*! \page creator-exporting-qml.html \previouspage quick-converting-ui-projects.html + \if defined(qtdesignstudio) + \nextpage quick-uis.html + \else \nextpage creator-using-qt-designer.html + \endif \title Exporting QML diff --git a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc index 31849550331..57bdaf64d31 100644 --- a/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-from-qmlproject-to-pro.qdoc @@ -27,11 +27,10 @@ \page quick-converting-ui-projects.html \if defined(qtdesignstudio) \previouspage studio-importing-3d.html - \nextpage quick-uis.html \else \previouspage creator-qml-modules-with-plugins.html - \nextpage creator-exporting-qml.html \endif + \nextpage creator-exporting-qml.html \title Converting UI Projects to Applications diff --git a/doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc b/doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc index 0bf837ee8cf..0b3cde02ea8 100644 --- a/doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-live-preview-devices.qdoc @@ -83,8 +83,8 @@ You can preview UIs on Boot2Qt devices that are supported by \l{Qt for Device Creation}. For a list of supported devices, see - \l{https://doc.qt.io/QtForDeviceCreation/qtee-supported-platforms.html#reference-target-devices} - {Reference Target Devices}. + \l{https://doc.qt.io/QtForDeviceCreation/qtdc-supported-platforms.html} + {Reference Target Devices and Development Hosts}. You must configure the device as instructed in the \l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html} @@ -94,6 +94,6 @@ host for Qt for Device Creation. This means that you cannot preview UIs on devices if you are using \QDS on \macos. For more information about supported development hosts, see - \l {https://doc.qt.io/QtForDeviceCreation/qtdc-supported-platforms.html} + \l {https://doc.qt.io/QtForDeviceCreation/qtdc-supported-platforms.html#supported-development-hosts} {Supported Development Hosts}. */ diff --git a/doc/qtcreator/src/qtquick/qtquick-uis.qdoc b/doc/qtcreator/src/qtquick/qtquick-uis.qdoc index 5a80438259c..3905fb06e68 100644 --- a/doc/qtcreator/src/qtquick/qtquick-uis.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-uis.qdoc @@ -26,7 +26,7 @@ /*! \page quick-uis.html \if defined(qtdesignstudio) - \previouspage quick-converting-ui-projects.html + \previouspage creator-exporting-qml.html \nextpage studio-app-flows.html \else \previouspage creator-using-qt-quick-designer.html diff --git a/doc/qtcreatordev/config/qtcreator-developer.qdocconf b/doc/qtcreatordev/config/qtcreator-developer.qdocconf index 6825b41f94e..b59835b8adb 100644 --- a/doc/qtcreatordev/config/qtcreator-developer.qdocconf +++ b/doc/qtcreatordev/config/qtcreator-developer.qdocconf @@ -3,6 +3,15 @@ description = "Extending Qt Creator Manual" language = Cpp +#Words to ignore for auto-linking +ignorewords += \ + macOS \ + WebChannel \ + WebSocket \ + WebSockets \ + OpenGL \ + MinGW + headerdirs = . \ ../src \ ../../../src/libs/aggregation \ diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index b8d7f0659e6..4793ed664a4 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -4,6 +4,15 @@ url = https://doc.qt.io/qtdesignstudio moduleheader = +#Words to ignore for auto-linking +ignorewords += \ + macOS \ + WebChannel \ + WebSocket \ + WebSockets \ + OpenGL \ + MinGW + headerdirs = sourcedirs = ../src \ ../examples/doc \ diff --git a/doc/qtdesignstudio/images/qt-bridge-import-warning.png b/doc/qtdesignstudio/images/qt-bridge-import-warning.png new file mode 100644 index 00000000000..8f037ca2630 Binary files /dev/null and b/doc/qtdesignstudio/images/qt-bridge-import-warning.png differ diff --git a/doc/qtdesignstudio/images/qt-bridge-import.png b/doc/qtdesignstudio/images/qt-bridge-import.png new file mode 100644 index 00000000000..f438beb3c2c Binary files /dev/null and b/doc/qtdesignstudio/images/qt-bridge-import.png differ diff --git a/doc/qtdesignstudio/images/qt-bridge-override.png b/doc/qtdesignstudio/images/qt-bridge-override.png index 79d536edb0e..86e045278b5 100644 Binary files a/doc/qtdesignstudio/images/qt-bridge-override.png and b/doc/qtdesignstudio/images/qt-bridge-override.png differ diff --git a/doc/qtdesignstudio/images/qt-bridge-sanitize.png b/doc/qtdesignstudio/images/qt-bridge-sanitize.png index a52ec745325..474472e7855 100644 Binary files a/doc/qtdesignstudio/images/qt-bridge-sanitize.png and b/doc/qtdesignstudio/images/qt-bridge-sanitize.png differ diff --git a/doc/qtdesignstudio/images/qt-bridge-settings.png b/doc/qtdesignstudio/images/qt-bridge-settings.png index 1ac1a9940e0..601378fd2cc 100644 Binary files a/doc/qtdesignstudio/images/qt-bridge-settings.png and b/doc/qtdesignstudio/images/qt-bridge-settings.png differ diff --git a/doc/qtdesignstudio/images/qt-bridge.png b/doc/qtdesignstudio/images/qt-bridge.png index 5eb3dd39dd9..0c774bf96e6 100644 Binary files a/doc/qtdesignstudio/images/qt-bridge.png and b/doc/qtdesignstudio/images/qt-bridge.png differ diff --git a/doc/qtdesignstudio/images/studio-ps-export.png b/doc/qtdesignstudio/images/studio-ps-export.png index a28cc68bb02..2072b5f1f9a 100644 Binary files a/doc/qtdesignstudio/images/studio-ps-export.png and b/doc/qtdesignstudio/images/studio-ps-export.png differ diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc index a2cde853b15..a87e0efe71e 100644 --- a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc +++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-setup.qdoc @@ -111,9 +111,10 @@ \image qt-bridge-settings.png \li In the \uicontrol Password field, enter the password you entered in Adobe Photoshop and select \uicontrol {Connect}. - \li In the \uicontrol {Export Path} group, select the browse button - (\uicontrol {...}) to specify the location where \QBPS copies the - exported files. + \li In the \uicontrol {Export Path} group, select the folder button + to specify the location where \QBPS copies the exported files. + \li In the \uicontrol {Asset format & scale} group, select the default + asset format (JPG, PNG, or SVG) and DPI to use for each layer. \endlist Once the connection is successfully created, \QBPS is ready to use. diff --git a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc index ff12226ab42..ddee99ba2f5 100644 --- a/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc +++ b/doc/qtdesignstudio/src/qtbridge/qtbridge-ps-using.qdoc @@ -58,7 +58,7 @@ When you use \QBPS to export your designs, you will determine how you want each group or layer exported: as a \e component or \e child. A component will be imported as a single QML file that can contain other assets. A child - will be imported as a single PNG file that you can use within QML files. + will be imported as a single image file that you can use within QML files. If you plan to use pieces of your artwork as separate images in the UI, group them on an artboard as separate layers. You can then export the group @@ -107,6 +107,8 @@ \li Second level group layers are merged to their parent. \li Asset layers are exported as merged. \li Text layers are always exported as child items. + \li Images are exported in JPG, PNG, or SVG format, depending on your + selection. \endlist \QBPS automatically proposes identifiers (QML ids) for all groups and layers. @@ -251,4 +253,44 @@ \li \l{https://www.youtube.com/watch?v=ZzbucmQPU44} {From Photoshop to Prototype with Qt Design Studio} \endlist + + \section1 Importing Metadata & Assets + + \QBPS can import metadata generated from other tools and generate a Photoshop document. A + conventional workflow would be to generate metadata and assets by \l {Exporting QML} {exporting} + a QML project from \QDS and use \QBPS to generate a Photoshop document. + + Imported text and the assets are organized into Artboards, layers, and groups. + + Select the \uicontrol Import button to launch the \uicontrol Import panel. Alternatively, \QB + import can be launched from \uicontrol Window > \uicontrol Extensions. + + \image qt-bridge-import.png + + Create a new PSD document and launch the \uicontrol Import dialog. Open the metadata file to + import and select \uicontrol Import. + + \note The import process removes all the existing layers in the selected PSD document. + + \image qt-bridge-import-warning.png + + The following guidelines are followed to generate the Photoshop document: + \list + \li An Artboard is created for each QML component exported and defined in the metadata file. + \li An image layer is created for an item with an asset. + \li A solid fill layer is created for an item without an asset. + \li A paragraph text layer is created for Text items. + \endlist + + All QML metadata specified in the metadata file is assigned to the generated layers. + + An important concept of \e {Virtual parent} is applied to translate the QML DOM to Photoshop + DOM. A QML \l Item can have children but a layer in a Photoshop document cannot have child + layers. To mitigate this variance, a Group layer is created and child items are added to this + Group layer. The Group layer acts as a virtual parent and the correct parent is assigned when + the Photoshop document is exported and re-imported in \QDS. + + \note The parent-child relationship may be lost if the virtual parent Group layer is moved or + deleted. + */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-importing-2d.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-importing-2d.qdoc index f5515805057..4b6f475c023 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-importing-2d.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-importing-2d.qdoc @@ -30,15 +30,13 @@ \title Importing 2D Assets - You can download \QB from the \l{https://marketplace.qt.io/}{Qt Marketplace}. - \image studio-imported-assets.png "Artwork imported into Qt Design Studio" \QB enables you to export assets and then import them to a \QDS project as image and QML files for editing in the \uicontrol {Form Editor}. If you make changes to your design in the design tool, you can merge the changes into existing QML files without overwriting the changes you have made in - \QDS. + \QDS. For more information, see \l {Exporting Artwork from Design Tools}. \note Attempting to import assets exported on another system might fail. @@ -86,11 +84,13 @@ The imported assets are displayed in the \uicontrol Assets tab in the \uicontrol Library as PNG images. The components that you specified in the design tool are displayed in the \uicontrol {My QML Components} tab, - as well as in the \uicontrol Projects view as separate QML files. + as well as in the \uicontrol Projects view as separate QML files. To + start using them, drag and drop them from \uicontrol Library to + \uicontrol {Form Editor} or \uicontrol Navigator. \note The layer that was the bottom layer in the design tool becames the top - layer in the \uicontrol Navigator to reflect the QML code model. You - can view the QML code in the \uicontrol {Text Editor}. + layer in \uicontrol Navigator to reflect the QML code model. You + can view the QML code in \uicontrol {Text Editor}. If asset importer conflicts, warnings, and errors are displayed in the \uicontrol {Asset Import} dialog while importing, fix the issues in @@ -98,13 +98,17 @@ \section1 \QB Videos - For more information about importing assets from Adobe Photoshop, watch a - video tutorial and webinar about using \QB: + For more information, see the \QB tutorials that are also accessible from + the \uicontrol Tutorials tab of the Welcome mode: \list \li \l{https://resources.qt.io/development-topic-ui-design/qtdesignstudio-clustertutorial-partone} - {Building an Instrument Cluster for Your Car HMI, Part 1} + {Building an Instrument Cluster for Your Car HMI, Part 1} (\QBPS) \li \l{https://www.youtube.com/watch?v=ZzbucmQPU44} {From Photoshop to Prototype with Qt Design Studio} + \li \l{https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-1} + {Sketch Bridge Tutorial Part 1} + \li \l{https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-2} + {Sketch Bridge Tutorial Part 2} \endlist */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-importing-designs.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-importing-designs.qdoc index e681f694278..c8429eb3ca7 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-importing-designs.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-importing-designs.qdoc @@ -34,8 +34,6 @@ exporting the 2D assets from design tools, whereas you can directly import 3D assets saved in widely-used 3D graphics formats. - You can download \QB from the \l{https://marketplace.qt.io/}{Qt Marketplace}. - \list \li \l{Importing 2D Assets} diff --git a/doc/qtdesignstudio/src/qtdesignstudio-projects-overview.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-projects-overview.qdoc index 036879ad636..707fec1ce45 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-projects-overview.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-projects-overview.qdoc @@ -67,5 +67,11 @@ to Qt Quick Application projects that contain .pro, .cpp, and .qrc files. + \li \l {Exporting QML} + + You can export UI forms (ui.qml files) to JSON metadata format + and PNG assets to generate native file formats in content creation + tools, such as Adobe Photoshop, using \QB. + \endlist */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 6a32c95123e..a758f444d46 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -68,6 +68,7 @@ \li \l{Importing 3D Assets} \endlist \li \l{Converting UI Projects to Applications} + \li \l{Exporting QML} \endlist \li \l{Creating UIs} \list diff --git a/doc/qtdesignstudio/src/qtdesignstudio.qdoc b/doc/qtdesignstudio/src/qtdesignstudio.qdoc index 4ad8ecb22f0..ae9dda9f966 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio.qdoc @@ -54,6 +54,7 @@ \li \l{Using Git} \li \l{Importing Designs} \li \l{Converting UI Projects to Applications} + \li \l{Exporting QML} \endlist \li \b {\l{Creating UIs}} \list diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc index 7d98babad7f..dd10c8528fc 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-custom-effects-materials.qdoc @@ -160,15 +160,21 @@ for its properties in \uicontrol Properties. \image studio-qtquick-3d-pass.png "Pass properties" \li To execute commands during the pass, drag and drop the following - command types from \uicontrol Library to the custom material in + command types from \uicontrol Library to the pass component in \uicontrol Navigator: \uicontrol Blending, \uicontrol {Buffer Blit}, \uicontrol {Buffer Input}, \uicontrol {Cull Mode}, \uicontrol {Depth Input}, \uicontrol {Render State}, and - \uicontrol {Set Uniform Value}. Then select the commands in the - \uicontrol Commands field. + \uicontrol {Set Uniform Value}. The command components are created + at the same level as the pass component and automatically added to + the \uicontrol Commands field. \li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer type to the custom material. Then select the buffer in the \uicontrol Buffer field. + \li To add a shader to the pass, drag and drop the \uicontrol Shader + type from the \uicontrol Library to the pass component in \uicontrol + Navigator. The shader components are created at the same + level as the pass component and automatically added to the + \uicontrol Shaders field. \li Select the shader components in \uicontrol Navigator to set the paths to the shader files in the \uicontrol Source field in \uicontrol Properties. diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-texture.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-texture.qdoc index 8354f8943aa..5f64768056d 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-texture.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-texture.qdoc @@ -113,11 +113,11 @@ \section1 Applying Textures to Materials Drag and drop an image from \uicontrol Library > \uicontrol Assets - on a material to create and set the texture automatically, or use - a Texture component. For a default material the created \uicontrol Texture - is assigned to the \uicontrol {Diffuse Map} property and for a principled - material to the \uicontrol {Base Color Map}. For a custom material, you - must assign the texture to a map. + on a material to create a texture component. Dragging an image + to a default or principled material opens a + \uicontrol {Select Texture Property} dialog. You can select the + property to attach the texture to in the \uicontrol {Set texture to property} + field. For a custom material, you must assign the texture to a map. To use Texture components to apply textures to materials: diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index c81bca1dd50..824f4c50f75 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -1303,6 +1303,7 @@ class Dumper(DumperBase): gdb.execute('continue') def fetchStack(self, args): + def fromNativePath(string): return string.replace('\\', '/') @@ -1319,7 +1320,11 @@ class Dumper(DumperBase): frame = gdb.newest_frame() ns = self.qtNamespace() needle = self.qtNamespace() + 'QV4::ExecutionEngine' - pat = '%sqt_v4StackTraceForEngine((void*)0x%x)' + pats = [ + '{0}qt_v4StackTraceForEngine((void*)0x{1:x})', + '{0}qt_v4StackTrace((({0}QV4::ExecutionEngine *)0x{1:x})->currentContext())', + '{0}qt_v4StackTrace((({0}QV4::ExecutionEngine *)0x{1:x})->currentContext)', + ] done = False while i < limit and frame and not done: block = None @@ -1336,8 +1341,19 @@ class Dumper(DumperBase): dereftype = typeobj.target().unqualified() if dereftype.name == needle: addr = toInteger(value) - expr = pat % (ns, addr) - res = str(gdb.parse_and_eval(expr)) + res = None + for pat in pats: + try: + expr = pat.format(ns, addr) + res = str(gdb.parse_and_eval(expr)) + break + except: + continue + + if res is None: + done = True + break + pos = res.find('"stack=[') if pos != -1: res = res[pos + 8:-2] diff --git a/share/qtcreator/qml/qmlpuppet/commands/commands.pri b/share/qtcreator/qml/qmlpuppet/commands/commands.pri index f343cbbd47a..680abb2744f 100644 --- a/share/qtcreator/qml/qmlpuppet/commands/commands.pri +++ b/share/qtcreator/qml/qmlpuppet/commands/commands.pri @@ -6,6 +6,7 @@ HEADERS += $$PWD/synchronizecommand.h \ \ $$PWD/changelanguagecommand.h \ $$PWD//debugoutputcommand.h \ $$PWD/endpuppetcommand.h \ + $$PWD/scenecreatedcommand.h \ $$PWD/tokencommand.h \ $$PWD/componentcompletedcommand.h \ $$PWD/completecomponentcommand.h \ diff --git a/share/qtcreator/qml/qmlpuppet/commands/scenecreatedcommand.h b/share/qtcreator/qml/qmlpuppet/commands/scenecreatedcommand.h new file mode 100644 index 00000000000..c854821b839 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/commands/scenecreatedcommand.h @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#pragma once + +#include + +namespace QmlDesigner { + +class SceneCreatedCommand +{ +public: + friend QDataStream &operator<<(QDataStream &out, const SceneCreatedCommand &) { return out; } + + friend QDataStream &operator>>(QDataStream &in, SceneCreatedCommand &) { return in; } +}; + +} // namespace QmlDesigner + +Q_DECLARE_METATYPE(QmlDesigner::SceneCreatedCommand) diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp index 0138fcc9d85..0c0f4fec781 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp @@ -68,6 +68,7 @@ #include "removepropertiescommand.h" #include "removesharedmemorycommand.h" #include "reparentinstancescommand.h" +#include "scenecreatedcommand.h" #include "statepreviewimagechangedcommand.h" #include "synchronizecommand.h" #include "tokencommand.h" @@ -275,6 +276,11 @@ void NodeInstanceClientProxy::capturedData(const CapturedDataCommand &command) writeCommand(QVariant::fromValue(command)); } +void NodeInstanceClientProxy::sceneCreated(const SceneCreatedCommand &command) +{ + writeCommand(QVariant::fromValue(command)); +} + void NodeInstanceClientProxy::flush() { } diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h index c034435be8c..11658c5dd58 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h @@ -87,6 +87,7 @@ public: void selectionChanged(const ChangeSelectionCommand &command) override; void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override; void capturedData(const CapturedDataCommand &capturedData) override; + void sceneCreated(const SceneCreatedCommand &command) override; void flush() override; void synchronizeWithClientProcess() override; diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h index d60e0d7ff0c..e3b9121c82a 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceclientinterface.h @@ -43,6 +43,7 @@ class PuppetAliveCommand; class ChangeSelectionCommand; class PuppetToCreatorCommand; class CapturedDataCommand; +class SceneCreatedCommand; class NodeInstanceClientInterface { @@ -59,6 +60,7 @@ public: virtual void selectionChanged(const ChangeSelectionCommand &command) = 0; virtual void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) = 0; virtual void capturedData(const CapturedDataCommand &command) = 0; + virtual void sceneCreated(const SceneCreatedCommand &command) = 0; virtual void flush() {} virtual void synchronizeWithClientProcess() {} diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp index e3a05376e27..638308af110 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp +++ b/share/qtcreator/qml/qmlpuppet/interfaces/nodeinstanceserverinterface.cpp @@ -60,6 +60,7 @@ #include "removepropertiescommand.h" #include "removesharedmemorycommand.h" #include "reparentinstancescommand.h" +#include "scenecreatedcommand.h" #include "statepreviewimagechangedcommand.h" #include "synchronizecommand.h" #include "tokencommand.h" @@ -223,6 +224,9 @@ void NodeInstanceServerInterface::registerCommands() qRegisterMetaType("CapturedDataCommand"); qRegisterMetaTypeStreamOperators("CapturedDataCommand"); + + qRegisterMetaType("SceneCreatedCommand"); + qRegisterMetaTypeStreamOperators("SceneCreatedCommand"); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.cpp new file mode 100644 index 00000000000..e03dcd3d34b --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.cpp @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#include "capturenodeinstanceserverdispatcher.h" + +#include "nodeinstanceclientinterface.h" +#include "qt5capturepreviewnodeinstanceserver.h" +#include "qt5informationnodeinstanceserver.h" +#include "qt5rendernodeinstanceserver.h" +#include "scenecreatedcommand.h" + +namespace QmlDesigner { + +void CaptureNodeInstanceServerDispatcher::createScene(const CreateSceneCommand &command) +{ + NodeInstanceServerDispatcher::createScene(command); + + QTimer::singleShot(100, + this, + &CaptureNodeInstanceServerDispatcher::collectItemChangesAndSendChangeCommands); +} + +void CaptureNodeInstanceServerDispatcher::collectItemChangesAndSendChangeCommands() +{ + for (std::unique_ptr &server : m_servers) + server->collectItemChangesAndSendChangeCommands(); + + m_nodeInstanceClient->sceneCreated({}); +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.h new file mode 100644 index 00000000000..8544ea1a1c6 --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/capturenodeinstanceserverdispatcher.h @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#pragma once + +#include "nodeinstanceserverdispatcher.h" + +namespace QmlDesigner { + +class CaptureNodeInstanceServerDispatcher : public NodeInstanceServerDispatcher +{ +public: + CaptureNodeInstanceServerDispatcher(const QStringList &serverNames, + NodeInstanceClientInterface *nodeInstanceClient) + : NodeInstanceServerDispatcher{serverNames, nodeInstanceClient} + , m_nodeInstanceClient{nodeInstanceClient} + {} + + void createScene(const CreateSceneCommand &command); + +private: + void collectItemChangesAndSendChangeCommands(); + +private: + NodeInstanceClientInterface *m_nodeInstanceClient; +}; + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri index b57e3aab8f4..85de00c5ff2 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/instances.pri @@ -6,7 +6,10 @@ versionAtLeast(QT_VERSION, 5.15.0):qtHaveModule(quick3d) { } HEADERS += $$PWD/qt5nodeinstanceserver.h \ - $$PWD/qt5capturenodeinstanceserver.h \ + $$PWD/capturenodeinstanceserverdispatcher.h \ + $$PWD/capturescenecreatedcommand.h \ + $$PWD/nodeinstanceserverdispatcher.h \ + $$PWD/qt5capturepreviewnodeinstanceserver.h \ $$PWD/qt5testnodeinstanceserver.h \ $$PWD/qt5informationnodeinstanceserver.h \ $$PWD/qt5rendernodeinstanceserver.h \ @@ -33,7 +36,9 @@ HEADERS += $$PWD/qt5nodeinstanceserver.h \ $$PWD/quick3dtexturenodeinstance.h SOURCES += $$PWD/qt5nodeinstanceserver.cpp \ - $$PWD/qt5capturenodeinstanceserver.cpp \ + $$PWD/capturenodeinstanceserverdispatcher.cpp \ + $$PWD/nodeinstanceserverdispatcher.cpp \ + $$PWD/qt5capturepreviewnodeinstanceserver.cpp \ $$PWD/qt5testnodeinstanceserver.cpp \ $$PWD/qt5informationnodeinstanceserver.cpp \ $$PWD/qt5rendernodeinstanceserver.cpp \ diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index 570f21a81fe..6bbaebe0864 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -260,7 +260,7 @@ void NodeInstanceServer::setRenderTimerInterval(int timerInterval) void NodeInstanceServer::setSlowRenderTimerInterval(int timerInterval) { - m_slowRenderTimerInterval = timerInterval; + m_timerModeInterval = timerInterval; } void NodeInstanceServer::setTimerId(int timerId) @@ -280,29 +280,31 @@ int NodeInstanceServer::renderTimerInterval() const void NodeInstanceServer::startRenderTimer() { - if (m_slowRenderTimer) + if (m_timerMode == TimerMode::SlowTimer) stopRenderTimer(); + if (m_timerMode == TimerMode::DisableTimer) + return; + if (m_timer == 0) m_timer = startTimer(m_renderTimerInterval); - m_slowRenderTimer = false; + m_timerMode = TimerMode::NormalTimer; } void NodeInstanceServer::slowDownRenderTimer() { - if (!m_slowRenderTimer) - stopRenderTimer(); - if (m_timer != 0) { killTimer(m_timer); m_timer = 0; } - if (m_timer == 0) - m_timer = startTimer(m_slowRenderTimerInterval); + if (m_timerMode == TimerMode::DisableTimer) + return; - m_slowRenderTimer = true; + m_timer = startTimer(m_timerModeInterval); + + m_timerMode = TimerMode::SlowTimer; } void NodeInstanceServer::stopRenderTimer() @@ -1448,4 +1450,9 @@ void NodeInstanceServer::handleExtraRender() } } +void NodeInstanceServer::disableTimer() +{ + m_timerMode = TimerMode::DisableTimer; +} + } // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h index 140e216049c..0c5810b3ec6 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.h @@ -114,6 +114,8 @@ namespace Internal { class ChildrenChangeEventFilter; } +enum class TimerMode { DisableTimer, NormalTimer, SlowTimer }; + class NodeInstanceServer : public NodeInstanceServerInterface { Q_OBJECT @@ -128,7 +130,6 @@ public: QVariant propertyValue; }; - explicit NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); void createInstances(const CreateInstancesCommand &command) override; @@ -171,7 +172,9 @@ public: QFileSystemWatcher *dummydataFileSystemWatcher(); Internal::ChildrenChangeEventFilter *childrenChangeEventFilter() const; void addFilePropertyToFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path); - void removeFilePropertyFromFileSystemWatcher(QObject *object, const PropertyName &propertyName, const QString &path); + void removeFilePropertyFromFileSystemWatcher(QObject *object, + const PropertyName &propertyName, + const QString &path); QUrl fileUrl() const; @@ -190,7 +193,9 @@ public: virtual QQuickView *quickView() const = 0; void sendDebugOutput(DebugOutputCommand::Type type, const QString &message, qint32 instanceId = 0); - void sendDebugOutput(DebugOutputCommand::Type type, const QString &message, const QVector &instanceIds); + void sendDebugOutput(DebugOutputCommand::Type type, + const QString &message, + const QVector &instanceIds); void removeInstanceRelationsipForDeletedObject(QObject *object); @@ -198,6 +203,10 @@ public: void decrementNeedsExtraRender(); void handleExtraRender(); + void disableTimer(); + + virtual void collectItemChangesAndSendChangeCommands() = 0; + public slots: void refreshLocalFileProperty(const QString &path); void refreshDummyData(const QString &path); @@ -221,7 +230,6 @@ protected: void timerEvent(QTimerEvent *) override; - virtual void collectItemChangesAndSendChangeCommands() = 0; ValuesChangedCommand createValuesChangedCommand(const QList &instanceList) const; ValuesChangedCommand createValuesChangedCommand(const QVector &propertyList) const; @@ -290,8 +298,8 @@ private: NodeInstanceClientInterface *m_nodeInstanceClient; int m_timer = 0; int m_renderTimerInterval = 16; - bool m_slowRenderTimer = false; - int m_slowRenderTimerInterval = 200; + TimerMode m_timerMode = TimerMode::NormalTimer; + int m_timerModeInterval = 200; QVector m_changedPropertyList; QByteArray m_importCode; QPointer m_dummyContextObject; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.cpp new file mode 100644 index 00000000000..a06a156e15e --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.cpp @@ -0,0 +1,202 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#include "nodeinstanceserverdispatcher.h" + +#include "qt5capturepreviewnodeinstanceserver.h" +#include "qt5informationnodeinstanceserver.h" +#include "qt5rendernodeinstanceserver.h" + +namespace QmlDesigner { + +NodeInstanceServerDispatcher::NodeInstanceServerDispatcher(const QStringList &serverNames, + NodeInstanceClientInterface *nodeInstanceClient) +{ + for (const QString &serverName : serverNames) + addServer(serverName, nodeInstanceClient); +} + +void NodeInstanceServerDispatcher::createInstances(const CreateInstancesCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->createInstances(command); +} + +void NodeInstanceServerDispatcher::changeFileUrl(const ChangeFileUrlCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeFileUrl(command); +} + +void NodeInstanceServerDispatcher::createScene(const CreateSceneCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->createScene(command); +} + +void NodeInstanceServerDispatcher::clearScene(const ClearSceneCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->clearScene(command); +} + +void NodeInstanceServerDispatcher::update3DViewState(const Update3dViewStateCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->update3DViewState(command); +} + +void NodeInstanceServerDispatcher::removeInstances(const RemoveInstancesCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->removeInstances(command); +} + +void NodeInstanceServerDispatcher::removeProperties(const RemovePropertiesCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->removeProperties(command); +} + +void NodeInstanceServerDispatcher::changePropertyBindings(const ChangeBindingsCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changePropertyBindings(command); +} + +void NodeInstanceServerDispatcher::changePropertyValues(const ChangeValuesCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changePropertyValues(command); +} + +void NodeInstanceServerDispatcher::changeAuxiliaryValues(const ChangeAuxiliaryCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeAuxiliaryValues(command); +} + +void NodeInstanceServerDispatcher::reparentInstances(const ReparentInstancesCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->reparentInstances(command); +} + +void NodeInstanceServerDispatcher::changeIds(const ChangeIdsCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeIds(command); +} + +void NodeInstanceServerDispatcher::changeState(const ChangeStateCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeState(command); +} + +void NodeInstanceServerDispatcher::completeComponent(const CompleteComponentCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->completeComponent(command); +} + +void NodeInstanceServerDispatcher::changeNodeSource(const ChangeNodeSourceCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeNodeSource(command); +} + +void NodeInstanceServerDispatcher::token(const TokenCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->token(command); +} + +void NodeInstanceServerDispatcher::removeSharedMemory(const RemoveSharedMemoryCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->removeSharedMemory(command); +} + +void NodeInstanceServerDispatcher::changeSelection(const ChangeSelectionCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeSelection(command); +} + +void NodeInstanceServerDispatcher::inputEvent(const InputEventCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->inputEvent(command); +} + +void NodeInstanceServerDispatcher::view3DAction(const View3DActionCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->view3DAction(command); +} + +void NodeInstanceServerDispatcher::changeLanguage(const ChangeLanguageCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changeLanguage(command); +} + +void NodeInstanceServerDispatcher::changePreviewImageSize(const ChangePreviewImageSizeCommand &command) +{ + for (std::unique_ptr &server : m_servers) + server->changePreviewImageSize(command); +} + +namespace { + +std::unique_ptr createNodeInstanceServer( + const QString &serverName, NodeInstanceClientInterface *nodeInstanceClient) +{ + if (serverName == "capturemode") + return std::make_unique(nodeInstanceClient); + else if (serverName == "rendermode") + return std::make_unique(nodeInstanceClient); + else if (serverName == "editormode") + return std::make_unique(nodeInstanceClient); + else if (serverName == "previewmode") + return std::make_unique(nodeInstanceClient); + + return {}; +} + +} // namespace + +void NodeInstanceServerDispatcher::addServer(const QString &serverName, + NodeInstanceClientInterface *nodeInstanceClient) +{ + auto server = createNodeInstanceServer(serverName, nodeInstanceClient); + + server->disableTimer(); + + m_servers.push_back(std::move(server)); +} + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.h new file mode 100644 index 00000000000..c09c629573a --- /dev/null +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserverdispatcher.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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. +** +****************************************************************************/ + +#pragma once + +#include + +#include +#include + +namespace QmlDesigner { + +class NodeInstanceServerDispatcher : public NodeInstanceServerInterface +{ +public: + NodeInstanceServerDispatcher(const QStringList &serverNames, + NodeInstanceClientInterface *nodeInstanceClient); + + void createInstances(const CreateInstancesCommand &command); + void changeFileUrl(const ChangeFileUrlCommand &command); + void createScene(const CreateSceneCommand &command); + void clearScene(const ClearSceneCommand &command); + void update3DViewState(const Update3dViewStateCommand &command); + void removeInstances(const RemoveInstancesCommand &command); + void removeProperties(const RemovePropertiesCommand &command); + void changePropertyBindings(const ChangeBindingsCommand &command); + void changePropertyValues(const ChangeValuesCommand &command); + void changeAuxiliaryValues(const ChangeAuxiliaryCommand &command); + void reparentInstances(const ReparentInstancesCommand &command); + void changeIds(const ChangeIdsCommand &command); + void changeState(const ChangeStateCommand &command); + void completeComponent(const CompleteComponentCommand &command); + void changeNodeSource(const ChangeNodeSourceCommand &command); + void token(const TokenCommand &command); + void removeSharedMemory(const RemoveSharedMemoryCommand &command); + void changeSelection(const ChangeSelectionCommand &command); + void inputEvent(const InputEventCommand &command); + void view3DAction(const View3DActionCommand &command); + void changeLanguage(const ChangeLanguageCommand &command); + void changePreviewImageSize(const ChangePreviewImageSizeCommand &command); + +private: + void addServer(const QString &serverName, NodeInstanceClientInterface *nodeInstanceClient); + +protected: + std::vector> m_servers; +}; + +} // namespace QmlDesigner diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp similarity index 96% rename from share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.cpp rename to share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp index f1e2a3a4758..46461581f83 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp @@ -23,7 +23,7 @@ ** ****************************************************************************/ -#include "qt5capturenodeinstanceserver.h" +#include "qt5capturepreviewnodeinstanceserver.h" #include "servernodeinstance.h" #include @@ -75,7 +75,7 @@ CapturedDataCommand::StateData collectStateData(ServerNodeInstance rootNodeInsta } } // namespace -void Qt5CaptureNodeInstanceServer::collectItemChangesAndSendChangeCommands() +void Qt5CapturePreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands() { static bool inFunction = false; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.h similarity index 89% rename from share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.h rename to share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.h index cd0208e5633..8118728973d 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturenodeinstanceserver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.h @@ -29,10 +29,10 @@ namespace QmlDesigner { -class Qt5CaptureNodeInstanceServer : public Qt5PreviewNodeInstanceServer +class Qt5CapturePreviewNodeInstanceServer : public Qt5PreviewNodeInstanceServer { public: - explicit Qt5CaptureNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient) + explicit Qt5CapturePreviewNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient) : Qt5PreviewNodeInstanceServer(nodeInstanceClient) {} diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp index 1cdfc910742..defbf5614a3 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5nodeinstanceclientproxy.cpp @@ -27,7 +27,8 @@ #include -#include "qt5capturenodeinstanceserver.h" +#include "capturenodeinstanceserverdispatcher.h" +#include "qt5capturepreviewnodeinstanceserver.h" #include "qt5informationnodeinstanceserver.h" #include "qt5previewnodeinstanceserver.h" #include "qt5rendernodeinstanceserver.h" @@ -62,6 +63,10 @@ Qt5NodeInstanceClientProxy::Qt5NodeInstanceClientProxy(QObject *parent) : initializeCapturedStream(QCoreApplication::arguments().at(2)); readDataStream(); QCoreApplication::exit(); + } else if (QCoreApplication::arguments().at(2).contains(',')) { + const QStringList serverNames = QCoreApplication::arguments().at(2).split(','); + setNodeInstanceServer(std::make_unique(serverNames, this)); + initializeSocket(); } else if (QCoreApplication::arguments().at(2) == QLatin1String("previewmode")) { setNodeInstanceServer(std::make_unique(this)); initializeSocket(); @@ -72,7 +77,7 @@ Qt5NodeInstanceClientProxy::Qt5NodeInstanceClientProxy(QObject *parent) : setNodeInstanceServer(std::make_unique(this)); initializeSocket(); } else if (QCoreApplication::arguments().at(2) == QLatin1String("capturemode")) { - setNodeInstanceServer(std::make_unique(this)); + setNodeInstanceServer(std::make_unique(this)); initializeSocket(); } } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h index ea27429c66f..975d0e8c378 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h @@ -72,7 +72,7 @@ class ServerNodeInstance friend class Qt5InformationNodeInstanceServer; friend class Qt5NodeInstanceServer; friend class Qt5PreviewNodeInstanceServer; - friend class Qt5CaptureNodeInstanceServer; + friend class Qt5CapturePreviewNodeInstanceServer; friend class Qt5TestNodeInstanceServer; friend class QHash; friend uint qHash(const ServerNodeInstance &instance); diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml index 72a713c2820..edeeaf9fd2d 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/RealSpinBoxInput.qml @@ -128,6 +128,11 @@ TextInput { } } + // Ensure that we get Up and Down key press events first + Keys.onShortcutOverride: { + event.accepted = (event.key === Qt.Key_Up || event.key === Qt.Key_Down) + } + TapHandler { id: tapHandler acceptedDevices: PointerDevice.Mouse diff --git a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp index e9bdd5af927..f4dcde9736c 100644 --- a/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp +++ b/src/libs/qtcreatorcdbext/qtcreatorcdbextension.cpp @@ -1248,13 +1248,84 @@ extern "C" HRESULT CALLBACK qmlstack(CIDebugClient *client, PCSTR argsIn) } // call function to get stack trace. Call with exceptions handled right from // the start assuming this is invoked for crashed applications. - std::ostringstream callStr; - const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols())); - callStr << qtInfo.prependQtModule("qt_v4StackTraceForEngine(", QtInfo::Qml) << std::showbase << std::hex - << jsExecutionEngine << std::dec << std::noshowbase << ')'; + // multiple function calls are needed, depending on the used Qt version + // We always start from the latest Qt version + std::ostringstream stringBuilder; std::wstring wOutput; - if (!ExtensionContext::instance().call(callStr.str(), ExtensionContext::CallWithExceptionsHandled, &wOutput, &errorMessage)) + const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols())); + do { + stringBuilder << qtInfo.prependQtModule("qt_v4StackTraceForEngine(", QtInfo::Qml) << std::showbase << std::hex + << jsExecutionEngine << std::dec << std::noshowbase << ')'; + if (ExtensionContext::instance().call(stringBuilder.str(), ExtensionContext::CallWithExceptionsHandled, &wOutput, &errorMessage)) + break; + + // < Qt 5.15 + // We need to retrieve the current Context first + std::string currentContextStr; + + // First try calling the currentContext() function + std::wstring callResult; + + stringBuilder.str(""); + stringBuilder << qtInfo.prependQtModule("QV4::ExecutionEngine::currentContext(", QtInfo::Qml) << std::showbase << std::hex + << jsExecutionEngine << std::dec << std::noshowbase << ")"; + if (ExtensionContext::instance().call(stringBuilder.str(), ExtensionContext::CallWithExceptionsHandled, &callResult, &errorMessage)) { + const std::string::size_type sPos = callResult.find(L"struct QV4::ExecutionContext * ") + 31 /*size of pattern*/; + const std::string::size_type sEndPos = callResult.find(L'+'); + + if (sPos == std::string::npos || sEndPos == std::string::npos || sEndPos < sPos) { + errorMessage = "Couldn't parse address from debugger output"; + break; + } + currentContextStr = wStringToString(callResult.substr(sPos, sEndPos - sPos)); + } else { + // < Qt 5.11 ???? + // currentContext is a member, not a function + + stringBuilder.str(""); + stringBuilder << "((QV4::ExecutionEngine*)" << std::showbase << std::hex + << jsExecutionEngine << std::dec << std::noshowbase << ")->currentContext"; + + CIDebugControl *control = ExtensionCommandContext::instance()->control(); + ULONG oldExpressionSyntax; + control->GetExpressionSyntax(&oldExpressionSyntax); + control->SetExpressionSyntax(DEBUG_EXPR_CPLUSPLUS); + + IDebugSymbolGroup2 *symbolGroup = nullptr; + CIDebugSymbols *symbols = ExtensionCommandContext::instance()->symbols(); + if (FAILED(symbols->GetScopeSymbolGroup2(DEBUG_SCOPE_GROUP_ALL, NULL, + &symbolGroup))) + break; + + ULONG index = DEBUG_ANY_ID; + HRESULT hr = symbolGroup->AddSymbol(stringBuilder.str().c_str(), &index); + control->SetExpressionSyntax(oldExpressionSyntax); + if (SUCCEEDED(hr)) { + ULONG64 address = 0; + HRESULT hr = symbolGroup->GetSymbolOffset(index, &address); + if (SUCCEEDED(hr)) { + ExtensionCommandContext::instance()->dataSpaces()->ReadPointersVirtual(1, address, &address); + stringBuilder.str(""); + stringBuilder << std::showbase << std::hex << address; + currentContextStr = stringBuilder.str(); + } + } + } + + if (currentContextStr.empty()) { + errorMessage = "Failed to retrieve currenContext from QML engine"; + break; + } + + stringBuilder.str(""); + stringBuilder << qtInfo.prependQtModule("qt_v4StackTrace(", QtInfo::Qml) << currentContextStr << ')'; + if (ExtensionContext::instance().call(stringBuilder.str(), ExtensionContext::CallWithExceptionsHandled, &wOutput, &errorMessage)) + break; + } while (false); + + if (wOutput.empty()) break; + // extract GDBMI info from call const std::string::size_type sPos = wOutput.find(L"stack=["); const std::string::size_type sEndPos = wOutput.rfind(L']'); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 3822dce9109..001e575bf43 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -172,7 +172,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id) QString::fromLatin1("-DANDROID_SDK:PATH=%1").arg(sdkLocation.toString())); } - initialArgs.append(QString::fromLatin1("-DANDROID_STL:STRING=cxx_shared")); + initialArgs.append(QString::fromLatin1("-DANDROID_STL:STRING=c++_shared")); initialArgs.append( QString::fromLatin1("-DCMAKE_FIND_ROOT_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}")); diff --git a/src/plugins/cpptools/cppfollowsymbolundercursor.cpp b/src/plugins/cpptools/cppfollowsymbolundercursor.cpp index f7307b59c15..4fc2c8e3160 100644 --- a/src/plugins/cpptools/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cpptools/cppfollowsymbolundercursor.cpp @@ -356,7 +356,7 @@ Link attemptDeclDef(const QTextCursor &cursor, Snapshot snapshot, funcDecl = decl->postfix_declarator_list->value->asFunctionDeclarator(); if (funcDecl) target = symbolFinder->findMatchingDefinition(funcDecl->symbol, snapshot); - else + else if (simpleDecl->symbols) target = symbolFinder->findMatchingVarDefinition(simpleDecl->symbols->value, snapshot); } diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index ebdf7b068fe..e4f41b0e4c4 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -732,7 +733,8 @@ bool CdbEngine::hasCapability(unsigned cap) const | CreateFullBacktraceCapability | OperateByInstructionCapability | RunToLineCapability - | MemoryAddressCapability); + | MemoryAddressCapability + | AdditionalQmlStackCapability); } void CdbEngine::executeStepIn(bool byInstruction) @@ -2630,6 +2632,8 @@ static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = nullptr) frame.language = QmlLanguage; } frame.function = frameMi["function"].data(); + if (frame.function.isEmpty()) + frame.function = frameMi["func"].data(); // GDB's *stopped messages frame.module = frameMi["from"].data(); frame.context = frameMi["context"].data(); frame.address = frameMi["address"].data().toULongLong(nullptr, 16); @@ -2687,6 +2691,14 @@ unsigned CdbEngine::parseStackTrace(const GdbMi &data, bool sourceStepInto) void CdbEngine::loadAdditionalQmlStack() { + // Creating a qml stack while the QmlEngine is stopped results in a frozen inferior. + const auto engineList = EngineManager::engines(); + for (DebuggerEngine *engine : engineList) { + if (engine->objectName() == "QmlEngine" && engine->state() == Debugger::InferiorStopOk) { + showMessage("Can't create a QML stack trace while the QML Debugger is in the Stopped state", StatusBar); + return; + } + } runCommand({"qmlstack", ExtensionCommand, CB(handleAdditionalQmlStack)}); } diff --git a/src/plugins/incredibuild/IncrediBuild.json.in b/src/plugins/incredibuild/IncrediBuild.json.in index 788227daa72..ff8d1718728 100644 --- a/src/plugins/incredibuild/IncrediBuild.json.in +++ b/src/plugins/incredibuild/IncrediBuild.json.in @@ -7,5 +7,14 @@ \"Copyright\" : \"(C) IncrediBuild\", \"Category\" : \"Build Systems\", \"Url\" : \"http://www.IncrediBuild.com\", + \"License\" : [ \"Commercial Usage\", + \"\", + \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt 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.\", + \"\", + \"GNU General Public License Usage\", + \"\", + \"Alternatively, this plugin 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 plugin. 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.\" + ], + \"Description\" : \"Support for Incredibuild.\", $$dependencyList } diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index a541acc2f58..d8b340c1d83 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1119,16 +1119,13 @@ void Client::resetAssistProviders(TextEditor::TextDocument *document) { const AssistProviders providers = m_resetAssistProvider.take(document); - if (document->completionAssistProvider() == m_clientProviders.completionAssistProvider && - providers.completionAssistProvider) + if (document->completionAssistProvider() == m_clientProviders.completionAssistProvider) document->setCompletionAssistProvider(providers.completionAssistProvider); - if (document->functionHintAssistProvider() == m_clientProviders.functionHintProvider && - providers.functionHintProvider) + if (document->functionHintAssistProvider() == m_clientProviders.functionHintProvider) document->setFunctionHintAssistProvider(providers.functionHintProvider); - if (document->quickFixAssistProvider() == m_clientProviders.quickFixAssistProvider && - providers.quickFixAssistProvider) + if (document->quickFixAssistProvider() == m_clientProviders.quickFixAssistProvider) document->setQuickFixAssistProvider(providers.quickFixAssistProvider); } @@ -1139,6 +1136,15 @@ void Client::sendPostponedDocumentUpdates() return; TextEditor::TextEditorWidget *currentWidget = TextEditor::TextEditorWidget::currentTextEditorWidget(); + + struct DocumentUpdate + { + TextEditor::TextDocument *document; + DidChangeTextDocumentNotification notification; + }; + + QList updates; + const QList documents = m_documentsToUpdate.keys(); for (auto document : documents) { const auto uri = DocumentUri::fromFilePath(document->filePath()); @@ -1148,10 +1154,15 @@ void Client::sendPostponedDocumentUpdates() DidChangeTextDocumentParams params; params.setTextDocument(docId); params.setContentChanges(m_documentsToUpdate.take(document)); - sendContent(DidChangeTextDocumentNotification(params)); - emit documentUpdated(document); - if (currentWidget && currentWidget->textDocument() == document) + updates.append({document, DidChangeTextDocumentNotification(params)}); + } + + for (const DocumentUpdate &update : qAsConst(updates)) { + sendContent(update.notification); + emit documentUpdated(update.document); + + if (currentWidget && currentWidget->textDocument() == update.document) cursorPositionChanged(currentWidget); } } diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index 499cfc7b965..2114257faef 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -316,7 +316,7 @@ IAssistProposal *LanguageClientCompletionAssistProcessor::perform(const AssistIn m_pos = interface->position(); if (interface->reason() == IdleEditor) { // Trigger an automatic completion request only when we are on a word with at least n "identifier" characters - const QRegularExpression regexp("[_a-zA-Z0-9]+"); + const QRegularExpression regexp("^[_a-zA-Z0-9]+$"); auto hasMatch = [®exp](const QString &txt) { return regexp.match(txt).hasMatch(); }; int delta = 0; while (m_pos - delta > 0 && hasMatch(interface->textAt(m_pos - delta - 1, delta + 1))) diff --git a/src/plugins/nim/Nim.json.in b/src/plugins/nim/Nim.json.in index a3d98945c35..ae37bfb085d 100644 --- a/src/plugins/nim/Nim.json.in +++ b/src/plugins/nim/Nim.json.in @@ -8,9 +8,9 @@ \"\", \"Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt 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.\", \"\", - \"GNU Lesser General Public License Usage\", + \"GNU General Public License Usage\", \"\", - \"Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 or version 3 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License requirements will be met: https://www.gnu.org/licenses/lgpl.html and http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.\" + \"Alternatively, this plugin 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 plugin. 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.\" ], \"Category\" : \"Other Languages\", \"Description\" : \"Plugin for supporting the Nim programming language.\", diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index d812fb78c5a..5acf42828d9 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -1731,8 +1731,11 @@ void ClangToolChainConfigWidget::updateParentToolChainComboBox() return; for (const ToolChain *mingwTC : mingwToolChains()) { - if (parentId != mingwTC->id()) - m_parentToolchainCombo->addItem(mingwTC->displayName(), mingwTC->id()); + if (mingwTC->id() == parentId) + continue; + if (mingwTC->language() != tc->language()) + continue; + m_parentToolchainCombo->addItem(mingwTC->displayName(), mingwTC->id()); } } diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index a5b45af2ef8..7f0a0676ca1 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -836,10 +836,12 @@ void RunControl::setupFormatter(OutputFormatter *formatter) const } } formatter->setLineParsers(parsers); - Utils::FileInProjectFinder fileFinder; - fileFinder.setProjectDirectory(project()->projectDirectory()); - fileFinder.setProjectFiles(project()->files(Project::AllFiles)); - formatter->setFileFinder(fileFinder); + if (project()) { + Utils::FileInProjectFinder fileFinder; + fileFinder.setProjectDirectory(project()->projectDirectory()); + fileFinder.setProjectFiles(project()->files(Project::AllFiles)); + formatter->setFileFinder(fileFinder); + } } Utils::Id RunControl::runMode() const diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 54bf8bf40ab..b344f325627 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -155,6 +155,11 @@ void ToolChain::setDisplayName(const QString &name) toolChainUpdated(); } +bool ToolChain::isAutoDetected() const +{ + return detection() == AutoDetection || detection() == AutoDetectionFromSdk; +} + ToolChain::Detection ToolChain::detection() const { return d->m_detection; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index e4ca6f9dde9..c1befe69b60 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -99,7 +99,7 @@ public: QString displayName() const; void setDisplayName(const QString &name); - inline bool isAutoDetected() const { return detection() != ManualDetection; } + bool isAutoDetected() const; Detection detection() const; QByteArray id() const; diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 1ba8fcd2be8..247c564dd48 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -50,11 +50,12 @@ #include #include +#include #include #include +#include #include #include -#include namespace QmlDesigner { @@ -770,6 +771,11 @@ void FormEditorView::exportAsImage() m_formEditorWidget->exportAsImage(m_scene->rootFormEditorItem()->boundingRect()); } +QPicture FormEditorView::renderToPicture() const +{ + return m_formEditorWidget->renderToPicture(); +} + QmlItemNode findRecursiveQmlItemNode(const QmlObjectNode &firstQmlObjectNode) { QmlObjectNode qmlObjectNode = firstQmlObjectNode; diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.h b/src/plugins/qmldesigner/components/formeditor/formeditorview.h index 64c1f2a4357..8aa156fa45c 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.h @@ -128,6 +128,7 @@ public: void setGotoErrorCallback(std::function gotoErrorCallback); void exportAsImage(); + QPicture renderToPicture() const; protected: void reset(); diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp index c09516cbf83..c8c54f6a53f 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -487,6 +488,19 @@ void FormEditorWidget::exportAsImage(const QRectF &boundingRect) } } +QPicture FormEditorWidget::renderToPicture() const +{ + QPicture picture; + QPainter painter{&picture}; + + const QTransform viewportTransform = m_graphicsView->viewportTransform(); + const QRectF boundingRect = rootItemRect(); + + m_graphicsView->render(&painter, boundingRect, viewportTransform.mapRect(boundingRect.toRect())); + + return picture; +} + FormEditorGraphicsView *FormEditorWidget::graphicsView() const { return m_graphicsView; @@ -504,7 +518,4 @@ DocumentWarningWidget *FormEditorWidget::errorWidget() return m_documentErrorWidget; } - -} - - +} // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h index b32c95916a9..1f6b559a386 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h +++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.h @@ -83,6 +83,7 @@ public: void showWarningMessageBox(const QList &warnings); void exportAsImage(const QRectF &boundingRect); + QPicture renderToPicture() const; FormEditorGraphicsView *graphicsView() const; diff --git a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp index 8ea7692e3d1..2ef68f24b48 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/preseteditor.cpp @@ -348,18 +348,19 @@ void PresetList::contextMenuEvent(QContextMenuEvent *event) if (m_scope == QSettings::SystemScope) return; - QMenu menu; + auto *menu = new QMenu(this); - QAction *addAction = menu.addAction(tr("Add Preset")); + QAction *addAction = menu->addAction(tr("Add Preset")); connect(addAction, &QAction::triggered, [&]() { createItem(); }); if (selectionModel()->hasSelection()) { - QAction *removeAction = menu.addAction(tr("Delete Selected Preset")); + QAction *removeAction = menu->addAction(tr("Delete Selected Preset")); connect(removeAction, &QAction::triggered, [&]() { removeSelectedItem(); }); } - menu.exec(event->globalPos()); + menu->exec(event->globalPos()); + menu->deleteLater(); } void PresetList::dataChanged(const QModelIndex &topLeft, diff --git a/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp b/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp index e6d6be4fb60..3431e5c7a7a 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/splineeditor.cpp @@ -253,6 +253,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e) }); menu->exec(e->globalPos()); + menu->deleteLater(); e->accept(); } diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h index 7ab1fc98083..eaf4fc08e2a 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h @@ -99,6 +99,7 @@ public: void nodeSourceChanged(const ModelNode &modelNode, const QString &newNodeSource) override; void capturedData(const CapturedDataCommand &capturedData) override; void currentStateChanged(const ModelNode &node) override; + void sceneCreated(const SceneCreatedCommand &command) override; QList instances() const; NodeInstance instanceForModelNode(const ModelNode &node) const ; diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index ece4fa35b9c..dc379bd312f 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -64,6 +64,7 @@ #include "removepropertiescommand.h" #include "removesharedmemorycommand.h" #include "reparentinstancescommand.h" +#include "scenecreatedcommand.h" #include "statepreviewimagechangedcommand.h" #include "tokencommand.h" #include "update3dviewstatecommand.h" @@ -585,10 +586,10 @@ void NodeInstanceView::currentStateChanged(const ModelNode &node) nodeInstanceView()->activateBaseState(); } +void NodeInstanceView::sceneCreated(const SceneCreatedCommand &) {} //\} - void NodeInstanceView::removeAllInstanceNodeRelationships() { m_nodeInstanceHash.clear(); diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp index 7fa787ca0ea..2c53d5a505c 100644 --- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp +++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp @@ -516,8 +516,13 @@ QString AbstractView::generateNewId(const QString &prefixName, const QString &fa QString newBaseId = QString(QStringLiteral("%1")).arg(firstCharToLower(prefixName)); newBaseId.remove(QRegularExpression(QStringLiteral("[^a-zA-Z0-9_]"))); - if (newBaseId.isEmpty()) + if (!newBaseId.isEmpty()) { + QChar firstChar = newBaseId.at(0); + if (firstChar.isDigit()) + newBaseId.prepend('_'); + } else { newBaseId = fallbackPrefix; + } QString newId = newBaseId; diff --git a/src/plugins/qmldesigner/qmldesignerplugin.qbs b/src/plugins/qmldesigner/qmldesignerplugin.qbs index 9549075f11b..cb40c589352 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.qbs +++ b/src/plugins/qmldesigner/qmldesignerplugin.qbs @@ -135,6 +135,7 @@ Project { "commands/changevaluescommand.cpp", "commands/changevaluescommand.h", "commands/captureddatacommand.h", + "commands/scenecreatedcommand.h", "commands/childrenchangedcommand.cpp", "commands/childrenchangedcommand.h", "commands/clearscenecommand.cpp", diff --git a/src/plugins/qtsupport/qtcreator_tutorials.xml b/src/plugins/qtsupport/qtcreator_tutorials.xml index e7785a0e176..e4a486efea6 100644 --- a/src/plugins/qtsupport/qtcreator_tutorials.xml +++ b/src/plugins/qtsupport/qtcreator_tutorials.xml @@ -50,6 +50,30 @@ qt creator,qt quick,video + + + qt creator,qt quick,views,quick tip,video,2020 + + + + qt creator,qt quick,animated image,gif,quick tip,qml,video,2020 + + + + qt creator,qt quick,bindings,quick tip,qml,video,2020 + + + + qt creator,qt quick,slider,quick tip,controls,video,2020 + + + + qt creator,qt quick,slider,quick tip,controls,video,2020 + + + + qt creator,qt quick,quick tip,qml,test,video,2020 + qt creator,SCXML,video @@ -79,9 +103,9 @@ qt creator,qt quick,controls,video - + - qt creator,talk,2015 + qt creator,talk,2020 @@ -123,11 +147,6 @@ qt creator,baremetal,talk,2013 - - - uwp,talk,2016 - - ui,qt quick designer,controls,ui,talk,2016 @@ -148,10 +167,6 @@ qt,qt quick,screen resolution,ui,talk,2016 - - - android,ios,talk,2017 - qt designer,widgets,ui,talk,2019 @@ -176,10 +191,6 @@ qt creator,kits,yocto,embedded,talk,2019 - - - qt quick,ui,webos,talk,2019 - qtformcus,mcus,qt,video,NXP IMXRT1050-EVKB,2020 diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index 70e5f2c5d8c..c4ffb03b4c4 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -622,8 +622,11 @@ bool TextDocument::save(QString *errorString, const QString &saveFileName, bool cursor.beginEditBlock(); cursor.movePosition(QTextCursor::Start); - if (d->m_storageSettings.m_cleanWhitespace) - cleanWhitespace(cursor, d->m_storageSettings); + if (d->m_storageSettings.m_cleanWhitespace) { + cleanWhitespace(cursor, + d->m_storageSettings.m_inEntireDocument, + d->m_storageSettings.m_cleanIndentation); + } if (d->m_storageSettings.m_addFinalNewLine) ensureFinalNewLine(cursor); cursor.endEditBlock(); @@ -885,7 +888,7 @@ void TextDocument::cleanWhitespace(const QTextCursor &cursor) copyCursor.setVisualNavigation(false); copyCursor.beginEditBlock(); - cleanWhitespace(copyCursor, d->m_storageSettings); + cleanWhitespace(copyCursor, true, true); if (!hasSelection) ensureFinalNewLine(copyCursor); @@ -893,11 +896,9 @@ void TextDocument::cleanWhitespace(const QTextCursor &cursor) copyCursor.endEditBlock(); } -void TextDocument::cleanWhitespace(QTextCursor &cursor, const StorageSettings &storageSettings) +void TextDocument::cleanWhitespace(QTextCursor &cursor, bool inEntireDocument, + bool cleanIndentation) { - if (!d->m_storageSettings.m_cleanWhitespace) - return; - const QString fileName(filePath().fileName()); auto documentLayout = qobject_cast(d->m_document.documentLayout()); @@ -910,8 +911,9 @@ void TextDocument::cleanWhitespace(QTextCursor &cursor, const StorageSettings &s QVector blocks; while (block.isValid() && block != end) { - if (storageSettings.m_inEntireDocument || block.revision() != documentLayout->lastSaveRevision) + if (inEntireDocument || block.revision() != documentLayout->lastSaveRevision) { blocks.append(block); + } block = block.next(); } if (blocks.isEmpty()) @@ -924,11 +926,11 @@ void TextDocument::cleanWhitespace(QTextCursor &cursor, const StorageSettings &s foreach (block, blocks) { QString blockText = block.text(); - if (storageSettings.removeTrailingWhitespace(fileName)) + if (d->m_storageSettings.removeTrailingWhitespace(fileName)) currentTabSettings.removeTrailingWhitespace(cursor, block); const int indent = indentations[block.blockNumber()]; - if (storageSettings.m_cleanIndentation && !currentTabSettings.isIndentationClean(block, indent)) { + if (cleanIndentation && !currentTabSettings.isIndentationClean(block, indent)) { cursor.setPosition(block.position()); int firstNonSpace = currentTabSettings.firstNonSpace(blockText); if (firstNonSpace == blockText.length()) { diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index d91390869c6..b01ea25574a 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -170,7 +170,7 @@ protected: private: OpenResult openImpl(QString *errorString, const QString &fileName, const QString &realFileName, bool reload); - void cleanWhitespace(QTextCursor &cursor, const StorageSettings &storageSettings); + void cleanWhitespace(QTextCursor &cursor, bool inEntireDocument, bool cleanIndentation); void ensureFinalNewLine(QTextCursor &cursor); void modificationChanged(bool modified); void updateLayout() const; diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ad6bdbc0fb4..b34847a3d7f 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -468,7 +468,6 @@ struct PaintEventBlockData { QRectF boundingRect; QVector selections; - QVector prioritySelections; QRectF blockSelectionCursorRect; QTextLayout *layout = nullptr; int position = 0; @@ -4704,6 +4703,7 @@ void TextEditorWidgetPrivate::setupBlockLayout(const PaintEventData &data, void TextEditorWidgetPrivate::setupSelections(const PaintEventData &data, PaintEventBlockData &blockData) const { + QVector prioritySelections; for (int i = 0; i < data.context.selections.size(); ++i) { const QAbstractTextDocumentLayout::Selection &range = data.context.selections.at(i); const int selStart = range.cursor.selectionStart() - blockData.position; @@ -4720,18 +4720,25 @@ void TextEditorWidgetPrivate::setupSelections(const PaintEventData &data, o.start = ts.positionAtColumn(text, m_blockSelection.firstVisualColumn()); o.length = ts.positionAtColumn(text, m_blockSelection.lastVisualColumn()) - o.start; } + if (data.textCursor.hasSelection() && data.textCursor == range.cursor) { + const QTextCharFormat selectionFormat = data.fontSettings.toTextCharFormat(C_SELECTION); + if (selectionFormat.background().style() != Qt::NoBrush) + o.format.setBackground(selectionFormat.background()); + if (selectionFormat.foreground().style() != Qt::NoBrush) + o.format.setForeground(selectionFormat.foreground()); + } if ((data.textCursor.hasSelection() && i == data.context.selections.size() - 1) || (o.format.foreground().style() == Qt::NoBrush && o.format.underlineStyle() != QTextCharFormat::NoUnderline && o.format.background() == Qt::NoBrush)) { if (q->selectionVisible(data.block.blockNumber())) - blockData.prioritySelections.append(o); + prioritySelections.append(o); } else { blockData.selections.append(o); } } } - blockData.selections += blockData.prioritySelections; + blockData.selections.append(prioritySelections); } void TextEditorWidgetPrivate::setupCursorPosition(PaintEventData &data, diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 2b80c8ca294..f3f6a66303f 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -53,6 +53,7 @@ extend_qtc_executable(qml2puppet view3dactioncommand.cpp view3dactioncommand.h valueschangedcommand.cpp captureddatacommand.h + scenecreatedcommand.h ) extend_qtc_executable(qml2puppet @@ -156,7 +157,9 @@ extend_qtc_executable(qml2puppet quick3dtexturenodeinstance.cpp quick3dtexturenodeinstance.h quickitemnodeinstance.cpp quickitemnodeinstance.h servernodeinstance.cpp servernodeinstance.h - qt5capturenodeinstanceserver.cpp qt5capturenodeinstanceserver.h + qt5capturepreviewnodeinstanceserver.cpp qt5capturepreviewnodeinstanceserver.h + nodeinstanceserverdispatcher.cpp nodeinstanceserverdispatcher.h + capturenodeinstanceserverdispatcher.cpp capturenodeinstanceserverdispatcher.h ) extend_qtc_executable(qml2puppet diff --git a/src/tools/qml2puppet/qml2puppet.qbs b/src/tools/qml2puppet/qml2puppet.qbs index 3aab61eb9c1..4d135b0cde0 100644 --- a/src/tools/qml2puppet/qml2puppet.qbs +++ b/src/tools/qml2puppet/qml2puppet.qbs @@ -117,6 +117,7 @@ QtcTool { "commands/view3dactioncommand.cpp", "commands/view3dactioncommand.h", "commands/captureddatacommand.h", + "commands/scenecreatedcommand.h", "container/addimportcontainer.cpp", "container/addimportcontainer.h", "container/idcontainer.cpp", @@ -219,8 +220,12 @@ QtcTool { "instances/qt5testnodeinstanceserver.h", "instances/servernodeinstance.cpp", "instances/servernodeinstance.h", - "instances/qt5capturenodeinstanceserver.cpp", - "instances/qt5capturenodeinstanceserver.h", + "instances/qt5capturepreviewnodeinstanceserver.cpp", + "instances/qt5capturepreviewnodeinstanceserver.h", + "instances/nodeinstanceserverdispatcher.cpp", + "instances/nodeinstanceserverdispatcher.h", + "instances/capturenodeinstanceserverdispatcher.cpp", + "instances/capturenodeinstanceserverdispatcher.h", "editor3d/generalhelper.cpp", "editor3d/mousearea3d.cpp", "editor3d/camerageometry.cpp",