Merge remote-tracking branch 'origin/4.12'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp Change-Id: I34c3d1fd5be90537e37d15e00b1a0d455d1bf81d
6
.github/workflows/build_cmake.yml
vendored
@@ -3,10 +3,10 @@ name: CMake Build Matrix
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
QT_VERSION: 5.14.1
|
||||
QT_VERSION: 5.14.2
|
||||
CLANG_VERSION: 80
|
||||
CMAKE_VERSION: 3.16.3
|
||||
NINJA_VERSION: 1.9.0
|
||||
CMAKE_VERSION: 3.17.0
|
||||
NINJA_VERSION: 1.10.0
|
||||
BUILD_TYPE: Release
|
||||
CCACHE_VERSION: 3.7.7
|
||||
GOOGLETEST_VERSION: 1.10.0
|
||||
|
@@ -719,6 +719,7 @@ function(add_qtc_plugin target_name)
|
||||
string(REPLACE "$$QTCREATOR_VERSION" "\${IDE_VERSION}" plugin_json_in ${plugin_json_in})
|
||||
string(REPLACE "$$QTCREATOR_COMPAT_VERSION" "\${IDE_VERSION_COMPAT}" plugin_json_in ${plugin_json_in})
|
||||
string(REPLACE "$$QTCREATOR_COPYRIGHT_YEAR" "\${IDE_COPYRIGHT_YEAR}" plugin_json_in ${plugin_json_in})
|
||||
string(REPLACE "$$QTC_PLUGIN_REVISION" "\${QTC_PLUGIN_REVISION}" plugin_json_in ${plugin_json_in})
|
||||
string(REPLACE "$$dependencyList" "\${IDE_PLUGIN_DEPENDENCY_STRING}" plugin_json_in ${plugin_json_in})
|
||||
if(_arg_PLUGIN_JSON_IN)
|
||||
#e.g. UPDATEINFO_EXPERIMENTAL_STR=true
|
||||
|
6
dist/installer/mac/entitlements.plist
vendored
@@ -6,5 +6,11 @@
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.automation.apple-events</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
@@ -47,13 +47,20 @@
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
Page {
|
||||
id: page
|
||||
width: 600
|
||||
height: 400
|
||||
property alias mouseArea2: mouseArea2
|
||||
property alias mouseArea1: mouseArea1
|
||||
property alias mouseArea: mouseArea
|
||||
property alias icon: icon
|
||||
property alias bottomLeftRect: bottomLeftRect
|
||||
property alias middleRightRect: middleRightRect
|
||||
property alias topLeftRect: topLeftRect
|
||||
|
||||
header: Label {
|
||||
text: qsTr("Page 1")
|
||||
@@ -61,20 +68,12 @@ Page {
|
||||
padding: 10
|
||||
}
|
||||
|
||||
property alias icon: icon
|
||||
property alias topLeftRect: topLeftRect
|
||||
property alias bottomLeftRect: bottomLeftRect
|
||||
property alias middleRightRect: middleRightRect
|
||||
|
||||
property alias mouseArea2: mouseArea2
|
||||
property alias mouseArea1: mouseArea1
|
||||
property alias mouseArea: mouseArea
|
||||
|
||||
Image {
|
||||
id: icon
|
||||
x: 10
|
||||
y: 20
|
||||
source: "qt-logo.png"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -82,11 +81,11 @@ Page {
|
||||
width: 55
|
||||
height: 41
|
||||
color: "#00000000"
|
||||
border.color: "#808080"
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 20
|
||||
border.color: "#808080"
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
@@ -99,10 +98,10 @@ Page {
|
||||
width: 55
|
||||
height: 41
|
||||
color: "#00000000"
|
||||
border.color: "#808080"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
border.color: "#808080"
|
||||
MouseArea {
|
||||
id: mouseArea1
|
||||
anchors.fill: parent
|
||||
@@ -114,14 +113,26 @@ Page {
|
||||
width: 55
|
||||
height: 41
|
||||
color: "#00000000"
|
||||
border.color: "#808080"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 20
|
||||
border.color: "#808080"
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
MouseArea {
|
||||
id: mouseArea2
|
||||
anchors.fill: parent
|
||||
}
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
id: numberAnimation
|
||||
}
|
||||
}
|
||||
|
||||
/*##^##
|
||||
Designer {
|
||||
D{i:0;formeditorZoom:0.75}D{i:4;anchors_height:100;anchors_width:100}D{i:6;anchors_height:100;anchors_width:100}
|
||||
D{i:8;anchors_height:100;anchors_width:100}
|
||||
}
|
||||
##^##*/
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
@@ -47,8 +47,8 @@
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
Page {
|
||||
width: 600
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
@@ -47,20 +47,28 @@
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
|
||||
qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
|
||||
qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
|
||||
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
}
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
if (engine.rootObjects().isEmpty())
|
||||
return -1;
|
||||
const QUrl url(QStringLiteral("qrc:/main.qml"));
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
||||
if (!obj && url == objUrl)
|
||||
QCoreApplication::exit(-1);
|
||||
}, Qt::QueuedConnection);
|
||||
engine.load(url);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
@@ -47,9 +47,8 @@
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.5
|
||||
|
||||
ApplicationWindow {
|
||||
visible: true
|
||||
@@ -64,7 +63,6 @@ ApplicationWindow {
|
||||
|
||||
Page1Form {
|
||||
id: page
|
||||
|
||||
mouseArea {
|
||||
onClicked: stateGroup.state = ' '
|
||||
}
|
||||
@@ -102,6 +100,7 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "*"; to: "State1"
|
||||
|
@@ -1,18 +1,20 @@
|
||||
QT += quick
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Refer to the documentation for the
|
||||
# deprecated API to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += main.cpp
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
@@ -26,3 +28,5 @@ QML_DESIGNER_IMPORT_PATH =
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
DISTFILES +=
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 233 KiB After Width: | Height: | Size: 205 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 14 KiB |
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -59,15 +59,15 @@
|
||||
\image qtcreator-gs-build-example-open.png "Selecting an example"
|
||||
|
||||
If no examples are listed, check that a \l{Adding Qt Versions}
|
||||
{Qt version} is installed and configured.
|
||||
{Qt version} (2) is installed and configured. If you select a Qt
|
||||
for Android or iOS, only the examples tested for Android or iOS
|
||||
are listed.
|
||||
|
||||
\li Select an example in the list of examples.
|
||||
|
||||
You can also search for examples. Enter the \uicontrol android or
|
||||
\uicontrol ios keyword in the search field (2) to list all the
|
||||
examples tested for Android or iOS. To list examples that you can
|
||||
run on embedded devices, enter the \uicontrol Boot2Qt keyword in the
|
||||
search field (commercial only).
|
||||
You can also use tags (3) to filter examples. For instance, enter
|
||||
the \uicontrol Boot2Qt tag (commercial only) in the search field
|
||||
(4) to list examples that you can run on embedded devices.
|
||||
|
||||
\li To check that the application code can be compiled and linked for a
|
||||
device, click the \uicontrol {Kit Selector} and select a
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -72,14 +72,17 @@
|
||||
|
||||
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
|
||||
|
||||
\note If a view is hidden, you can show it by selecting
|
||||
\uicontrol Window > \uicontrol Views.
|
||||
|
||||
\li In the \uicontrol Navigator, select \uicontrol Label and press
|
||||
\key Delete to delete it.
|
||||
|
||||
\li Select \uicontrol Page in the navigator, and enter \e page in the
|
||||
\uicontrol Id field.
|
||||
\li Select \uicontrol Page in \uicontrol Navigator, and enter \e page in
|
||||
the \uicontrol Id field in the \uicontrol Properties view.
|
||||
|
||||
\li In \uicontrol Library > \uicontrol Assets, select qt-logo.png and
|
||||
drag and drop it to the \e page in the navigator.
|
||||
drag and drop it to the \e page in \uicontrol Navigator.
|
||||
|
||||
\image qmldesigner-tutorial-user-icon.png "Image properties"
|
||||
|
||||
@@ -92,12 +95,14 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\li Right-click the resource file, qml.qrc, in the \uicontrol Projects
|
||||
view, and select \uicontrol {Add Existing File} to add qt-logo.png
|
||||
to the resource file for deployment.
|
||||
\li In the \uicontrol Projects view, right-click the resource file,
|
||||
qml.qrc, and select \uicontrol {Add Existing File} to add
|
||||
qt-logo.png to the resource file for deployment.
|
||||
|
||||
\li Drag and drop a \uicontrol Rectangle to \e page in the navigator and
|
||||
edit its properties.
|
||||
\li In \uicontrol Library > \uicontrol {QML Types} >
|
||||
\uicontrol {Qt Quick - Basic}, select \uicontrol Rectangle,
|
||||
drag and drop it to \e page in \uicontrol Navigator, and
|
||||
edit its properties in the \uicontrol Properties view.
|
||||
|
||||
\image qmldesigner-tutorial-topleftrect.png "Rectangle properties"
|
||||
|
||||
@@ -131,7 +136,7 @@
|
||||
\endlist
|
||||
|
||||
\li Drag and drop a \uicontrol {Mouse Area} type from the
|
||||
\uicontrol Library to \e topLeftRect in the navigator.
|
||||
\uicontrol Library to \e topLeftRect in \uicontrol Navigator.
|
||||
|
||||
\li Click \uicontrol {Layout}, and then click the
|
||||
\inlineimage anchor-fill.png
|
||||
@@ -139,9 +144,9 @@
|
||||
rectangle.
|
||||
|
||||
\li In the \uicontrol Navigator, copy topLeftRect (by pressing
|
||||
\key {Ctrl+C}) and paste it to the \e page in the navigator twice
|
||||
(by pressing \key {Ctrl+V}). \QC renames the new instances of the
|
||||
type topLeftRect1 and topLeftRect2.
|
||||
\key {Ctrl+C}) and paste it to \e page in \uicontrol Navigator
|
||||
twice (by pressing \key {Ctrl+V}). \QC renames the new instances
|
||||
of the type topLeftRect1 and topLeftRect2.
|
||||
|
||||
\li Select topLeftRect1 and edit its properties:
|
||||
|
||||
@@ -213,16 +218,11 @@
|
||||
|
||||
\list 1
|
||||
|
||||
\li Specify the window size and background color as properties of
|
||||
the ApplicationWindow type:
|
||||
|
||||
\quotefromfile transitions/main.qml
|
||||
\skipto ApplicationWindow
|
||||
\printuntil title
|
||||
|
||||
\li Specify an id for the Page1 type to be able to use the properties
|
||||
that you exported in \e Page1Form.ui.qml:
|
||||
|
||||
\quotefromfile transitions/main.qml
|
||||
\skipto ApplicationWindow
|
||||
\printuntil page
|
||||
|
||||
\li Add a pointer to the clicked expressions in \uicontrol mouseArea:
|
||||
|
@@ -326,6 +326,10 @@
|
||||
\uicontrol {Insert Keyframe} to add a keyframe.
|
||||
\li Select keyframes to display the easing curves attached to them.
|
||||
To select multiple keyframes, press and hold \key Ctrl.
|
||||
\li To lock an easing curve, hover the mouse over the keyframe in the
|
||||
list, and then select the lock icon.
|
||||
\li To pin an easing curve, hover the mouse over the keyframe in the
|
||||
list, and then select the pin icon.
|
||||
\endlist
|
||||
|
||||
Your changes are automatically saved when you close the editor.
|
||||
|
Before Width: | Height: | Size: 55 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-3d-default-material.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-3d-material-texture.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-3d-material.png
Normal file
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 25 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-3d-texture.png
Normal file
After Width: | Height: | Size: 79 KiB |
@@ -109,9 +109,9 @@
|
||||
them in the 3D editor.
|
||||
|
||||
\list
|
||||
\li In the \inlineimage item_selection_selected.png
|
||||
\li In the \inlineimage select_item.png
|
||||
(\uicontrol {Select Item}) mode, a single item is selected.
|
||||
\li In the \inlineimage group_selection_selected.png
|
||||
\li In the \inlineimage select_group.png
|
||||
(\uicontrol {Select Group}) mode, the top level parent of the item
|
||||
is selected. This enables you to move, rotate, or scale a group of
|
||||
items.
|
||||
@@ -127,7 +127,7 @@
|
||||
or z view axis or on the top, bottom, left, and right clip planes of the
|
||||
render camera.
|
||||
|
||||
To move items, select \inlineimage move_selected.png
|
||||
To move items, select \inlineimage move_on.png
|
||||
or press \key W.
|
||||
|
||||
To move items along an axis, click the axis and drag the item along the
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
\image studio-3d-editor-rotate.png "3D editor in rotate mode"
|
||||
|
||||
To rotate items, select \inlineimage rotate_selected.png
|
||||
To rotate items, select \inlineimage rotate_on.png
|
||||
or press \key E.
|
||||
|
||||
To rotate an item around an axis, select the axis and drag in the direction
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
\image studio-3d-editor-scale.png "3D editor in scale mode"
|
||||
|
||||
To scale items, select \inlineimage scale_selected.png
|
||||
To scale items, select \inlineimage scale_on.png
|
||||
or press \key R.
|
||||
|
||||
You can use the scale handles to adjust the local x, y, or z scale of an
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Desing Studio.
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
\title Using Materials and Shaders
|
||||
|
||||
\image materials.png
|
||||
\image studio-qtquick-3d-material.png "Material attached to model in Design mode"
|
||||
|
||||
Materials and shaders define how object surfaces are rendered in \QDS and
|
||||
live preview. As you change the properties of materials, new shaders are
|
||||
@@ -49,27 +49,31 @@
|
||||
\list
|
||||
\li Default material
|
||||
\li Principled material
|
||||
\li Custom material
|
||||
\li Texture
|
||||
\endlist
|
||||
|
||||
Before a model can be rendered in a scene, it must have at least one
|
||||
material to define how the mesh is shaded. The DefaultMaterial component
|
||||
is the easiest way to define such a material. The PrincipledMaterial
|
||||
component specifies the minimum amount of properties.
|
||||
component specifies the minimum amount of properties. The CustomMaterial
|
||||
component enables you to access the Qt Quick 3D material library and
|
||||
to implement your own materials.
|
||||
|
||||
You can use the \l Texture component to apply textures to materials. It
|
||||
defines an image and how the image is mapped to meshes in a 3D scene. To
|
||||
use image data from a file, set the \uicontrol Source property of the
|
||||
Texture component in the \uicontrol Properties view.
|
||||
|
||||
To have the material use vertex colors from the mesh, select the
|
||||
\uicontrol {Enable vertex colors} check box. These are multiplied
|
||||
by any other colors specified for the material.
|
||||
defines an image and how the image is mapped to meshes in a 3D scene. For
|
||||
more information, see \l {Attaching Textures to Materials}.
|
||||
|
||||
You can modify material properties in the \uicontrol Properties view, as
|
||||
instructed in the following sections. The availability of the properties
|
||||
depends on the material type.
|
||||
|
||||
\image studio-qtquick-3d-default-material.png "DefaultMaterial properties"
|
||||
|
||||
To enable the material to use vertex colors from the mesh, select the
|
||||
\uicontrol {Enable vertex colors} check box. These are multiplied
|
||||
by any other colors specified for the material.
|
||||
|
||||
You can animate material properties in the \uicontrol Timeline view, as
|
||||
instructed in \l {Creating Animations}.
|
||||
|
||||
@@ -216,14 +220,41 @@
|
||||
is not rendered. Culling makes rendering objects quicker and more efficient
|
||||
by reducing the number of polygons to draw.
|
||||
|
||||
\section1 Creating Custom Materials
|
||||
|
||||
The material uses a Shader component to specify shader source and shader
|
||||
stage. These are used with the \uicontrol passes property to create the
|
||||
resulting material. The passes can contain multiple rendering passes and
|
||||
also other commands.
|
||||
|
||||
Normally, only the fragment shader needs to be specified as a value for
|
||||
the \uicontrol passes property. The material library generates the vertex
|
||||
shader for the material. The material can also create buffers to store
|
||||
intermediate rendering results.
|
||||
|
||||
The \uicontrol shaderInfo property specifies settings for the shader.
|
||||
|
||||
To specify that the material state is always dirty, which indicates that
|
||||
the material needs to be refreshed every time it is used, select the
|
||||
\uicontrol alwaysDirty check box.
|
||||
|
||||
To specify that the material has refraction, select the
|
||||
\uicontrol hasRefraction check box.
|
||||
|
||||
To specify that the material has transparency, select the
|
||||
\uicontrol hasTransparency check box.
|
||||
|
||||
\section1 Applying Materials to Models
|
||||
|
||||
To apply materials to models:
|
||||
|
||||
\list 1
|
||||
\li Drag and drop a material component from the \uicontrol Library to a
|
||||
Model component in the \uicontrol Navigator or 3D editor.
|
||||
\li Edit the properties of the material in the \uicontrol Properties
|
||||
view.
|
||||
Model component in the \uicontrol Navigator.
|
||||
\li Select the Model component.
|
||||
\li In the \uicontrol Properties view, select the material for the model
|
||||
in the \uicontrol Materials list.
|
||||
\li Select the material component to edit the properties of the material
|
||||
in the \uicontrol Properties view.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -36,6 +36,8 @@
|
||||
You can use the Texture 3D QML type to attach textures to materials.
|
||||
You specify an image and how it is mapped to meshes in a 3D scene.
|
||||
|
||||
\image studio-qtquick-3d-texture.png "Texture attached to a material in Design mode"
|
||||
|
||||
\section1 Selecting the Mapping Method
|
||||
|
||||
To specify the method of mapping to use when sampling a texture, select
|
||||
@@ -108,4 +110,24 @@
|
||||
|
||||
For more information about rotating and pivoting components in the local
|
||||
coordinate space, see \l {Setting Transform Properties}.
|
||||
|
||||
\section1 Applying Textures to Materials
|
||||
|
||||
You drag and drop an image from \uicontrol Library > \uicontrol Assets
|
||||
on a material to create and set the texture automatically, or you can use
|
||||
a Texture component.
|
||||
|
||||
To use Texture components to apply textures to materials:
|
||||
|
||||
\list 1
|
||||
\li Drag and drop a Texture component from the \uicontrol Library to a
|
||||
material component in the \uicontrol Navigator.
|
||||
\li In the \uicontrol Properties view, specify the image to use in the
|
||||
\uicontrol Source field.
|
||||
\image studio-qtquick-3d-texture-properties.png "Texture properties"
|
||||
\li Select the material component and specify the id of the texture to
|
||||
use in the \uicontrol Properties view, \uicontrol {Diffuse map}
|
||||
field.
|
||||
\image studio-qtquick-3d-material-texture.png "Material properties"
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -35,8 +35,28 @@ StudioControls.ComboBox {
|
||||
labelColor: edit && !colorLogic.errorState ? StudioTheme.Values.themeTextColor : colorLogic.textColor
|
||||
property string scope: "Qt"
|
||||
|
||||
enum ValueType { String, Integer, Enum }
|
||||
property int valueType: ComboBox.ValueType.Enum
|
||||
|
||||
onValueTypeChanged: {
|
||||
if (comboBox.valueType === ComboBox.ValueType.Integer)
|
||||
comboBox.useInteger = true
|
||||
else
|
||||
comboBox.useInteger = false
|
||||
}
|
||||
|
||||
// This property shouldn't be used anymore, valueType has come to replace it.
|
||||
property bool useInteger: false
|
||||
|
||||
onUseIntegerChanged: {
|
||||
if (comboBox.useInteger) {
|
||||
comboBox.valueType = ComboBox.ValueType.Integer
|
||||
} else {
|
||||
if (comboBox.valueType === ComboBox.ValueType.Integer)
|
||||
comboBox.valueType = ComboBox.ValueType.Enum // set to default
|
||||
}
|
||||
}
|
||||
|
||||
property bool __isCompleted: false
|
||||
|
||||
property bool manualMapping: false
|
||||
@@ -75,7 +95,18 @@ StudioControls.ComboBox {
|
||||
|
||||
if (comboBox.manualMapping) {
|
||||
comboBox.valueFromBackendChanged()
|
||||
} else if (!comboBox.useInteger) {
|
||||
} else {
|
||||
switch (comboBox.valueType) {
|
||||
case ComboBox.ValueType.String:
|
||||
if (comboBox.currentText !== comboBox.backendValue.value)
|
||||
comboBox.currentText = comboBox.backendValue.value
|
||||
break
|
||||
case ComboBox.ValueType.Integer:
|
||||
if (comboBox.currentIndex !== comboBox.backendValue.value)
|
||||
comboBox.currentIndex = comboBox.backendValue.value
|
||||
break
|
||||
case ComboBox.ValueType.Enum:
|
||||
default:
|
||||
var enumString = comboBox.backendValue.enumeration
|
||||
|
||||
if (enumString === "")
|
||||
@@ -88,10 +119,7 @@ StudioControls.ComboBox {
|
||||
|
||||
if (index !== comboBox.currentIndex)
|
||||
comboBox.currentIndex = index
|
||||
|
||||
} else {
|
||||
if (comboBox.currentIndex !== comboBox.backendValue.value)
|
||||
comboBox.currentIndex = comboBox.backendValue.value
|
||||
}
|
||||
}
|
||||
|
||||
comboBox.block = false
|
||||
@@ -108,10 +136,16 @@ StudioControls.ComboBox {
|
||||
if (comboBox.manualMapping)
|
||||
return
|
||||
|
||||
if (!comboBox.useInteger) {
|
||||
comboBox.backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
|
||||
} else {
|
||||
switch (comboBox.valueType) {
|
||||
case ComboBox.ValueType.String:
|
||||
comboBox.backendValue.value = comboBox.currentText
|
||||
break
|
||||
case ComboBox.ValueType.Integer:
|
||||
comboBox.backendValue.value = comboBox.currentIndex
|
||||
break
|
||||
case ComboBox.ValueType.Enum:
|
||||
default:
|
||||
comboBox.backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -223,6 +223,10 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Tooltip {
|
||||
id: myTooltip
|
||||
}
|
||||
|
||||
Component {
|
||||
id: component
|
||||
Item {
|
||||
@@ -241,9 +245,9 @@ Item {
|
||||
if (showToolTip) {
|
||||
var currentPoint = Qt.point(gradientStopHandleMouseArea.mouseX, gradientStopHandleMouseArea.mouseY);
|
||||
var fixedGradiantStopPosition = currentGradiantStopPosition();
|
||||
Tooltip.showText(gradientStopHandleMouseArea, currentPoint, fixedGradiantStopPosition.toFixed(3));
|
||||
myTooltip.showText(gradientStopHandleMouseArea, currentPoint, fixedGradiantStopPosition.toFixed(3));
|
||||
} else {
|
||||
Tooltip.hideText()
|
||||
myTooltip.hideText()
|
||||
}
|
||||
}
|
||||
function currentGradiantStopPosition() {
|
||||
|
@@ -50,13 +50,14 @@ Item {
|
||||
}
|
||||
|
||||
ActionIndicator {
|
||||
anchors.left: grid.right
|
||||
anchors.right: grid.left
|
||||
anchors.leftMargin: grid.spacing
|
||||
|
||||
visible: originControl.enabled
|
||||
icon.color: extFuncLogic.color
|
||||
icon.text: extFuncLogic.glyph
|
||||
onClicked: extFuncLogic.show()
|
||||
forceVisible: true
|
||||
}
|
||||
|
||||
ColorLogic {
|
||||
@@ -71,6 +72,7 @@ Item {
|
||||
}
|
||||
|
||||
Grid {
|
||||
x: StudioTheme.Values.squareComponentWidth
|
||||
opacity: originControl.enabled ? 1 : 0.5
|
||||
rows: 3
|
||||
columns: 3
|
||||
|
@@ -45,6 +45,11 @@ T.AbstractButton {
|
||||
z: myButton.checked ? 10 : 3
|
||||
activeFocusOnTab: false
|
||||
|
||||
onHoveredChanged: {
|
||||
if (parent !== undefined && parent.hover !== undefined)
|
||||
parent.hover = hovered
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: buttonBackground
|
||||
color: myButton.checked ? StudioTheme.Values.themeControlBackgroundChecked : StudioTheme.Values.themeControlBackground
|
||||
|
@@ -46,12 +46,16 @@ Rectangle {
|
||||
implicitHeight: StudioTheme.Values.height
|
||||
|
||||
signal clicked
|
||||
z: 10
|
||||
|
||||
T.Label {
|
||||
id: actionIndicatorIcon
|
||||
anchors.fill: parent
|
||||
text: StudioTheme.Constants.actionIcon
|
||||
visible: text != StudioTheme.Constants.actionIcon || actionIndicator.forceVisible
|
||||
visible: text !== StudioTheme.Constants.actionIcon || actionIndicator.forceVisible
|
||||
|| (myControl !== undefined &&
|
||||
((myControl.edit !== undefined && myControl.edit)
|
||||
|| (myControl.hover !== undefined && myControl.hover)))
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.family: StudioTheme.Constants.iconFont.family
|
||||
font.pixelSize: StudioTheme.Values.myIconFontSize
|
||||
@@ -92,7 +96,7 @@ Rectangle {
|
||||
states: [
|
||||
State {
|
||||
name: "default"
|
||||
when: myControl.enabled && !actionIndicator.hover
|
||||
when: myControl !== undefined && myControl.enabled && !actionIndicator.hover
|
||||
&& !actionIndicator.pressed && !myControl.hover
|
||||
&& !myControl.edit && !myControl.drag && actionIndicator.showBackground
|
||||
PropertyChanges {
|
||||
@@ -103,18 +107,21 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "globalHover"
|
||||
when: myControl.hover && !actionIndicator.hover
|
||||
&& !actionIndicator.pressed && !myControl.edit
|
||||
when: myControl !== undefined && myControl.hover !== undefined
|
||||
&& myControl.hover && !actionIndicator.hover && !actionIndicator.pressed
|
||||
&& myControl.edit !== undefined && !myControl.edit && myControl.drag !== undefined
|
||||
&& !myControl.drag && actionIndicator.showBackground
|
||||
PropertyChanges {
|
||||
target: actionIndicator
|
||||
color: StudioTheme.Values.themeHoverHighlight
|
||||
border.color: StudioTheme.Values.themeControlOutline
|
||||
}
|
||||
|
||||
},
|
||||
State {
|
||||
name: "edit"
|
||||
when: myControl.edit && actionIndicator.showBackground
|
||||
when: myControl !== undefined && myControl.edit !== undefined
|
||||
&& myControl.edit && actionIndicator.showBackground
|
||||
PropertyChanges {
|
||||
target: actionIndicator
|
||||
color: StudioTheme.Values.themeFocusEdit
|
||||
@@ -123,7 +130,8 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "drag"
|
||||
when: myControl.drag && actionIndicator.showBackground
|
||||
when: myControl !== undefined && myControl.drag !== undefined
|
||||
&& myControl.drag && actionIndicator.showBackground
|
||||
PropertyChanges {
|
||||
target: actionIndicator
|
||||
color: StudioTheme.Values.themeFocusDrag
|
||||
@@ -132,7 +140,7 @@ Rectangle {
|
||||
},
|
||||
State {
|
||||
name: "disabled"
|
||||
when: !myControl.enabled && actionIndicator.showBackground
|
||||
when: myControl !== undefined && !myControl.enabled && actionIndicator.showBackground
|
||||
PropertyChanges {
|
||||
target: actionIndicator
|
||||
color: StudioTheme.Values.themeControlBackgroundDisabled
|
||||
|
@@ -29,8 +29,9 @@ import QtQuick.Templates 2.12 as T
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
Row {
|
||||
// TODO When using Item as root it won't react to outer layout
|
||||
id: myButtonGroup
|
||||
id: myButtonRow
|
||||
|
||||
property bool hover: false
|
||||
|
||||
property alias actionIndicator: actionIndicator
|
||||
|
||||
@@ -40,12 +41,12 @@ Row {
|
||||
|
||||
ActionIndicator {
|
||||
id: actionIndicator
|
||||
myControl: myButtonGroup // TODO global hover issue. Can be solved with extra property in ActionIndicator
|
||||
myControl: myButtonRow
|
||||
x: 0
|
||||
y: 0
|
||||
width: actionIndicator.visible ? __actionIndicatorWidth : 0
|
||||
height: actionIndicator.visible ? __actionIndicatorHeight : 0
|
||||
}
|
||||
|
||||
spacing: -StudioTheme.Values.border // TODO Which one is better? Spacing vs. layout function. ALso depends on root item
|
||||
spacing: -StudioTheme.Values.border
|
||||
}
|
||||
|
@@ -193,7 +193,6 @@ TextInput {
|
||||
PropertyChanges {
|
||||
target: mouseArea
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
State {
|
||||
|
@@ -179,7 +179,7 @@ FilePath StLinkUvscServerProvider::optionsFilePath(DebuggerRunTool *runTool,
|
||||
const StLinkUvProjectOptions projectOptions(this);
|
||||
if (!writer.write(&projectOptions)) {
|
||||
errorMessage = BareMetalDebugSupport::tr(
|
||||
"Unable to create an uVision project options template");
|
||||
"Unable to create a uVision project options template.");
|
||||
return {};
|
||||
}
|
||||
return optionsPath;
|
||||
|
@@ -2,7 +2,6 @@
|
||||
\"Name\" : \"Boot2Qt\",
|
||||
\"Version\" : \"$$QTCREATOR_VERSION\",
|
||||
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
|
||||
\"Revision\" : \"$$QTC_PLUGIN_REVISION\",
|
||||
\"DisabledByDefault\" : true,
|
||||
\"Vendor\" : \"The Qt Company Ltd\",
|
||||
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
|
||||
|
@@ -70,7 +70,6 @@ const char CONFIGURATION_KEY[] = "CMake.Configuration";
|
||||
CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Core::Id id)
|
||||
: BuildConfiguration(target, id)
|
||||
{
|
||||
m_buildSystem = new CMakeBuildSystem(this);
|
||||
setBuildDirectory(shadowBuildDirectory(project()->projectFilePath(),
|
||||
target->kit(),
|
||||
displayName(),
|
||||
@@ -155,6 +154,9 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Core::Id id)
|
||||
}
|
||||
|
||||
setConfigurationForCMake(config);
|
||||
|
||||
// Only do this after everything has been set up!
|
||||
m_buildSystem = new CMakeBuildSystem(this);
|
||||
});
|
||||
|
||||
const auto qmlDebuggingAspect = addAspect<QtSupport::QmlDebuggingAspect>();
|
||||
@@ -162,6 +164,11 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Core::Id id)
|
||||
connect(qmlDebuggingAspect, &QtSupport::QmlDebuggingAspect::changed,
|
||||
this, &CMakeBuildConfiguration::configurationForCMakeChanged);
|
||||
|
||||
// m_buildSystem is still nullptr here since it the build directory to be available
|
||||
// before it can get created.
|
||||
//
|
||||
// This means this needs to be done in the lambda for the setInitializer(...) call
|
||||
// defined above as well as in fromMap!
|
||||
}
|
||||
|
||||
CMakeBuildConfiguration::~CMakeBuildConfiguration()
|
||||
@@ -180,6 +187,8 @@ QVariantMap CMakeBuildConfiguration::toMap() const
|
||||
|
||||
bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
{
|
||||
QTC_CHECK(!m_buildSystem);
|
||||
|
||||
if (!BuildConfiguration::fromMap(map))
|
||||
return false;
|
||||
|
||||
@@ -190,6 +199,8 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
|
||||
setConfigurationForCMake(conf);
|
||||
|
||||
m_buildSystem = new CMakeBuildSystem(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -213,10 +213,6 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to initial CMake BuildSystem setup";
|
||||
m_buildDirManager.setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
BuildDirManager::REPARSE_CHECK_CONFIGURATION);
|
||||
}
|
||||
|
||||
CMakeBuildSystem::~CMakeBuildSystem()
|
||||
|
@@ -309,15 +309,13 @@ static QStringList splitFragments(const QStringList &fragments)
|
||||
}
|
||||
|
||||
RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
||||
const FilePath &sourceDirectory,
|
||||
const FilePath &buildDirectory)
|
||||
const FilePath &sourceDirectory)
|
||||
{
|
||||
RawProjectParts rpps;
|
||||
|
||||
int counter = 0;
|
||||
for (const TargetDetails &t : input.targetDetails) {
|
||||
QDir sourceDir(sourceDirectory.toString());
|
||||
QDir buildDir(buildDirectory.toString());
|
||||
|
||||
bool needPostfix = t.compileGroups.size() > 1;
|
||||
int count = 1;
|
||||
@@ -371,11 +369,7 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
||||
}));
|
||||
if (!precompiled_header.isEmpty()) {
|
||||
if (precompiled_header.toFileInfo().isRelative()) {
|
||||
const FilePath parentDir = FilePath::fromString(buildDir.absolutePath());
|
||||
const QString dirName = buildDir.dirName();
|
||||
if (precompiled_header.startsWith(dirName))
|
||||
precompiled_header = FilePath::fromString(
|
||||
precompiled_header.toString().mid(dirName.length() + 1));
|
||||
const FilePath parentDir = FilePath::fromString(sourceDir.absolutePath());
|
||||
precompiled_header = parentDir.pathAppended(precompiled_header.toString());
|
||||
}
|
||||
rpp.setPreCompiledHeaders({precompiled_header.toString()});
|
||||
@@ -674,7 +668,7 @@ FileApiQtcData extractData(FileApiData &input,
|
||||
|
||||
result.buildTargets = generateBuildTargets(data, sourceDirectory, buildDirectory);
|
||||
result.cmakeFiles = std::move(data.cmakeFiles);
|
||||
result.projectParts = generateRawProjectParts(data, sourceDirectory, buildDirectory);
|
||||
result.projectParts = generateRawProjectParts(data, sourceDirectory);
|
||||
|
||||
auto pair = generateRootProjectNode(data, sourceDirectory, buildDirectory);
|
||||
result.rootProjectNode = std::move(pair.first);
|
||||
|
@@ -53,6 +53,9 @@ public:
|
||||
void ensureSizeHintAsMinimum();
|
||||
int nonMaximizedSize() const;
|
||||
|
||||
signals:
|
||||
void visibilityChangeRequested(bool visible);
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void showEvent(QShowEvent *) override;
|
||||
|
@@ -612,6 +612,7 @@ void OutputPaneManager::slotHide()
|
||||
{
|
||||
OutputPanePlaceHolder *ph = OutputPanePlaceHolder::getCurrent();
|
||||
if (ph) {
|
||||
emit ph->visibilityChangeRequested(false);
|
||||
ph->setVisible(false);
|
||||
int idx = currentIndex();
|
||||
QTC_ASSERT(idx >= 0, return);
|
||||
@@ -654,6 +655,7 @@ void OutputPaneManager::showPage(int idx, int flags)
|
||||
if (onlyFlash) {
|
||||
g_outputPanes.at(idx).button->flash();
|
||||
} else {
|
||||
emit ph->visibilityChangeRequested(true);
|
||||
// make the page visible
|
||||
ph->setVisible(true);
|
||||
|
||||
|
@@ -2,7 +2,6 @@
|
||||
\"Name\" : \"CtfVisualizer\",
|
||||
\"Version\" : \"$$QTCREATOR_VERSION\",
|
||||
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
|
||||
\"Revision\" : \"$$QTC_PLUGIN_REVISION\",
|
||||
\"Vendor\" : \"KDAB Group, www.kdab.com\",
|
||||
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com\",
|
||||
\"License\" : [ \"Commercial Usage\",
|
||||
|
@@ -34,6 +34,7 @@ const char RUNCONFIGURATION[] = "McuSupport.RunConfiguration";
|
||||
const char SETTINGS_ID[] = "CC.McuSupport.Configuration";
|
||||
const char KIT_MCUTARGET_VENDOR_KEY[] = "McuSupport.McuTargetVendor";
|
||||
const char KIT_MCUTARGET_MODEL_KEY[] = "McuSupport.McuTargetModel";
|
||||
const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion";
|
||||
|
||||
const char SETTINGS_GROUP[] = "McuSupport";
|
||||
const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_";
|
||||
|
@@ -404,6 +404,12 @@ void McuSupportOptions::deletePackagesAndTargets()
|
||||
mcuTargets.clear();
|
||||
}
|
||||
|
||||
const QVersionNumber &McuSupportOptions::supportedQulVersion()
|
||||
{
|
||||
static const QVersionNumber v({1, 1, 0});
|
||||
return v;
|
||||
}
|
||||
|
||||
void McuSupportOptions::setQulDir(const Utils::FilePath &dir)
|
||||
{
|
||||
deletePackagesAndTargets();
|
||||
@@ -443,6 +449,8 @@ static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k,
|
||||
k->setUnexpandedDisplayName(kitName);
|
||||
k->setValue(Constants::KIT_MCUTARGET_VENDOR_KEY, mcuTarget->vendor());
|
||||
k->setValue(Constants::KIT_MCUTARGET_MODEL_KEY, mcuTarget->qulPlatform());
|
||||
k->setValue(Constants::KIT_MCUTARGET_SDKVERSION_KEY,
|
||||
McuSupportOptions::supportedQulVersion().toString());
|
||||
k->setAutoDetected(true);
|
||||
k->makeSticky();
|
||||
if (mcuTargetIsDesktop(mcuTarget)) {
|
||||
@@ -539,8 +547,8 @@ QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const
|
||||
const QString colorDepth = mcuTarget->colorDepth() > 0
|
||||
? QString::fromLatin1(" %1bpp").arg(mcuTarget->colorDepth())
|
||||
: "";
|
||||
return QString::fromLatin1("Qt for MCUs - %1%2")
|
||||
.arg(mcuTarget->qulPlatform(), colorDepth);
|
||||
return QString::fromLatin1("Qt for MCUs %1 - %2%3")
|
||||
.arg(supportedQulVersion().toString(), mcuTarget->qulPlatform(), colorDepth);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTargt)
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
#include <QVersionNumber>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||
|
||||
@@ -170,6 +171,8 @@ public:
|
||||
static void registerQchFiles();
|
||||
static void registerExamples();
|
||||
|
||||
static const QVersionNumber &supportedQulVersion();
|
||||
|
||||
private:
|
||||
void deletePackagesAndTargets();
|
||||
|
||||
|
@@ -2,7 +2,6 @@
|
||||
\"Name\" : \"PerfProfiler\",
|
||||
\"Version\" : \"$$QTCREATOR_VERSION\",
|
||||
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
|
||||
\"Revision\" : \"$$QTC_PLUGIN_REVISION\",
|
||||
\"Vendor\" : \"The Qt Company Ltd\",
|
||||
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
|
||||
\"License\" : [ \"Commercial Usage\",
|
||||
|
@@ -1579,6 +1579,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
const RunConfiguration * const runConfig = target->activeRunConfiguration();
|
||||
QTC_ASSERT(runConfig, return);
|
||||
ProjectNode * const productNode = runConfig->productNode();
|
||||
QTC_ASSERT(productNode, return);
|
||||
QTC_ASSERT(productNode->isProduct(), return);
|
||||
productNode->build();
|
||||
});
|
||||
|
@@ -142,7 +142,13 @@ QString QbsProductNode::fullDisplayName() const
|
||||
|
||||
QString QbsProductNode::buildKey() const
|
||||
{
|
||||
return fullDisplayName();
|
||||
return getBuildKey(productData());
|
||||
}
|
||||
|
||||
QString QbsProductNode::getBuildKey(const QJsonObject &product)
|
||||
{
|
||||
return product.value("name").toString() + '.'
|
||||
+ product.value("multiplex-configuration-id").toString();
|
||||
}
|
||||
|
||||
QVariant QbsProductNode::data(Core::Id role) const
|
||||
|
@@ -63,6 +63,8 @@ public:
|
||||
QString fullDisplayName() const;
|
||||
QString buildKey() const override;
|
||||
|
||||
static QString getBuildKey(const QJsonObject &product);
|
||||
|
||||
const QJsonObject productData() const { return m_productData; }
|
||||
QJsonObject mainGroup() const;
|
||||
QVariant data(Core::Id role) const override;
|
||||
|
@@ -169,12 +169,6 @@ static bool supportsNodeAction(ProjectAction action, const Node *node)
|
||||
return false;
|
||||
}
|
||||
|
||||
static QString buildKeyValue(const QJsonObject &product)
|
||||
{
|
||||
return product.value("name").toString() + '.'
|
||||
+ product.value("multiplex-configuration-id").toString();
|
||||
}
|
||||
|
||||
QbsBuildSystem::QbsBuildSystem(QbsBuildConfiguration *bc)
|
||||
: BuildSystem(bc->target()),
|
||||
m_session(new QbsSession(this)),
|
||||
@@ -921,7 +915,7 @@ static RawProjectParts generateProjectParts(
|
||||
rpp.setProjectFileLocation(location.value("file-path").toString(),
|
||||
location.value("line").toInt(),
|
||||
location.value("column").toInt());
|
||||
rpp.setBuildSystemTarget(buildKeyValue(prd));
|
||||
rpp.setBuildSystemTarget(QbsProductNode::getBuildKey(prd));
|
||||
rpp.setBuildTargetType(prd.value("is-runnable").toBool()
|
||||
? BuildTargetType::Executable
|
||||
: BuildTargetType::Library);
|
||||
@@ -1084,7 +1078,7 @@ void QbsBuildSystem::updateApplicationTargets()
|
||||
}
|
||||
}
|
||||
BuildTargetInfo bti;
|
||||
bti.buildKey = buildKeyValue(productData);
|
||||
bti.buildKey = QbsProductNode::getBuildKey(productData);
|
||||
bti.targetFilePath = FilePath::fromString(targetFile);
|
||||
bti.projectFilePath = FilePath::fromString(projectFile);
|
||||
bti.isQtcRunnable = isQtcRunnable; // Fixed up below.
|
||||
|
@@ -123,15 +123,6 @@ private:
|
||||
QmakeProject manages information about an individual qmake project file (.pro).
|
||||
*/
|
||||
|
||||
static QtSupport::BaseQtVersion *projectIsPartOfQt(const Project *p)
|
||||
{
|
||||
FilePath filePath = p->projectFilePath();
|
||||
|
||||
return QtSupport::QtVersionManager::version([&filePath](const QtSupport::BaseQtVersion *v) {
|
||||
return v->isValid() && v->isSubProject(filePath);
|
||||
});
|
||||
}
|
||||
|
||||
QmakeProject::QmakeProject(const FilePath &fileName) :
|
||||
Project(QmakeProjectManager::Constants::PROFILE_MIMETYPE, fileName)
|
||||
{
|
||||
@@ -625,8 +616,16 @@ Tasks QmakeProject::projectIssues(const Kit *k) const
|
||||
if (!ToolChainKitAspect::cxxToolChain(k))
|
||||
result.append(createProjectTask(Task::TaskType::Error, tr("No C++ compiler set in kit.")));
|
||||
|
||||
const QtSupport::BaseQtVersion *const qtThatContainsProject = projectIsPartOfQt(this);
|
||||
if (qtThatContainsProject && qtThatContainsProject != qtFromKit) {
|
||||
// A project can be considered part of more than one Qt version, for instance if it is an
|
||||
// example shipped via the installer.
|
||||
// Report a problem if and only if the project is considered to be part of *only* a Qt
|
||||
// that is not the one from the current kit.
|
||||
const QList<BaseQtVersion *> qtsContainingThisProject
|
||||
= QtVersionManager::versions([filePath = projectFilePath()](const BaseQtVersion *qt) {
|
||||
return qt->isValid() && qt->isSubProject(filePath);
|
||||
});
|
||||
if (!qtsContainingThisProject.isEmpty()
|
||||
&& !qtsContainingThisProject.contains(const_cast<BaseQtVersion *>(qtFromKit))) {
|
||||
result.append(CompileTask(Task::Warning,
|
||||
tr("Project is part of Qt sources that do not match "
|
||||
"the Qt defined in the kit.")));
|
||||
|
@@ -259,16 +259,18 @@ void ConnectionModel::addConnection()
|
||||
ModelNode newNode = connectionView()->createModelNode("QtQuick.Connections",
|
||||
nodeMetaInfo.majorVersion(),
|
||||
nodeMetaInfo.minorVersion());
|
||||
|
||||
newNode.signalHandlerProperty("onClicked").setSource(QLatin1String("print(\"clicked\")"));
|
||||
QString source = "print(\"clicked\")";
|
||||
|
||||
if (connectionView()->selectedModelNodes().count() == 1) {
|
||||
const ModelNode selectedNode = connectionView()->selectedModelNodes().constFirst();
|
||||
ModelNode selectedNode = connectionView()->selectedModelNodes().constFirst();
|
||||
if (QmlItemNode::isValidQmlItemNode(selectedNode))
|
||||
selectedNode.nodeAbstractProperty("data").reparentHere(newNode);
|
||||
else
|
||||
rootModelNode.nodeAbstractProperty(rootModelNode.metaInfo().defaultPropertyName()).reparentHere(newNode);
|
||||
|
||||
if (QmlItemNode(selectedNode).isFlowActionArea())
|
||||
source = selectedNode.validId() + ".trigger()";
|
||||
|
||||
if (!connectionView()->selectedModelNodes().constFirst().id().isEmpty())
|
||||
newNode.bindingProperty("target").setExpression(selectedNode.id());
|
||||
else
|
||||
@@ -277,6 +279,8 @@ void ConnectionModel::addConnection()
|
||||
rootModelNode.nodeAbstractProperty(rootModelNode.metaInfo().defaultPropertyName()).reparentHere(newNode);
|
||||
newNode.bindingProperty("target").setExpression(QLatin1String("parent"));
|
||||
}
|
||||
|
||||
newNode.signalHandlerProperty("onClicked").setSource(source);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -378,6 +382,26 @@ QStringList ConnectionModel::getSignalsForRow(int row) const
|
||||
return stringList;
|
||||
}
|
||||
|
||||
QStringList ConnectionModel::getflowActionTriggerForRow(int row) const
|
||||
{
|
||||
QStringList stringList;
|
||||
SignalHandlerProperty signalHandlerProperty = signalHandlerPropertyForRow(row);
|
||||
|
||||
if (signalHandlerProperty.isValid()) {
|
||||
const ModelNode parentModelNode = signalHandlerProperty.parentModelNode();
|
||||
ModelNode targetNode = getTargetNodeForConnection(parentModelNode);
|
||||
if (!targetNode.isValid() && !parentModelNode.isRootNode())
|
||||
targetNode = parentModelNode.parentProperty().parentModelNode();
|
||||
if (targetNode.isValid()) {
|
||||
for (auto &node : targetNode.allSubModelNodesAndThisNode()) {
|
||||
if (QmlItemNode(node).isFlowActionArea() && node.hasId())
|
||||
stringList.append(node.id() + ".trigger()");
|
||||
}
|
||||
}
|
||||
}
|
||||
return stringList;
|
||||
}
|
||||
|
||||
QStringList ConnectionModel::getPossibleSignalsForConnection(const ModelNode &connection) const
|
||||
{
|
||||
QStringList stringList;
|
||||
|
@@ -54,6 +54,7 @@ public:
|
||||
ConnectionView *connectionView() const;
|
||||
|
||||
QStringList getSignalsForRow(int row) const;
|
||||
QStringList getflowActionTriggerForRow(int row) const;
|
||||
ModelNode getTargetNodeForConnection(const ModelNode &connection) const;
|
||||
|
||||
void addConnection();
|
||||
|
@@ -252,6 +252,12 @@ ConnectionDelegate::ConnectionDelegate(QWidget *parent) : ConnectionEditorDelega
|
||||
setItemEditorFactory(factory);
|
||||
}
|
||||
|
||||
static QString nameForAction(const QString &input)
|
||||
{
|
||||
QStringList list = input.split('.');
|
||||
return list.first();
|
||||
}
|
||||
|
||||
QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
|
||||
@@ -301,6 +307,11 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionVie
|
||||
QString source = QString::fromLatin1("{ %1.state = \"%2\" }").arg(rootModelNode.id()).arg(state.name());
|
||||
connectionComboBox->addItem(itemText, source);
|
||||
}
|
||||
|
||||
QStringList trigger = connectionModel->getflowActionTriggerForRow(index.row());
|
||||
for (const QString action : trigger) {
|
||||
connectionComboBox->addItem(tr("Activate FlowAction %1").arg(nameForAction(action)), action);
|
||||
}
|
||||
}
|
||||
connectionComboBox->disableValidator();
|
||||
} break;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QTextDocument>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/theme/theme.h>
|
||||
@@ -41,6 +42,8 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
const int penWidth = 2;
|
||||
|
||||
FormEditorAnnotationIcon::FormEditorAnnotationIcon(const ModelNode &modelNode, QGraphicsItem *parent)
|
||||
: QGraphicsObject(parent)
|
||||
, m_modelNode(modelNode)
|
||||
@@ -64,7 +67,7 @@ FormEditorAnnotationIcon::FormEditorAnnotationIcon(const ModelNode &modelNode, Q
|
||||
if (scene) {
|
||||
m_readerIsActive = scene->annotationVisibility();
|
||||
if (m_readerIsActive) {
|
||||
drawReader();
|
||||
createReader();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,10 +109,12 @@ void FormEditorAnnotationIcon::paint(QPainter *painter, const QStyleOptionGraphi
|
||||
m_annotation = m_modelNode.annotation();
|
||||
|
||||
if (m_readerIsActive)
|
||||
resetReader();
|
||||
drawReader();
|
||||
else
|
||||
hideReader();
|
||||
}
|
||||
else {
|
||||
hideReader();
|
||||
removeReader();
|
||||
}
|
||||
|
||||
setEnabled(hasAuxData);
|
||||
@@ -145,7 +150,7 @@ void FormEditorAnnotationIcon::setActive(bool readerStatus)
|
||||
if (m_readerIsActive)
|
||||
resetReader();
|
||||
else
|
||||
hideReader();
|
||||
removeReader();
|
||||
|
||||
update();
|
||||
}
|
||||
@@ -176,10 +181,10 @@ void FormEditorAnnotationIcon::mousePressEvent(QGraphicsSceneMouseEvent * event)
|
||||
|
||||
if (button == Qt::LeftButton) {
|
||||
if (m_readerIsActive) {
|
||||
hideReader();
|
||||
removeReader();
|
||||
m_readerIsActive = false;
|
||||
} else {
|
||||
drawReader();
|
||||
resetReader();
|
||||
m_readerIsActive = true;
|
||||
}
|
||||
}
|
||||
@@ -211,13 +216,40 @@ void FormEditorAnnotationIcon::contextMenuEvent(QGraphicsSceneContextMenuEvent *
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::resetReader()
|
||||
void FormEditorAnnotationIcon::drawReader()
|
||||
{
|
||||
if (!childItems().isEmpty()) {
|
||||
for (QGraphicsItem *item : childItems()) {
|
||||
item->show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
createReader();
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::hideReader()
|
||||
{
|
||||
if (!childItems().isEmpty()) {
|
||||
for (QGraphicsItem *item : childItems()) {
|
||||
item->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::quickResetReader()
|
||||
{
|
||||
hideReader();
|
||||
drawReader();
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::drawReader()
|
||||
void FormEditorAnnotationIcon::resetReader()
|
||||
{
|
||||
removeReader();
|
||||
createReader();
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::createReader()
|
||||
{
|
||||
const qreal width = 290;
|
||||
const qreal height = 200;
|
||||
@@ -239,48 +271,48 @@ void FormEditorAnnotationIcon::drawReader()
|
||||
QGraphicsItem *commentBubble = createCommentBubble(commentRect, comment.title(),
|
||||
comment.author(), comment.text(),
|
||||
comment.timestampStr(), this);
|
||||
commentBubble->setPos(commentPosition);
|
||||
|
||||
commentPosition += QPointF(width + offset, 0);
|
||||
comments.push_back(commentBubble);
|
||||
}
|
||||
|
||||
|
||||
int currentColumn = 0;
|
||||
qreal columnHeight = 0;
|
||||
const qreal maxHeight = 650;
|
||||
const QPointF commentsStartPosition(cornerPosition.x(), cornerPosition.y() + titleRect.height() + (offset*2));
|
||||
QPointF newPos(commentsStartPosition);
|
||||
qreal columnHeight = commentsStartPosition.y();
|
||||
|
||||
for (QGraphicsItem *comment : comments) {
|
||||
qreal itemHeight = comment->boundingRect().height();
|
||||
|
||||
if ((columnHeight + offset + itemHeight) > maxHeight) {
|
||||
// have no extra space
|
||||
columnHeight = 0;
|
||||
++currentColumn;
|
||||
comment->setPos(newPos); //first place comment in its new position, then calculate position for next comment
|
||||
|
||||
newPos = commentsStartPosition + QPointF(currentColumn * (offset + width), 0);
|
||||
} else {
|
||||
//few normal comments, lets stack them
|
||||
const qreal itemHeight = comment->boundingRect().height();
|
||||
const qreal itemWidth = comment->boundingRect().width();
|
||||
|
||||
const qreal possibleHeight = columnHeight + offset + itemHeight;
|
||||
qreal newX = 0;
|
||||
|
||||
if ((itemWidth > (width + penWidth)) || (possibleHeight > maxHeight)) {
|
||||
//move coords to the new column
|
||||
columnHeight = commentsStartPosition.y();
|
||||
newX = newPos.x() + offset + itemWidth;
|
||||
}
|
||||
else {
|
||||
//move coords lower in the same column
|
||||
columnHeight += itemHeight + offset;
|
||||
newX = newPos.x();
|
||||
}
|
||||
|
||||
columnHeight += itemHeight + offset;
|
||||
|
||||
comment->setPos(newPos);
|
||||
|
||||
newPos += QPointF(0, itemHeight + offset);
|
||||
newPos = { newX, columnHeight };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void FormEditorAnnotationIcon::hideReader()
|
||||
void FormEditorAnnotationIcon::removeReader()
|
||||
{
|
||||
if (!childItems().isEmpty())
|
||||
qDeleteAll(childItems());
|
||||
}
|
||||
|
||||
QGraphicsItem *FormEditorAnnotationIcon::createCommentBubble(const QRectF &rect, const QString &title,
|
||||
QGraphicsItem *FormEditorAnnotationIcon::createCommentBubble(QRectF rect, const QString &title,
|
||||
const QString &author, const QString &text,
|
||||
const QString &date, QGraphicsItem *parent)
|
||||
{
|
||||
@@ -313,13 +345,21 @@ QGraphicsItem *FormEditorAnnotationIcon::createCommentBubble(const QRectF &rect,
|
||||
textItem->setPos(authorItem->x(), authorItem->boundingRect().height() + authorItem->y() + 5);
|
||||
textItem->update();
|
||||
|
||||
qreal contentRect = titleItem->boundingRect().height()
|
||||
if (textItem->boundingRect().width() > textItem->textWidth()) {
|
||||
textItem->setTextWidth(textItem->boundingRect().width());
|
||||
textItem->update();
|
||||
|
||||
rect.setWidth(textItem->boundingRect().width());
|
||||
}
|
||||
|
||||
const qreal contentRect = titleItem->boundingRect().height()
|
||||
+ authorItem->boundingRect().height()
|
||||
+ textItem->boundingRect().height();
|
||||
|
||||
if ((contentRect + 60) > rect.height()) {
|
||||
frameItem->setRect(rect.x(), rect.y(), rect.width(), contentRect+60);
|
||||
}
|
||||
if ((contentRect + 60) > rect.height())
|
||||
rect.setHeight(contentRect+60);
|
||||
|
||||
frameItem->setRect(rect);
|
||||
|
||||
QGraphicsTextItem *dateItem = new QGraphicsTextItem(frameItem);
|
||||
dateItem->setPlainText(tr("Edited: ") + date);
|
||||
@@ -330,7 +370,7 @@ QGraphicsItem *FormEditorAnnotationIcon::createCommentBubble(const QRectF &rect,
|
||||
|
||||
QPen pen;
|
||||
pen.setCosmetic(true);
|
||||
pen.setWidth(2);
|
||||
pen.setWidth(penWidth);
|
||||
pen.setCapStyle(Qt::RoundCap);
|
||||
pen.setJoinStyle(Qt::BevelJoin);
|
||||
pen.setColor(frameColor);
|
||||
|
@@ -54,6 +54,7 @@ public:
|
||||
bool isReaderActive();
|
||||
void setActive(bool readerStatus);
|
||||
|
||||
void quickResetReader();
|
||||
void resetReader();
|
||||
|
||||
protected:
|
||||
@@ -68,7 +69,10 @@ protected:
|
||||
private:
|
||||
void drawReader();
|
||||
void hideReader();
|
||||
QGraphicsItem *createCommentBubble(const QRectF &rect, const QString &title,
|
||||
|
||||
void createReader();
|
||||
void removeReader();
|
||||
QGraphicsItem *createCommentBubble(QRectF rect, const QString &title,
|
||||
const QString &author, const QString &text,
|
||||
const QString &date, QGraphicsItem *parent);
|
||||
QGraphicsItem *createTitleBubble(const QRectF &rect, const QString &text, QGraphicsItem *parent);
|
||||
|
@@ -31,10 +31,8 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
ImportManagerView::ImportManagerView(QObject *parent) :
|
||||
AbstractView(parent),
|
||||
m_importsWidget(nullptr)
|
||||
|
||||
ImportManagerView::ImportManagerView(QObject *parent)
|
||||
: AbstractView(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -81,25 +79,22 @@ void ImportManagerView::modelAboutToBeDetached(Model *model)
|
||||
AbstractView::modelAboutToBeDetached(model);
|
||||
}
|
||||
|
||||
void ImportManagerView::nodeCreated(const ModelNode &/*createdNode*/)
|
||||
{
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setUsedImports(model()->usedImports());
|
||||
}
|
||||
|
||||
void ImportManagerView::nodeAboutToBeRemoved(const ModelNode &/*removedNode*/)
|
||||
{
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setUsedImports(model()->usedImports());
|
||||
}
|
||||
|
||||
void ImportManagerView::importsChanged(const QList<Import> &/*addedImports*/, const QList<Import> &/*removedImports*/)
|
||||
{
|
||||
if (m_importsWidget) {
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setImports(model()->imports());
|
||||
}
|
||||
|
||||
void ImportManagerView::possibleImportsChanged(const QList<Import> &/*possibleImports*/)
|
||||
{
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setPossibleImports(model()->possibleImports());
|
||||
}
|
||||
|
||||
void ImportManagerView::usedImportsChanged(const QList<Import> &/*usedImports*/)
|
||||
{
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setUsedImports(model()->usedImports());
|
||||
}
|
||||
}
|
||||
|
||||
void ImportManagerView::removeImport(const Import &import)
|
||||
|
@@ -35,6 +35,7 @@ class ImportsWidget;
|
||||
class ImportManagerView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ImportManagerView(QObject *parent = nullptr);
|
||||
~ImportManagerView() override;
|
||||
@@ -45,10 +46,9 @@ public:
|
||||
void modelAttached(Model *model) override;
|
||||
void modelAboutToBeDetached(Model *model) override;
|
||||
|
||||
void nodeCreated(const ModelNode &createdNode) override;
|
||||
void nodeAboutToBeRemoved(const ModelNode &removedNode) override;
|
||||
|
||||
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) override;
|
||||
void possibleImportsChanged(const QList<Import> &possibleImports) override;
|
||||
void usedImportsChanged(const QList<Import> &usedImports) override;
|
||||
|
||||
private:
|
||||
void removeImport(const Import &import);
|
||||
|
@@ -53,7 +53,7 @@ void ImportsWidget::removeImports()
|
||||
updateLayout();
|
||||
}
|
||||
|
||||
static bool isImportAlreadyUsed(const Import &import, QList<ImportLabel*> importLabels)
|
||||
static bool isImportAlreadyUsed(const Import &import, QList<ImportLabel *> importLabels)
|
||||
{
|
||||
foreach (ImportLabel *importLabel, importLabels) {
|
||||
if (importLabel->import() == import)
|
||||
@@ -101,12 +101,13 @@ void ImportsWidget::setPossibleImports(QList<Import> possibleImports)
|
||||
|
||||
const QStringList mcuWhiteList = {"QtQuick", "QtQuick.Controls"};
|
||||
|
||||
if (isQtForMCUs)
|
||||
if (isQtForMCUs) {
|
||||
filteredImports = Utils::filtered(possibleImports, [mcuWhiteList](const Import &import) {
|
||||
return mcuWhiteList.contains(import.url()) || !import.url().startsWith("Qt");
|
||||
});
|
||||
else
|
||||
} else {
|
||||
filteredImports = possibleImports;
|
||||
}
|
||||
|
||||
for (const Import &possibleImport : filteredImports) {
|
||||
if (!isImportAlreadyUsed(possibleImport, m_importLabels))
|
||||
@@ -123,7 +124,6 @@ void ImportsWidget::setUsedImports(const QList<Import> &usedImports)
|
||||
{
|
||||
foreach (ImportLabel *importLabel, m_importLabels)
|
||||
importLabel->setReadOnly(usedImports.contains(importLabel->import()));
|
||||
|
||||
}
|
||||
|
||||
void ImportsWidget::removeUsedImports()
|
||||
|
@@ -24,11 +24,13 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "propertyeditorcontextobject.h"
|
||||
#include "timelineeditor/easingcurvedialog.h"
|
||||
|
||||
#include <abstractview.h>
|
||||
#include <nodemetainfo.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <qmlobjectnode.h>
|
||||
#include <qmlmodelnodeproxy.h>
|
||||
#include <rewritingexception.h>
|
||||
|
||||
#include <coreplugin/messagebox.h>
|
||||
@@ -39,6 +41,8 @@
|
||||
#include <QCursor>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
static uchar fromHex(const uchar c, const uchar c2)
|
||||
{
|
||||
uchar rv = 0;
|
||||
@@ -406,4 +410,38 @@ void PropertyEditorContextObject::restoreCursor()
|
||||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void EasingCurveEditor::registerDeclarativeType()
|
||||
{
|
||||
qmlRegisterType<EasingCurveEditor>("HelperWidgets", 2, 0, "EasingCurveEditor");
|
||||
}
|
||||
|
||||
void EasingCurveEditor::runDialog()
|
||||
{
|
||||
if (m_modelNode.isValid())
|
||||
EasingCurveDialog::runDialog({ m_modelNode }, Core::ICore::dialogParent());
|
||||
}
|
||||
|
||||
void EasingCurveEditor::setModelNodeBackend(const QVariant &modelNodeBackend)
|
||||
{
|
||||
if (!modelNodeBackend.isNull() && modelNodeBackend.isValid()) {
|
||||
m_modelNodeBackend = modelNodeBackend;
|
||||
|
||||
const auto modelNodeBackendObject = m_modelNodeBackend.value<QObject*>();
|
||||
|
||||
const auto backendObjectCasted =
|
||||
qobject_cast<const QmlDesigner::QmlModelNodeProxy *>(modelNodeBackendObject);
|
||||
|
||||
if (backendObjectCasted) {
|
||||
m_modelNode = backendObjectCasted->qmlObjectNode().modelNode();
|
||||
}
|
||||
|
||||
emit modelNodeBackendChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QVariant EasingCurveEditor::modelNodeBackend() const
|
||||
{
|
||||
return m_modelNodeBackend;
|
||||
}
|
||||
|
||||
} //QmlDesigner
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <model.h>
|
||||
#include <modelnode.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
@@ -170,4 +171,30 @@ private:
|
||||
bool m_setHasActiveTimeline = false;
|
||||
};
|
||||
|
||||
class EasingCurveEditor : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QVariant modelNodeBackendProperty READ modelNodeBackend WRITE setModelNodeBackend NOTIFY modelNodeBackendChanged)
|
||||
|
||||
public:
|
||||
EasingCurveEditor(QObject *parent = nullptr) : QObject(parent)
|
||||
{}
|
||||
|
||||
static void registerDeclarativeType();
|
||||
Q_INVOKABLE void runDialog();
|
||||
void setModelNodeBackend(const QVariant &modelNodeBackend);
|
||||
|
||||
signals:
|
||||
void modelNodeBackendChanged();
|
||||
|
||||
private:
|
||||
QVariant modelNodeBackend() const;
|
||||
|
||||
private:
|
||||
QVariant m_modelNodeBackend;
|
||||
QmlDesigner::ModelNode m_modelNode;
|
||||
};
|
||||
|
||||
|
||||
} //QmlDesigner {
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include "qmlanchorbindingproxy.h"
|
||||
#include "theme.h"
|
||||
#include "aligndistribute.h"
|
||||
#include "propertyeditorcontextobject.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
@@ -67,6 +68,7 @@ void Quick2PropertyEditorView::registerQmlTypes()
|
||||
AnnotationEditor::registerDeclarativeType();
|
||||
AlignDistribute::registerDeclarativeType();
|
||||
Tooltip::registerDeclarativeType();
|
||||
EasingCurveEditor::registerDeclarativeType();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -229,6 +229,8 @@ public:
|
||||
virtual void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex);
|
||||
|
||||
virtual void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports);
|
||||
virtual void possibleImportsChanged(const QList<Import> &possibleImports);
|
||||
virtual void usedImportsChanged(const QList<Import> &usedImports);
|
||||
|
||||
virtual void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data);
|
||||
|
||||
|
@@ -345,6 +345,14 @@ void AbstractView::importsChanged(const QList<Import> &/*addedImports*/, const Q
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractView::possibleImportsChanged(const QList<Import> &/*possibleImports*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractView::usedImportsChanged(const QList<Import> &/*usedImports*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AbstractView::auxiliaryDataChanged(const ModelNode &/*node*/, const PropertyName &/*name*/, const QVariant &/*data*/)
|
||||
{
|
||||
}
|
||||
|
@@ -170,6 +170,22 @@ void ModelPrivate::notifyImportsChanged(const QList<Import> &addedImports, const
|
||||
resetModelByRewriter(description);
|
||||
}
|
||||
|
||||
void ModelPrivate::notifyPossibleImportsChanged(const QList<Import> &possibleImports)
|
||||
{
|
||||
for (const QPointer<AbstractView> &view : qAsConst(m_viewList)) {
|
||||
Q_ASSERT(view != nullptr);
|
||||
view->possibleImportsChanged(possibleImports);
|
||||
}
|
||||
}
|
||||
|
||||
void ModelPrivate::notifyUsedImportsChanged(const QList<Import> &usedImports)
|
||||
{
|
||||
for (const QPointer<AbstractView> &view : qAsConst(m_viewList)) {
|
||||
Q_ASSERT(view != nullptr);
|
||||
view->usedImportsChanged(usedImports);
|
||||
}
|
||||
}
|
||||
|
||||
QUrl ModelPrivate::fileUrl() const
|
||||
{
|
||||
return m_fileUrl;
|
||||
@@ -1879,14 +1895,15 @@ void Model::changeImports(const QList<Import> &importsToBeAdded, const QList<Imp
|
||||
void Model::setPossibleImports(const QList<Import> &possibleImports)
|
||||
{
|
||||
d->m_possibleImportList = possibleImports;
|
||||
d->notifyPossibleImportsChanged(possibleImports);
|
||||
}
|
||||
|
||||
void Model::setUsedImports(const QList<Import> &usedImports)
|
||||
{
|
||||
d->m_usedImportList = usedImports;
|
||||
d->notifyUsedImportsChanged(usedImports);
|
||||
}
|
||||
|
||||
|
||||
static bool compareVersions(const QString &version1, const QString &version2, bool allowHigherVersion)
|
||||
{
|
||||
if (version2.isEmpty())
|
||||
|
@@ -185,6 +185,8 @@ public:
|
||||
void removeImport(const Import &import);
|
||||
void changeImports(const QList<Import> &importsToBeAdded, const QList<Import> &importToBeRemoved);
|
||||
void notifyImportsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports);
|
||||
void notifyPossibleImportsChanged(const QList<Import> &possibleImports);
|
||||
void notifyUsedImportsChanged(const QList<Import> &usedImportsChanged);
|
||||
|
||||
|
||||
//node state property manipulation
|
||||
|
@@ -210,22 +210,6 @@ void DesignModeWidget::disableWidgets()
|
||||
m_isDisabled = true;
|
||||
}
|
||||
|
||||
bool DesignModeWidget::eventFilter(QObject *obj, QEvent *event) // TODO
|
||||
{
|
||||
if (event->type() == QEvent::Hide) {
|
||||
qDebug() << ">>> HIDE";
|
||||
m_outputPaneDockWidget->toggleView(false);
|
||||
return true;
|
||||
} else if (event->type() == QEvent::Show) {
|
||||
qDebug() << ">>> SHOW";
|
||||
m_outputPaneDockWidget->toggleView(true);
|
||||
return true;
|
||||
} else {
|
||||
// standard event processing
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
}
|
||||
|
||||
void DesignModeWidget::setup()
|
||||
{
|
||||
auto &actionManager = viewManager().designerActionManager();
|
||||
@@ -354,7 +338,8 @@ void DesignModeWidget::setup()
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
mviews->addAction(command);
|
||||
|
||||
//outputPanePlaceholder->installEventFilter(this);
|
||||
connect(outputPanePlaceholder, &Core::OutputPanePlaceHolder::visibilityChangeRequested,
|
||||
m_outputPaneDockWidget, &ADS::DockWidget::toggleView);
|
||||
}
|
||||
|
||||
// Create toolbars
|
||||
|
@@ -86,9 +86,6 @@ public:
|
||||
|
||||
static QWidget *createProjectExplorerWidget(QWidget *parent);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override;
|
||||
|
||||
private: // functions
|
||||
enum InitializeStatus { NotInitialized, Initializing, Initialized };
|
||||
|
||||
|
@@ -210,9 +210,11 @@ bool QmlJSHighlighter::maybeQmlKeyword(const QStringRef &text) const
|
||||
return true;
|
||||
else if (ch == QLatin1Char('a') && text == QLatin1String("alias"))
|
||||
return true;
|
||||
else if (ch == QLatin1Char('c') && text == QLatin1String("component"))
|
||||
return true;
|
||||
else if (ch == QLatin1Char('s') && text == QLatin1String("signal"))
|
||||
return true;
|
||||
else if (ch == QLatin1Char('r') && text == QLatin1String("readonly"))
|
||||
else if (ch == QLatin1Char('r') && (text == QLatin1String("readonly") || text == QLatin1String("required")))
|
||||
return true;
|
||||
else if (ch == QLatin1Char('i') && text == QLatin1String("import"))
|
||||
return true;
|
||||
|
@@ -2,7 +2,6 @@
|
||||
\"Name\" : \"QmlPreview\",
|
||||
\"Version\" : \"$$QTCREATOR_VERSION\",
|
||||
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
|
||||
\"Revision\" : \"$$QTC_PLUGIN_REVISION\",
|
||||
\"Vendor\" : \"The Qt Company Ltd\",
|
||||
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
|
||||
\"License\" : [ \"Commercial Usage\",
|
||||
|
@@ -2,7 +2,6 @@
|
||||
\"Name\" : \"StudioWelcome\",
|
||||
\"Version\" : \"$$QTCREATOR_VERSION\",
|
||||
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
|
||||
\"Revision\" : \"$$QTC_PLUGIN_REVISION\",
|
||||
\"DisabledByDefault\" : true,
|
||||
\"Vendor\" : \"The Qt Company Ltd\",
|
||||
\"Copyright\" : \"(C) $$QTCREATOR_COPYRIGHT_YEAR The Qt Company Ltd\",
|
||||
|