Merge remote-tracking branch 'origin/4.13' into master

Conflicts:
	src/plugins/languageclient/languageclientcompletionassist.cpp

Change-Id: If12e1c532e5623ef063681309a918e7b51117b1c
This commit is contained in:
Eike Ziller
2020-09-14 10:12:14 +02:00
74 changed files with 874 additions and 137 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -110,7 +110,7 @@
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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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}.
*/

View File

@@ -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

View File

@@ -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 \

View File

@@ -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 \

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

@@ -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.

View File

@@ -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.
*/

View File

@@ -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
*/

View File

@@ -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}

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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:

View File

@@ -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 = 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]

View File

@@ -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 \

View File

@@ -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 <QMetaType>
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)

View File

@@ -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()
{
}

View File

@@ -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;

View File

@@ -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() {}

View File

@@ -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>("CapturedDataCommand");
qRegisterMetaTypeStreamOperators<CapturedDataCommand>("CapturedDataCommand");
qRegisterMetaType<SceneCreatedCommand>("SceneCreatedCommand");
qRegisterMetaTypeStreamOperators<SceneCreatedCommand>("SceneCreatedCommand");
}
}

View File

@@ -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<NodeInstanceServer> &server : m_servers)
server->collectItemChangesAndSendChangeCommands();
m_nodeInstanceClient->sceneCreated({});
}
} // namespace QmlDesigner

View File

@@ -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

View File

@@ -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 \

View File

@@ -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

View File

@@ -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<qint32> &instanceIds);
void sendDebugOutput(DebugOutputCommand::Type type,
const QString &message,
const QVector<qint32> &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<ServerNodeInstance> &instanceList) const;
ValuesChangedCommand createValuesChangedCommand(const QVector<InstancePropertyPair> &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<InstancePropertyPair> m_changedPropertyList;
QByteArray m_importCode;
QPointer<QObject> m_dummyContextObject;

View File

@@ -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<NodeInstanceServer> &server : m_servers)
server->createInstances(command);
}
void NodeInstanceServerDispatcher::changeFileUrl(const ChangeFileUrlCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeFileUrl(command);
}
void NodeInstanceServerDispatcher::createScene(const CreateSceneCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->createScene(command);
}
void NodeInstanceServerDispatcher::clearScene(const ClearSceneCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->clearScene(command);
}
void NodeInstanceServerDispatcher::update3DViewState(const Update3dViewStateCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->update3DViewState(command);
}
void NodeInstanceServerDispatcher::removeInstances(const RemoveInstancesCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->removeInstances(command);
}
void NodeInstanceServerDispatcher::removeProperties(const RemovePropertiesCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->removeProperties(command);
}
void NodeInstanceServerDispatcher::changePropertyBindings(const ChangeBindingsCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changePropertyBindings(command);
}
void NodeInstanceServerDispatcher::changePropertyValues(const ChangeValuesCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changePropertyValues(command);
}
void NodeInstanceServerDispatcher::changeAuxiliaryValues(const ChangeAuxiliaryCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeAuxiliaryValues(command);
}
void NodeInstanceServerDispatcher::reparentInstances(const ReparentInstancesCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->reparentInstances(command);
}
void NodeInstanceServerDispatcher::changeIds(const ChangeIdsCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeIds(command);
}
void NodeInstanceServerDispatcher::changeState(const ChangeStateCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeState(command);
}
void NodeInstanceServerDispatcher::completeComponent(const CompleteComponentCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->completeComponent(command);
}
void NodeInstanceServerDispatcher::changeNodeSource(const ChangeNodeSourceCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeNodeSource(command);
}
void NodeInstanceServerDispatcher::token(const TokenCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->token(command);
}
void NodeInstanceServerDispatcher::removeSharedMemory(const RemoveSharedMemoryCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->removeSharedMemory(command);
}
void NodeInstanceServerDispatcher::changeSelection(const ChangeSelectionCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeSelection(command);
}
void NodeInstanceServerDispatcher::inputEvent(const InputEventCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->inputEvent(command);
}
void NodeInstanceServerDispatcher::view3DAction(const View3DActionCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->view3DAction(command);
}
void NodeInstanceServerDispatcher::changeLanguage(const ChangeLanguageCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changeLanguage(command);
}
void NodeInstanceServerDispatcher::changePreviewImageSize(const ChangePreviewImageSizeCommand &command)
{
for (std::unique_ptr<NodeInstanceServer> &server : m_servers)
server->changePreviewImageSize(command);
}
namespace {
std::unique_ptr<NodeInstanceServer> createNodeInstanceServer(
const QString &serverName, NodeInstanceClientInterface *nodeInstanceClient)
{
if (serverName == "capturemode")
return std::make_unique<Qt5CapturePreviewNodeInstanceServer>(nodeInstanceClient);
else if (serverName == "rendermode")
return std::make_unique<Qt5RenderNodeInstanceServer>(nodeInstanceClient);
else if (serverName == "editormode")
return std::make_unique<Qt5InformationNodeInstanceServer>(nodeInstanceClient);
else if (serverName == "previewmode")
return std::make_unique<Qt5PreviewNodeInstanceServer>(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

View File

@@ -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 <nodeinstanceserver.h>
#include <memory>
#include <vector>
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<std::unique_ptr<NodeInstanceServer>> m_servers;
};
} // namespace QmlDesigner

View File

@@ -23,7 +23,7 @@
**
****************************************************************************/
#include "qt5capturenodeinstanceserver.h"
#include "qt5capturepreviewnodeinstanceserver.h"
#include "servernodeinstance.h"
#include <captureddatacommand.h>
@@ -75,7 +75,7 @@ CapturedDataCommand::StateData collectStateData(ServerNodeInstance rootNodeInsta
}
} // namespace
void Qt5CaptureNodeInstanceServer::collectItemChangesAndSendChangeCommands()
void Qt5CapturePreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands()
{
static bool inFunction = false;

View File

@@ -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)
{}

View File

@@ -27,7 +27,8 @@
#include <QCoreApplication>
#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<CaptureNodeInstanceServerDispatcher>(serverNames, this));
initializeSocket();
} else if (QCoreApplication::arguments().at(2) == QLatin1String("previewmode")) {
setNodeInstanceServer(std::make_unique<Qt5PreviewNodeInstanceServer>(this));
initializeSocket();
@@ -72,7 +77,7 @@ Qt5NodeInstanceClientProxy::Qt5NodeInstanceClientProxy(QObject *parent) :
setNodeInstanceServer(std::make_unique<Qt5RenderNodeInstanceServer>(this));
initializeSocket();
} else if (QCoreApplication::arguments().at(2) == QLatin1String("capturemode")) {
setNodeInstanceServer(std::make_unique<Qt5CaptureNodeInstanceServer>(this));
setNodeInstanceServer(std::make_unique<Qt5CapturePreviewNodeInstanceServer>(this));
initializeSocket();
}
}

View File

@@ -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<qint32, ServerNodeInstance>;
friend uint qHash(const ServerNodeInstance &instance);

View File

@@ -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

View File

@@ -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']');

View File

@@ -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}"));

View File

@@ -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);
}

View File

@@ -41,6 +41,7 @@
#include <debugger/debuggertooltipmanager.h>
#include <debugger/disassembleragent.h>
#include <debugger/disassemblerlines.h>
#include <debugger/enginemanager.h>
#include <debugger/memoryagent.h>
#include <debugger/moduleshandler.h>
#include <debugger/registerhandler.h>
@@ -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)});
}

View File

@@ -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
}

View File

@@ -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<DocumentUpdate> updates;
const QList<TextEditor::TextDocument *> 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);
}
}

View File

@@ -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 = [&regexp](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)))

View File

@@ -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.\",

View File

@@ -1731,7 +1731,10 @@ void ClangToolChainConfigWidget::updateParentToolChainComboBox()
return;
for (const ToolChain *mingwTC : mingwToolChains()) {
if (parentId != mingwTC->id())
if (mingwTC->id() == parentId)
continue;
if (mingwTC->language() != tc->language())
continue;
m_parentToolchainCombo->addItem(mingwTC->displayName(), mingwTC->id());
}
}

View File

@@ -836,10 +836,12 @@ void RunControl::setupFormatter(OutputFormatter *formatter) const
}
}
formatter->setLineParsers(parsers);
if (project()) {
Utils::FileInProjectFinder fileFinder;
fileFinder.setProjectDirectory(project()->projectDirectory());
fileFinder.setProjectFiles(project()->files(Project::AllFiles));
formatter->setFileFinder(fileFinder);
}
}
Utils::Id RunControl::runMode() const

View File

@@ -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;

View File

@@ -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;

View File

@@ -50,11 +50,12 @@
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <memory>
#include <QDebug>
#include <QPair>
#include <QPicture>
#include <QString>
#include <QTimer>
#include <memory>
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;

View File

@@ -128,6 +128,7 @@ public:
void setGotoErrorCallback(std::function<void(int, int)> gotoErrorCallback);
void exportAsImage();
QPicture renderToPicture() const;
protected:
void reset();

View File

@@ -53,6 +53,7 @@
#include <QActionGroup>
#include <QFileDialog>
#include <QPainter>
#include <QPicture>
#include <QVBoxLayout>
#include <QWheelEvent>
@@ -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

View File

@@ -83,6 +83,7 @@ public:
void showWarningMessageBox(const QList<DocumentMessage> &warnings);
void exportAsImage(const QRectF &boundingRect);
QPicture renderToPicture() const;
FormEditorGraphicsView *graphicsView() const;

View File

@@ -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,

View File

@@ -253,6 +253,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
});
menu->exec(e->globalPos());
menu->deleteLater();
e->accept();
}

View File

@@ -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<NodeInstance> instances() const;
NodeInstance instanceForModelNode(const ModelNode &node) const ;

View File

@@ -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();

View File

@@ -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;

View File

@@ -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",

View File

@@ -50,6 +50,30 @@
<description><![CDATA[Creating a Qt Quick application.]]></description>
<tags>qt creator,qt quick,video</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: UI Navigation" isVideo="true" videoUrl="https://www.youtube.com/watch?v=RfEYO-5Mw6s" videoLength="1:00">
<description><![CDATA[Navigating in Qt Quick Designer and using the different views.]]></description>
<tags>qt creator,qt quick,views,quick tip,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: Animated Image" isVideo="true" videoUrl="https://www.youtube.com/watch?v=DVWd_xMMgvg" videoLength="1:00">
<description><![CDATA[Using the basic AnimatedImage QML type to add GIF images to UIs.]]></description>
<tags>qt creator,qt quick,animated image,gif,quick tip,qml,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: Bindings" isVideo="true" videoUrl="https://www.youtube.com/watch?v=UfvA04CIXv0" videoLength="1:00">
<description><![CDATA[Using bindings to dynamically change the behavior of an object.]]></description>
<tags>qt creator,qt quick,bindings,quick tip,qml,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: Slider" isVideo="true" videoUrl="https://www.youtube.com/watch?v=Ed8WS03C-Vk" videoLength="1:00">
<description><![CDATA[Using the Slider Qt Quick control to create a slider.]]></description>
<tags>qt creator,qt quick,slider,quick tip,controls,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: States" isVideo="true" videoUrl="https://www.youtube.com/watch?v=FzmLuRHQXaw" videoLength="1:00">
<description><![CDATA[Using states in a UI.]]></description>
<tags>qt creator,qt quick,slider,quick tip,controls,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt Design Studio QuickTip: Text Element" isVideo="true" videoUrl="https://www.youtube.com/watch?v=yOUdg1o2KJM" videoLength="1:00">
<description><![CDATA[Using the basic Text QML type to create a text label with a custom font.]]></description>
<tags>qt creator,qt quick,quick tip,qml,test,video,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: Qt SCXML and State Machine Tooling in Qt Creator" isVideo="true" videoUrl="https://youtu.be/9xqhq9nDiOg" videoLength="4:53">
<description><![CDATA[Creating state machines.]]></description>
<tags>qt creator,SCXML,video</tags>
@@ -79,9 +103,9 @@
<tags>qt creator,qt quick,controls,video</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Introduction to Qt Creator" isVideo="true" videoUrl="https://www.youtube.com/watch?v=nGFmjOiT22Y" videoLength="50:36">
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Introduction to Qt Creator IDE" isVideo="true" videoUrl="https://www.youtube.com/watch?v=nGFmjOiT22Y" videoLength="1:06:32">
<description><![CDATA[Getting started with using Qt Creator for cross-platform development.]]></description>
<tags>qt creator,talk,2015</tags>
<tags>qt creator,talk,2020</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Custom Qt Creator Wizards" isVideo="true" videoUrl="https://www.youtube.com/watch?v=Ko3DuCgFamo" videoLength="27:21">
<description><![CDATA[Adding custom file and project creation wizards to Qt Creator.]]></description>
@@ -123,11 +147,6 @@
<description><![CDATA[Developing Qt Applications for Bare Metal devices.]]></description>
<tags>qt creator,baremetal,talk,2013</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Integrating Universal Windows Platform to Qt" isVideo="true" videoUrl="https://youtu.be/tpNdw2Cs4KY" videoLength="47:38">
<description><![CDATA[Qt support for Universal Windows Platform on desktop, mobile, and embedded devices.]]></description>
<tags>uwp,talk,2016</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Developing User Interfaces with Qt Quick Controls 2" isVideo="true" videoUrl="https://youtu.be/ozpSl7WbVt4" videoLength="23:13">
<description><![CDATA[Using Qt Quick Controls 2 to create UIs.]]></description>
<tags>ui,qt quick designer,controls,ui,talk,2016</tags>
@@ -148,10 +167,6 @@
<description><![CDATA[Best practices for an efficient app lifecycle.]]></description>
<tags>qt,qt quick,screen resolution,ui,talk,2016</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: App Development with Qt - Technical Tips and Examples for Development &amp; Testing" isVideo="true" videoUrl="https://www.youtube.com/watch?v=OqqarK73I9E" videoLength="53:57">
<description><![CDATA[Technical tips and examples for developing and testing mobile apps.]]></description>
<tags>android,ios,talk,2017</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: Qt Designer tutorial: Integrate custom widgets" isVideo="true" videoUrl="https://youtu.be/B0X5FOev9Lw" videoLength="27:07">
<description><![CDATA[Integrating custom widgets into Qt Designer.]]></description>
<tags>qt designer,widgets,ui,talk,2019</tags>
@@ -176,10 +191,6 @@
<description><![CDATA[Using Qt Creator kits and Yocto when developing for embedded devices.]]></description>
<tags>qt creator,kits,yocto,embedded,talk,2019</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/qteventicon.png" difficulty="" projectPath="" name="Talk: How to build QML apps for webOS and the Qt Creator webOS Plugin" isVideo="true" videoUrl="https://youtu.be/Yms_MvWQVR0" videoLength="24:58">
<description><![CDATA[Running Qt Quick apps on webOS.]]></description>
<tags>qt quick,ui,webos,talk,2019</tags>
</tutorial>
<tutorial imageUrl=":qtsupport/images/icons/videotutorialicon.png" difficulty="" projectPath="" name="Online: How to build your first 'Qt for MCUs' application" isVideo="true" videoUrl="https://youtu.be/BkgjJfxYN20" videoLength="21:54">
<description><![CDATA[Building your first application for the NXP IMXRT1050 device.]]></description>
<tags>qtformcus,mcus,qt,video,NXP IMXRT1050-EVKB,2020</tags>

View File

@@ -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<TextDocumentLayout*>(d->m_document.documentLayout());
@@ -910,8 +911,9 @@ void TextDocument::cleanWhitespace(QTextCursor &cursor, const StorageSettings &s
QVector<QTextBlock> 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()) {

View File

@@ -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;

View File

@@ -468,7 +468,6 @@ struct PaintEventBlockData
{
QRectF boundingRect;
QVector<QTextLayout::FormatRange> selections;
QVector<QTextLayout::FormatRange> 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<QTextLayout::FormatRange> 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,

View File

@@ -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

View File

@@ -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",