forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/qds-1.50' into qds-1.59
Change-Id: Ida988ba118b8e39b4dd05c53f45de6863aef8871
This commit is contained in:
@@ -496,11 +496,11 @@ function(add_qtc_library name)
|
|||||||
file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
target_include_directories(${name}
|
target_include_directories(${name}
|
||||||
PRIVATE ${_arg_INCLUDES}
|
PRIVATE
|
||||||
PUBLIC
|
${_arg_INCLUDES}
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||||
|
PUBLIC
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>"
|
||||||
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}>"
|
|
||||||
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}/..>"
|
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}/..>"
|
||||||
)
|
)
|
||||||
set_public_includes(${name} "${_arg_PUBLIC_INCLUDES}")
|
set_public_includes(${name} "${_arg_PUBLIC_INCLUDES}")
|
||||||
@@ -755,10 +755,9 @@ function(add_qtc_plugin target_name)
|
|||||||
${_arg_INCLUDES}
|
${_arg_INCLUDES}
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
"${CMAKE_BINARY_DIR}/src"
|
"${CMAKE_BINARY_DIR}/src"
|
||||||
PUBLIC
|
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||||
|
PUBLIC
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>"
|
||||||
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}>"
|
|
||||||
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}/..>"
|
"$<INSTALL_INTERFACE:include/${include_dir_relative_path}/..>"
|
||||||
)
|
)
|
||||||
set_public_includes(${target_name} "${_arg_PUBLIC_INCLUDES}")
|
set_public_includes(${target_name} "${_arg_PUBLIC_INCLUDES}")
|
||||||
@@ -886,7 +885,7 @@ function(extend_qtc_target target_name)
|
|||||||
if (NOT IS_ABSOLUTE ${_arg_SOURCES_PREFIX})
|
if (NOT IS_ABSOLUTE ${_arg_SOURCES_PREFIX})
|
||||||
set(_arg_SOURCES_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/${_arg_SOURCES_PREFIX}")
|
set(_arg_SOURCES_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/${_arg_SOURCES_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(${target_name} PUBLIC $<BUILD_INTERFACE:${_arg_SOURCES_PREFIX}>)
|
target_include_directories(${target_name} PRIVATE $<BUILD_INTERFACE:${_arg_SOURCES_PREFIX}>)
|
||||||
|
|
||||||
set(_arg_SOURCES ${prefixed_sources})
|
set(_arg_SOURCES ${prefixed_sources})
|
||||||
endif()
|
endif()
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
#BINARY_ARTIFACTS_BRANCH = master
|
#BINARY_ARTIFACTS_BRANCH = master
|
||||||
#PROJECT_USER_FILE_EXTENSION = .user
|
#PROJECT_USER_FILE_EXTENSION = .user
|
||||||
|
|
||||||
set(IDE_VERSION "4.12.0") # The IDE version.
|
set(IDE_VERSION "4.12.1") # The IDE version.
|
||||||
set(IDE_VERSION_COMPAT "4.12.0") # The IDE Compatibility version.
|
set(IDE_VERSION_COMPAT "4.12.0") # The IDE Compatibility version.
|
||||||
set(IDE_VERSION_DISPLAY "4.12.0") # The IDE display version.
|
set(IDE_VERSION_DISPLAY "4.12.1") # The IDE display version.
|
||||||
set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year.
|
set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year.
|
||||||
|
|
||||||
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
||||||
|
@@ -130,8 +130,10 @@
|
|||||||
\uicontrol {Default line endings} field.
|
\uicontrol {Default line endings} field.
|
||||||
|
|
||||||
To set the line endings to use for a project, select \uicontrol Projects >
|
To set the line endings to use for a project, select \uicontrol Projects >
|
||||||
\uicontrol {Project Settings} > \uicontrol Editor. For more information,
|
\uicontrol {Project Settings} > \uicontrol Editor.
|
||||||
see \l {Specifying Editor Settings}.
|
\if defined(qtcreator)
|
||||||
|
For more information, see \l {Specifying Editor Settings}.
|
||||||
|
\endif
|
||||||
|
|
||||||
\section1 Splitting the Editor View
|
\section1 Splitting the Editor View
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@
|
|||||||
To disable library linking for the current project, deselect the
|
To disable library linking for the current project, deselect the
|
||||||
\uicontrol {Add build library search path to PATH} check box. To disable
|
\uicontrol {Add build library search path to PATH} check box. To disable
|
||||||
library linking for all projects, select \uicontrol Tools >
|
library linking for all projects, select \uicontrol Tools >
|
||||||
\uicontrol Options > \uicontrol General, and then deselect the
|
\uicontrol Options > \uicontrol {Build & Run}, and then deselect the
|
||||||
\uicontrol {Add linker library search paths to run environment} check box.
|
\uicontrol {Add linker library search paths to run environment} check box.
|
||||||
|
|
||||||
The \uicontrol {Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)} option
|
The \uicontrol {Use debug version of frameworks (DYLD_IMAGE_SUFFIX=_debug)} option
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\page qtquick-adding-dynamics.html
|
\page qtquick-adding-dynamics.html
|
||||||
\previouspage qtquick-fonts.html
|
\previouspage creator-quick-ui-forms.html
|
||||||
\nextpage studio-timeline.html
|
\nextpage studio-timeline.html
|
||||||
|
|
||||||
\title Adding Dynamics
|
\title Adding Dynamics
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\page quick-components.html
|
\page quick-components.html
|
||||||
\if defined(qtdesignstudio)
|
\if defined(qtdesignstudio)
|
||||||
\previouspage studio-prototyping.html
|
\previouspage quick-uis.html
|
||||||
\else
|
\else
|
||||||
\previouspage creator-using-qt-quick-designer.html
|
\previouspage creator-using-qt-quick-designer.html
|
||||||
\endif
|
\endif
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2019 The Qt Company Ltd.
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -34,11 +34,7 @@
|
|||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\page creator-quick-ui-forms.html
|
\page creator-quick-ui-forms.html
|
||||||
\previouspage qtquick-annotations.html
|
\previouspage qtquick-annotations.html
|
||||||
\if defined(qtdesignstudio)
|
\nextpage qtquick-adding-dynamics.html
|
||||||
\nextpage creator-live-preview.html
|
|
||||||
\else
|
|
||||||
\nextpage creator-qml-modules-with-plugins.html
|
|
||||||
\endif
|
|
||||||
|
|
||||||
\title Qt Quick UI Forms
|
\title Qt Quick UI Forms
|
||||||
|
|
||||||
|
@@ -4,10 +4,10 @@ import qbs.FileInfo
|
|||||||
import "qtc.js" as HelperFunctions
|
import "qtc.js" as HelperFunctions
|
||||||
|
|
||||||
Module {
|
Module {
|
||||||
property string qtcreator_display_version: '4.12.0'
|
property string qtcreator_display_version: '4.12.1'
|
||||||
property string ide_version_major: '4'
|
property string ide_version_major: '4'
|
||||||
property string ide_version_minor: '12'
|
property string ide_version_minor: '12'
|
||||||
property string ide_version_release: '0'
|
property string ide_version_release: '1'
|
||||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
||||||
+ ide_version_release
|
+ ide_version_release
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
QTCREATOR_VERSION = 4.12.0
|
QTCREATOR_VERSION = 4.12.1
|
||||||
QTCREATOR_COMPAT_VERSION = 4.12.0
|
QTCREATOR_COMPAT_VERSION = 4.12.0
|
||||||
QTCREATOR_DISPLAY_VERSION = 4.12.0
|
QTCREATOR_DISPLAY_VERSION = 4.12.1
|
||||||
QTCREATOR_COPYRIGHT_YEAR = 2020
|
QTCREATOR_COPYRIGHT_YEAR = 2020
|
||||||
BINARY_ARTIFACTS_BRANCH = 4.12
|
BINARY_ARTIFACTS_BRANCH = 4.12
|
||||||
|
|
||||||
|
@@ -1,25 +1,42 @@
|
|||||||
set(template_directories android cplusplus debugger glsl modeleditor qml qmldesigner
|
set(resource_directories
|
||||||
qmlicons qml-type-descriptions schemes scripts snippets styles templates themes welcomescreen)
|
android
|
||||||
|
cplusplus
|
||||||
|
debugger
|
||||||
|
glsl
|
||||||
|
indexer_preincludes
|
||||||
|
modeleditor
|
||||||
|
qml
|
||||||
|
qmldesigner
|
||||||
|
qmlicons
|
||||||
|
qml-type-descriptions
|
||||||
|
schemes
|
||||||
|
snippets
|
||||||
|
styles
|
||||||
|
templates
|
||||||
|
themes
|
||||||
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(resource_directories ${resource_directories} scripts)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_target(copy_share_to_builddir ALL
|
add_custom_target(copy_share_to_builddir ALL
|
||||||
COMMENT Copy files into build directory
|
COMMENT Copy files into build directory
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(dir IN ITEMS ${template_directories})
|
# copy resource directories during build
|
||||||
|
foreach(dir IN ITEMS ${resource_directories})
|
||||||
add_custom_command(TARGET copy_share_to_builddir POST_BUILD
|
add_custom_command(TARGET copy_share_to_builddir POST_BUILD
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${dir}"
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory "${dir}"
|
||||||
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/${dir}"
|
"${PROJECT_BINARY_DIR}/${IDE_DATA_PATH}/${dir}"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
COMMENT Copy files into build directory
|
COMMENT Copy resource directories into build directory
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
install(DIRECTORY ${template_directories} DESTINATION "${IDE_DATA_PATH}")
|
# create install rule for resource directories
|
||||||
install(
|
install(DIRECTORY ${resource_directories} DESTINATION "${IDE_DATA_PATH}")
|
||||||
FILES indexer_preincludes/qglobal.h indexer_preincludes/windows.h
|
|
||||||
DESTINATION "${IDE_DATA_PATH}/indexer_preincludes"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_subdirectory(translations)
|
add_subdirectory(translations)
|
||||||
|
@@ -283,7 +283,8 @@ def qdump__std__map(d, value):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# stuff is actually (color, pad) with 'I@', but we can save cycles/
|
# stuff is actually (color, pad) with 'I@', but we can save cycles/
|
||||||
(compare, stuff, parent, left, right, size) = value.split('pppppp')
|
(compare, stuff, parent, left, right) = value.split('ppppp')
|
||||||
|
size = value["_M_t"]["_M_impl"]["_M_node_count"].integer()
|
||||||
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
|
|
||||||
|
@@ -100,14 +100,17 @@ Section {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: "State"
|
text: qsTr("State")
|
||||||
}
|
}
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
LineEdit {
|
|
||||||
|
ComboBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
backendValue: backendValues.state
|
backendValue: backendValues.state
|
||||||
showTranslateCheckBox: false
|
model: allStateNames
|
||||||
enabled: anchorBackend.hasParent || isBaseState
|
valueType: ComboBox.String
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {
|
ExpandingSpacer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,5 +161,56 @@ Section {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Focus")
|
||||||
|
tooltip: qsTr("Holds whether the item has focus within the enclosing FocusScope.")
|
||||||
|
disabledState: !backendValues.focus.isAvailable
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
backendValue: backendValues.focus
|
||||||
|
text: backendValues.focus.valueToString
|
||||||
|
enabled: backendValues.focus.isAvailable
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Active focus on tab")
|
||||||
|
tooltip: qsTr("Holds whether the item wants to be in the tab focus chain.")
|
||||||
|
disabledState: !backendValues.activeFocusOnTab.isAvailable
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
backendValue: backendValues.activeFocusOnTab
|
||||||
|
text: backendValues.activeFocusOnTab.valueToString
|
||||||
|
enabled: backendValues.activeFocusOnTab.isAvailable
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Baseline offset")
|
||||||
|
tooltip: qsTr("Specifies the position of the item's baseline in local coordinates.")
|
||||||
|
disabledState: !backendValues.baselineOffset.isAvailable
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
SpinBox {
|
||||||
|
sliderIndicatorVisible: true
|
||||||
|
backendValue: backendValues.baselineOffset
|
||||||
|
hasSlider: true
|
||||||
|
decimals: 0
|
||||||
|
minimumValue: -1000
|
||||||
|
maximumValue: 1000
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
enabled: backendValues.baselineOffset.isAvailable
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,95 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2016 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
import QtQuick 2.1
|
||||||
|
import HelperWidgets 2.0
|
||||||
|
import QtQuick.Layouts 1.0
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
ImageSpecifics {
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
caption: qsTr("Animated Image")
|
||||||
|
|
||||||
|
SectionLayout {
|
||||||
|
Label {
|
||||||
|
text: qsTr("Speed")
|
||||||
|
disabledState: !backendValues.speed.isAvailable
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
SpinBox {
|
||||||
|
sliderIndicatorVisible: true
|
||||||
|
backendValue: backendValues.speed
|
||||||
|
hasSlider: true
|
||||||
|
decimals: 2
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 100
|
||||||
|
Layout.preferredWidth: 140
|
||||||
|
enabled: backendValues.speed.isAvailable
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Paused")
|
||||||
|
tooltip: qsTr("Holds whether the animated image is paused.")
|
||||||
|
disabledState: !backendValues.paused.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.paused.isAvailable
|
||||||
|
text: backendValues.paused.valueToString
|
||||||
|
backendValue: backendValues.paused
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Playing")
|
||||||
|
tooltip: qsTr("Holds whether the animated image is playing.")
|
||||||
|
disabledState: !backendValues.playing.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.playing.isAvailable
|
||||||
|
text: backendValues.playing.valueToString
|
||||||
|
backendValue: backendValues.playing
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -124,7 +124,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Horizontal Fill mode")
|
text: qsTr("Horizontal Tile mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -138,7 +138,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Vertical Fill mode")
|
text: qsTr("Vertical Tile mode")
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -186,6 +186,70 @@ Column {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Mirror")
|
||||||
|
tooltip: qsTr("Specifies whether the image should be horizontally inverted.")
|
||||||
|
disabledState: !backendValues.mirror.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.mirror.isAvailable
|
||||||
|
text: backendValues.mirror.valueToString
|
||||||
|
backendValue: backendValues.mirror
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Smooth")
|
||||||
|
tooltip: qsTr("Specifies whether the image is smoothly filtered when scaled or transformed.")
|
||||||
|
disabledState: !backendValues.smooth.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.smooth.isAvailable
|
||||||
|
text: backendValues.smooth.valueToString
|
||||||
|
backendValue: backendValues.smooth
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Cache")
|
||||||
|
tooltip: qsTr("Specifies whether the image should be cached.")
|
||||||
|
disabledState: !backendValues.cache.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.cache.isAvailable
|
||||||
|
text: backendValues.cache.valueToString
|
||||||
|
backendValue: backendValues.cache
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Asynchronous")
|
||||||
|
tooltip: qsTr("Specifies that images on the local filesystem should be loaded asynchronously in a separate thread.")
|
||||||
|
disabledState: !backendValues.asynchronous.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.asynchronous.isAvailable
|
||||||
|
text: backendValues.asynchronous.valueToString
|
||||||
|
backendValue: backendValues.asynchronous
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,7 +95,32 @@ Column {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
scope: "Qt"
|
scope: "Qt"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Horizontal item alignment")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
model: ["AlignLeft", "AlignRight" ,"AlignHCenter"]
|
||||||
|
backendValue: backendValues.horizontalItemAlignment
|
||||||
|
Layout.fillWidth: true
|
||||||
|
scope: "Grid"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Vertical item alignment")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
model: ["AlignTop", "AlignBottom" ,"AlignVCenter"]
|
||||||
|
backendValue: backendValues.verticalItemAlignment
|
||||||
|
Layout.fillWidth: true
|
||||||
|
scope: "Grid"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@@ -58,7 +58,7 @@ Column {
|
|||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
scope: "Image"
|
scope: "Image"
|
||||||
model: ["Stretch", "PreserveAspectFit", "PreserveAspectCrop", "Tile", "TileVertically", "TileHorizontally"]
|
model: ["Stretch", "PreserveAspectFit", "PreserveAspectCrop", "Tile", "TileVertically", "TileHorizontally", "Pad"]
|
||||||
backendValue: backendValues.fillMode
|
backendValue: backendValues.fillMode
|
||||||
implicitWidth: 180
|
implicitWidth: 180
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -105,6 +105,136 @@ Column {
|
|||||||
ExpandingSpacer {
|
ExpandingSpacer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Horizontal alignment")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
scope: "Image"
|
||||||
|
model: ["AlignLeft", "AlignRight", "AlignHCenter"]
|
||||||
|
backendValue: backendValues.horizontalAlignment
|
||||||
|
implicitWidth: 180
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Vertical alignment")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
scope: "Image"
|
||||||
|
model: ["AlignTop", "AlignBottom", "AlignVCenter"]
|
||||||
|
backendValue: backendValues.verticalAlignment
|
||||||
|
implicitWidth: 180
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Asynchronous")
|
||||||
|
tooltip: qsTr("Specifies that images on the local filesystem should be loaded asynchronously in a separate thread.")
|
||||||
|
disabledState: !backendValues.asynchronous.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.asynchronous.isAvailable
|
||||||
|
text: backendValues.asynchronous.valueToString
|
||||||
|
backendValue: backendValues.asynchronous
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Auto transform")
|
||||||
|
tooltip: qsTr("Specifies whether the image should automatically apply image transformation metadata such as EXIF orientation.")
|
||||||
|
disabledState: !backendValues.autoTransform.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.autoTransform.isAvailable
|
||||||
|
text: backendValues.autoTransform.valueToString
|
||||||
|
backendValue: backendValues.autoTransform
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Cache")
|
||||||
|
tooltip: qsTr("Specifies whether the image should be cached.")
|
||||||
|
disabledState: !backendValues.cache.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.cache.isAvailable
|
||||||
|
text: backendValues.cache.valueToString
|
||||||
|
backendValue: backendValues.cache
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Mipmap")
|
||||||
|
tooltip: qsTr("Specifies whether the image uses mipmap filtering when scaled or transformed.")
|
||||||
|
disabledState: !backendValues.mipmap.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.mipmap.isAvailable
|
||||||
|
text: backendValues.mipmap.valueToString
|
||||||
|
backendValue: backendValues.mipmap
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Mirror")
|
||||||
|
tooltip: qsTr("Specifies whether the image should be horizontally inverted.")
|
||||||
|
disabledState: !backendValues.mirror.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.mirror.isAvailable
|
||||||
|
text: backendValues.mirror.valueToString
|
||||||
|
backendValue: backendValues.mirror
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Smooth")
|
||||||
|
tooltip: qsTr("Specifies whether the image is smoothly filtered when scaled or transformed.")
|
||||||
|
disabledState: !backendValues.smooth.isAvailable
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
enabled: backendValues.smooth.isAvailable
|
||||||
|
text: backendValues.smooth.valueToString
|
||||||
|
backendValue: backendValues.smooth
|
||||||
|
implicitWidth: 180
|
||||||
|
}
|
||||||
|
ExpandingSpacer {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Hover Enabled")
|
text: qsTr("Hover enabled")
|
||||||
tooltip: qsTr("This property holds whether hover events are handled.")
|
tooltip: qsTr("This property holds whether hover events are handled.")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,6 +68,197 @@ Column {
|
|||||||
ExpandingSpacer {
|
ExpandingSpacer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Accepted buttons")
|
||||||
|
tooltip: qsTr("This property holds the mouse buttons that the mouse area reacts to.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
backendValue: backendValues.acceptedButtons
|
||||||
|
model: ["LeftButton", "RightButton", "MiddleButton", "BackButton", "ForwardButton", "AllButtons"]
|
||||||
|
Layout.fillWidth: true
|
||||||
|
scope: "Qt"
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Press and hold interval")
|
||||||
|
tooltip: qsTr("This property overrides the elapsed time in milliseconds before pressAndHold is emitted.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
SpinBox {
|
||||||
|
backendValue: backendValues.pressAndHoldInterval
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 2000
|
||||||
|
decimals: 0
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Scroll gesture enabled")
|
||||||
|
tooltip: qsTr("This property controls whether this MouseArea responds to scroll gestures from non-mouse devices.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.scrollGestureEnabled
|
||||||
|
text: backendValues.scrollGestureEnabled.valueToString
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Cursor shape")
|
||||||
|
tooltip: qsTr("This property holds the cursor shape for this mouse area.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
backendValue: backendValues.cursorShape
|
||||||
|
model: ["ArrowCursor", "UpArrowCursor", "CrossCursor", "WaitCursor",
|
||||||
|
"IBeamCursor", "SizeVerCursor", "SizeHorCursor", "SizeBDiagCursor",
|
||||||
|
"SizeFDiagCursor", "SizeAllCursor", "BlankCursor", "SplitVCursor",
|
||||||
|
"SplitHCursor", "PointingHandCursor", "ForbiddenCursor", "WhatsThisCursor",
|
||||||
|
"BusyCursor", "OpenHandCursor", "ClosedHandCursor", "DragCopyCursor",
|
||||||
|
"DragMoveCursor", "DragLinkCursor"]
|
||||||
|
Layout.fillWidth: true
|
||||||
|
scope: "Qt"
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Prevent stealing")
|
||||||
|
tooltip: qsTr("This property controls whether the mouse events may be stolen from this MouseArea.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.preventStealing
|
||||||
|
text: backendValues.preventStealing.valueToString
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Propagate composed events")
|
||||||
|
tooltip: qsTr("This property controls whether composed mouse events will automatically propagate to other MouseAreas.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.propagateComposedEvents
|
||||||
|
text: backendValues.propagateComposedEvents.valueToString
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Section {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
caption: qsTr("Drag")
|
||||||
|
|
||||||
|
SectionLayout {
|
||||||
|
Label {
|
||||||
|
text: qsTr("Target")
|
||||||
|
tooltip: qsTr("Sets the id of the item to drag.")
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
ItemFilterComboBox {
|
||||||
|
typeFilter: "QtQuick.QtObject"
|
||||||
|
validator: RegExpValidator { regExp: /(^$|^[a-z_]\w*)/ }
|
||||||
|
backendValue: backendValues.drag_target
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Axis")
|
||||||
|
tooltip: qsTr("Specifies whether dragging can be done horizontally, vertically, or both.")
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
ComboBox {
|
||||||
|
scope: "Drag"
|
||||||
|
model: ["XAxis", "YAxis", "XAndYAxis"]
|
||||||
|
backendValue: backendValues.drag_axis
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Filter children")
|
||||||
|
tooltip: qsTr("Specifies whether a drag overrides descendant MouseAreas.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.drag_filterChildren
|
||||||
|
text: backendValues.drag_filterChildren.valueToString
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Threshold")
|
||||||
|
tooltip: qsTr("Determines the threshold in pixels of when the drag operation should start.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
SpinBox {
|
||||||
|
backendValue: backendValues.drag_threshold
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 5000
|
||||||
|
decimals: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Smoothed")
|
||||||
|
tooltip: qsTr("If set to true, the target will be moved only after the drag operation has started.\n"
|
||||||
|
+ "If set to false, the target will be moved straight to the current mouse position.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.drag_smoothed
|
||||||
|
text: backendValues.drag_smoothed.valueToString
|
||||||
|
}
|
||||||
|
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -113,6 +113,19 @@ Section {
|
|||||||
minimumValue: -200
|
minimumValue: -200
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: textInputSection.isTextInput
|
||||||
|
text: qsTr("Maximum length")
|
||||||
|
tooltip: qsTr("Sets the maximum permitted length of the text in the TextInput.")
|
||||||
|
}
|
||||||
|
SpinBox {
|
||||||
|
visible: textInputSection.isTextInput
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.maximumLength
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 32767
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Flags")
|
text: qsTr("Flags")
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
@@ -38,6 +38,10 @@ StudioControls.ComboBox {
|
|||||||
enum ValueType { String, Integer, Enum }
|
enum ValueType { String, Integer, Enum }
|
||||||
property int valueType: ComboBox.ValueType.Enum
|
property int valueType: ComboBox.ValueType.Enum
|
||||||
|
|
||||||
|
onModelChanged: colorLogic.invalidate()
|
||||||
|
|
||||||
|
// This is available in all editors.
|
||||||
|
|
||||||
onValueTypeChanged: {
|
onValueTypeChanged: {
|
||||||
if (comboBox.valueType === ComboBox.ValueType.Integer)
|
if (comboBox.valueType === ComboBox.ValueType.Integer)
|
||||||
comboBox.useInteger = true
|
comboBox.useInteger = true
|
||||||
@@ -98,8 +102,14 @@ StudioControls.ComboBox {
|
|||||||
} else {
|
} else {
|
||||||
switch (comboBox.valueType) {
|
switch (comboBox.valueType) {
|
||||||
case ComboBox.ValueType.String:
|
case ComboBox.ValueType.String:
|
||||||
if (comboBox.currentText !== comboBox.backendValue.value)
|
if (comboBox.currentText !== comboBox.backendValue.value) {
|
||||||
comboBox.currentText = comboBox.backendValue.value
|
var index = comboBox.find(comboBox.backendValue.value)
|
||||||
|
if (index < 0)
|
||||||
|
index = 0
|
||||||
|
|
||||||
|
if (index !== comboBox.currentIndex)
|
||||||
|
comboBox.currentIndex = index
|
||||||
|
}
|
||||||
break
|
break
|
||||||
case ComboBox.ValueType.Integer:
|
case ComboBox.ValueType.Integer:
|
||||||
if (comboBox.currentIndex !== comboBox.backendValue.value)
|
if (comboBox.currentIndex !== comboBox.backendValue.value)
|
||||||
@@ -112,7 +122,7 @@ StudioControls.ComboBox {
|
|||||||
if (enumString === "")
|
if (enumString === "")
|
||||||
enumString = comboBox.backendValue.value
|
enumString = comboBox.backendValue.value
|
||||||
|
|
||||||
var index = comboBox.find(enumString)
|
index = comboBox.find(enumString)
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
index = 0
|
index = 0
|
||||||
|
@@ -47,7 +47,7 @@ Section {
|
|||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
backendValue: backendValues.flickableDirection
|
backendValue: backendValues.flickableDirection
|
||||||
model: ["AutoFlickDirection", "HorizontalFlick", "VerticalFlick", "HorizontalAndVerticalFlick"]
|
model: ["AutoFlickDirection", "AutoFlickIfNeeded", "HorizontalFlick", "VerticalFlick", "HorizontalAndVerticalFlick"]
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
scope: "Flickable"
|
scope: "Flickable"
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ Section {
|
|||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
ComboBox {
|
ComboBox {
|
||||||
backendValue: backendValues.boundsBehavior
|
backendValue: backendValues.boundsBehavior
|
||||||
model: ["StopAtBounds", "DragOverBounds", "DragAndOvershootBounds"]
|
model: ["StopAtBounds", "DragOverBounds", "OvershootBounds", "DragAndOvershootBounds"]
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
scope: "Flickable"
|
scope: "Flickable"
|
||||||
}
|
}
|
||||||
@@ -166,6 +166,23 @@ Section {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Synchronous drag")
|
||||||
|
tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n"
|
||||||
|
+ "the content, the content will jump, such that the content pixel which was under the\n"
|
||||||
|
+ "cursor or touchpoint when pressed remains under that point.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
CheckBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.synchronousDrag
|
||||||
|
text: backendValues.synchronousDrag.valueToString
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Content size")
|
text: qsTr("Content size")
|
||||||
}
|
}
|
||||||
@@ -246,6 +263,45 @@ Section {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Origin")
|
||||||
|
}
|
||||||
|
|
||||||
|
SecondColumnLayout {
|
||||||
|
Label {
|
||||||
|
text: "X"
|
||||||
|
width: root.labelWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
SpinBox {
|
||||||
|
backendValue: backendValues.originX
|
||||||
|
minimumValue: -8000
|
||||||
|
maximumValue: 8000
|
||||||
|
implicitWidth: root.spinBoxWidth
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 4
|
||||||
|
height: 4
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: "Y"
|
||||||
|
width: root.labelWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
SpinBox {
|
||||||
|
backendValue: backendValues.originY
|
||||||
|
minimumValue: -8000
|
||||||
|
maximumValue: 8000
|
||||||
|
implicitWidth: root.spinBoxWidth
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
ExpandingSpacer {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Margins")
|
text: qsTr("Margins")
|
||||||
}
|
}
|
||||||
|
@@ -276,5 +276,17 @@ Section {
|
|||||||
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
|
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("Hinting preference")
|
||||||
|
toolTip: qsTr("Sets the preferred hinting on the text.")
|
||||||
|
}
|
||||||
|
|
||||||
|
ComboBox {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: getBackendValue("hintingPreference")
|
||||||
|
model: ["PreferDefaultHinting", "PreferNoHinting", "PreferVerticalHinting", "PreferFullHinting"]
|
||||||
|
scope: "Font"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ Section {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
backendValue: backendValues.wrapMode
|
backendValue: backendValues.wrapMode
|
||||||
scope: "Text"
|
scope: "Text"
|
||||||
model: ["NoWrap", "WordWrap", "WrapAnywhere", "WrapAtWordBoundaryOrAnywhere"]
|
model: ["NoWrap", "WordWrap", "WrapAnywhere", "Wrap"]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
@@ -77,6 +77,21 @@ Section {
|
|||||||
model: ["ElideNone", "ElideLeft", "ElideMiddle", "ElideRight"]
|
model: ["ElideNone", "ElideLeft", "ElideMiddle", "ElideRight"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: showElide
|
||||||
|
text: qsTr("Maximum line count")
|
||||||
|
tooltip: qsTr("Limits the number of lines that the text item will show.")
|
||||||
|
}
|
||||||
|
|
||||||
|
SpinBox {
|
||||||
|
visible: showElide
|
||||||
|
Layout.fillWidth: true
|
||||||
|
backendValue: backendValues.maximumLineCount
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 10000
|
||||||
|
decimals: 0
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Alignment")
|
text: qsTr("Alignment")
|
||||||
}
|
}
|
||||||
@@ -124,6 +139,7 @@ Section {
|
|||||||
toolTip: qsTr("Specifies how the font size of the displayed text is determined.")
|
toolTip: qsTr("Specifies how the font size of the displayed text is determined.")
|
||||||
}
|
}
|
||||||
ComboBox {
|
ComboBox {
|
||||||
|
id: fontSizeMode
|
||||||
visible: showFontSizeMode
|
visible: showFontSizeMode
|
||||||
scope: "Text"
|
scope: "Text"
|
||||||
model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"]
|
model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"]
|
||||||
@@ -131,6 +147,48 @@ Section {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: showFontSizeMode
|
||||||
|
text: qsTr("Minimum size")
|
||||||
|
}
|
||||||
|
SecondColumnLayout {
|
||||||
|
visible: showFontSizeMode
|
||||||
|
|
||||||
|
SpinBox {
|
||||||
|
enabled: fontSizeMode.currentIndex !== 0
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 500
|
||||||
|
decimals: 0
|
||||||
|
backendValue: backendValues.minimumPixelSize
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.minimumWidth: 60
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: qsTr("Pixel")
|
||||||
|
tooltip: qsTr("Specifies the minimum font pixel size of scaled text.")
|
||||||
|
width: 42
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 4
|
||||||
|
height: 4
|
||||||
|
}
|
||||||
|
|
||||||
|
SpinBox {
|
||||||
|
enabled: fontSizeMode.currentIndex !== 0
|
||||||
|
minimumValue: 0
|
||||||
|
maximumValue: 500
|
||||||
|
decimals: 0
|
||||||
|
backendValue: backendValues.minimumPointSize
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.minimumWidth: 60
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
text: qsTr("Point")
|
||||||
|
tooltip: qsTr("Specifies the minimum font point size of scaled text.")
|
||||||
|
width: 42
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
visible: showLineHeight
|
visible: showLineHeight
|
||||||
@@ -148,5 +206,17 @@ Section {
|
|||||||
stepSize: 0.1
|
stepSize: 0.1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: showLineHeight
|
||||||
|
text: qsTr("Line height mode")
|
||||||
|
toolTip: qsTr("Determines how the line height is specified.")
|
||||||
|
}
|
||||||
|
ComboBox {
|
||||||
|
visible: showLineHeight
|
||||||
|
scope: "Text"
|
||||||
|
model: ["ProportionalHeight", "FixedHeight"]
|
||||||
|
backendValue: backendValues.lineHeightMode
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -215,6 +215,7 @@ namespace ADS
|
|||||||
DockManager *m_dockManager = nullptr;
|
DockManager *m_dockManager = nullptr;
|
||||||
bool m_updateTitleBarButtons = false;
|
bool m_updateTitleBarButtons = false;
|
||||||
DockWidgetAreas m_allowedAreas = AllDockAreas;
|
DockWidgetAreas m_allowedAreas = AllDockAreas;
|
||||||
|
QSize m_minSizeHint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private data constructor
|
* Private data constructor
|
||||||
@@ -264,6 +265,22 @@ namespace ADS
|
|||||||
* Udpates the enable state of the close and detach button
|
* Udpates the enable state of the close and detach button
|
||||||
*/
|
*/
|
||||||
void updateTitleBarButtonStates();
|
void updateTitleBarButtonStates();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scans all contained dock widgets for the max. minimum size hint
|
||||||
|
*/
|
||||||
|
void updateMinimumSizeHint()
|
||||||
|
{
|
||||||
|
m_minSizeHint = QSize();
|
||||||
|
for (int i = 0; i < m_contentsLayout->count(); ++i)
|
||||||
|
{
|
||||||
|
auto widget = m_contentsLayout->widget(i);
|
||||||
|
m_minSizeHint.setHeight(qMax(m_minSizeHint.height(),
|
||||||
|
widget->minimumSizeHint().height()));
|
||||||
|
m_minSizeHint.setWidth(qMax(m_minSizeHint.width(),
|
||||||
|
widget->minimumSizeHint().width()));
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// struct DockAreaWidgetPrivate
|
// struct DockAreaWidgetPrivate
|
||||||
|
|
||||||
@@ -349,6 +366,10 @@ namespace ADS
|
|||||||
d->tabBar()->blockSignals(false);
|
d->tabBar()->blockSignals(false);
|
||||||
tabWidget->setVisible(!dockWidget->isClosed());
|
tabWidget->setVisible(!dockWidget->isClosed());
|
||||||
dockWidget->setProperty(INDEX_PROPERTY, index);
|
dockWidget->setProperty(INDEX_PROPERTY, index);
|
||||||
|
d->m_minSizeHint.setHeight(qMax(d->m_minSizeHint.height(),
|
||||||
|
dockWidget->minimumSizeHint().height()));
|
||||||
|
d->m_minSizeHint.setWidth(qMax(d->m_minSizeHint.width(),
|
||||||
|
dockWidget->minimumSizeHint().width()));
|
||||||
if (activate) {
|
if (activate) {
|
||||||
setCurrentIndex(index);
|
setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
@@ -381,6 +402,7 @@ namespace ADS
|
|||||||
|
|
||||||
d->updateTitleBarButtonStates();
|
d->updateTitleBarButtonStates();
|
||||||
updateTitleBarVisibility();
|
updateTitleBarVisibility();
|
||||||
|
d->updateMinimumSizeHint();
|
||||||
auto topLevelDockWidget = dockContainerWidget->topLevelDockWidget();
|
auto topLevelDockWidget = dockContainerWidget->topLevelDockWidget();
|
||||||
if (topLevelDockWidget) {
|
if (topLevelDockWidget) {
|
||||||
topLevelDockWidget->emitTopLevelChanged(true);
|
topLevelDockWidget->emitTopLevelChanged(true);
|
||||||
@@ -683,4 +705,9 @@ namespace ADS
|
|||||||
|
|
||||||
DockAreaTitleBar *DockAreaWidget::titleBar() const { return d->m_titleBar; }
|
DockAreaTitleBar *DockAreaWidget::titleBar() const { return d->m_titleBar; }
|
||||||
|
|
||||||
|
QSize DockAreaWidget::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
return d->m_minSizeHint.isValid() ? d->m_minSizeHint : Super::minimumSizeHint();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ADS
|
} // namespace ADS
|
||||||
|
@@ -291,6 +291,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
void closeOtherAreas();
|
void closeOtherAreas();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the largest minimumSizeHint() of the dock widgets in this
|
||||||
|
* area.
|
||||||
|
* The minimum size hint is updated if a dock widget is removed or added.
|
||||||
|
*/
|
||||||
|
virtual QSize minimumSizeHint() const override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when user clicks on a tab at an index.
|
* This signal is emitted when user clicks on a tab at an index.
|
||||||
|
@@ -83,6 +83,7 @@ namespace ADS
|
|||||||
QSize m_toolBarIconSizeFloating = QSize(24, 24);
|
QSize m_toolBarIconSizeFloating = QSize(24, 24);
|
||||||
bool m_isFloatingTopLevel = false;
|
bool m_isFloatingTopLevel = false;
|
||||||
QList<QAction *> m_titleBarActions;
|
QList<QAction *> m_titleBarActions;
|
||||||
|
DockWidget::eMinimumSizeHintMode m_minimumSizeHintMode = DockWidget::MinimumSizeHintFromDockWidget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private data constructor
|
* Private data constructor
|
||||||
@@ -317,6 +318,11 @@ namespace ADS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DockWidget::setMinimumSizeHintMode(eMinimumSizeHintMode mode)
|
||||||
|
{
|
||||||
|
d->m_minimumSizeHintMode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
void DockWidget::toggleView(bool open)
|
void DockWidget::toggleView(bool open)
|
||||||
{
|
{
|
||||||
// If the toggle view action mode is ActionModeShow, then Open is always
|
// If the toggle view action mode is ActionModeShow, then Open is always
|
||||||
@@ -545,7 +551,13 @@ namespace ADS
|
|||||||
|
|
||||||
void DockWidget::setClosedState(bool closed) { d->m_closed = closed; }
|
void DockWidget::setClosedState(bool closed) { d->m_closed = closed; }
|
||||||
|
|
||||||
QSize DockWidget::minimumSizeHint() const { return QSize(60, 40); }
|
QSize DockWidget::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
if (d->m_minimumSizeHintMode == DockWidget::MinimumSizeHintFromDockWidget || !d->m_widget)
|
||||||
|
return QSize(60, 40);
|
||||||
|
else
|
||||||
|
return d->m_widget->minimumSizeHint();
|
||||||
|
}
|
||||||
|
|
||||||
void DockWidget::setFloating()
|
void DockWidget::setFloating()
|
||||||
{
|
{
|
||||||
@@ -587,6 +599,7 @@ namespace ADS
|
|||||||
floatingWidget->hide();
|
floatingWidget->hide();
|
||||||
}
|
}
|
||||||
deleteDockWidget();
|
deleteDockWidget();
|
||||||
|
emit closed();
|
||||||
} else {
|
} else {
|
||||||
toggleView(false);
|
toggleView(false);
|
||||||
}
|
}
|
||||||
|
@@ -184,6 +184,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
enum eInsertMode { AutoScrollArea, ForceScrollArea, ForceNoScrollArea };
|
enum eInsertMode { AutoScrollArea, ForceScrollArea, ForceNoScrollArea };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The mode of the minimumSizeHint() that is returned by the DockWidget
|
||||||
|
* minimumSizeHint() function.
|
||||||
|
* To ensure, that a dock widget does not block resizing, the dock widget
|
||||||
|
* reimplements minimumSizeHint() function to return a very small minimum
|
||||||
|
* size hint. If you would like to adhere the minimumSizeHint() from the
|
||||||
|
* content widget, the set the minimumSizeHintMode() to
|
||||||
|
* MinimumSizeHintFromContent.
|
||||||
|
*/
|
||||||
|
enum eMinimumSizeHintMode { MinimumSizeHintFromDockWidget, MinimumSizeHintFromContent };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This mode configures the behavior of the toggle view action.
|
* This mode configures the behavior of the toggle view action.
|
||||||
* If the mode if ActionModeToggle, then the toggle view action is
|
* If the mode if ActionModeToggle, then the toggle view action is
|
||||||
@@ -218,7 +229,8 @@ public:
|
|||||||
virtual ~DockWidget() override;
|
virtual ~DockWidget() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We return a fixed minimum size hint for all dock widgets
|
* We return a fixed minimum size hint or the size hint of the content
|
||||||
|
* widget if minimum size hint mode is MinimumSizeHintFromContent
|
||||||
*/
|
*/
|
||||||
virtual QSize minimumSizeHint() const override;
|
virtual QSize minimumSizeHint() const override;
|
||||||
|
|
||||||
@@ -327,6 +339,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setToggleViewActionMode(eToggleViewActionMode mode);
|
void setToggleViewActionMode(eToggleViewActionMode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configures the minimum size hint that is returned by the
|
||||||
|
* minimumSizeHint() function.
|
||||||
|
* \see eMinimumSizeHintMode for a detailed description
|
||||||
|
*/
|
||||||
|
void setMinimumSizeHintMode(eMinimumSizeHintMode mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the dock widget icon that is shown in tabs and in toggle view
|
* Sets the dock widget icon that is shown in tabs and in toggle view
|
||||||
* actions
|
* actions
|
||||||
@@ -339,13 +358,10 @@ public:
|
|||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the WithToolBar layout flag is enabled, then this function returns
|
|
||||||
* the dock widget toolbar. If the flag is disabled, the function returns
|
|
||||||
* a nullptr.
|
|
||||||
* This function returns the dock widget top tool bar.
|
* This function returns the dock widget top tool bar.
|
||||||
* If no toolbar is assigned, this function returns nullptr. To get a valid
|
* If no toolbar is assigned, this function returns nullptr. To get a valid
|
||||||
* toolbar you either need to create a default empty toolbar via
|
* toolbar you either need to create a default empty toolbar via
|
||||||
* createDefaultToolBar() function or you need to assign you custom
|
* createDefaultToolBar() function or you need to assign your custom
|
||||||
* toolbar via setToolBar().
|
* toolbar via setToolBar().
|
||||||
*/
|
*/
|
||||||
QToolBar *toolBar() const;
|
QToolBar *toolBar() const;
|
||||||
|
@@ -73,6 +73,7 @@ namespace ADS
|
|||||||
QPoint m_dragStartMousePosition;
|
QPoint m_dragStartMousePosition;
|
||||||
DockContainerWidget *m_dropContainer = nullptr;
|
DockContainerWidget *m_dropContainer = nullptr;
|
||||||
DockAreaWidget *m_singleDockArea = nullptr;
|
DockAreaWidget *m_singleDockArea = nullptr;
|
||||||
|
QPoint m_dragStartPos;
|
||||||
QWidget *m_mouseEventHandler = nullptr;
|
QWidget *m_mouseEventHandler = nullptr;
|
||||||
FloatingWidgetTitleBar *m_titleBar = nullptr;
|
FloatingWidgetTitleBar *m_titleBar = nullptr;
|
||||||
|
|
||||||
@@ -107,25 +108,30 @@ namespace ADS
|
|||||||
q->setWindowTitle(text);
|
q->setWindowTitle(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reflect the current dock widget title in the floating widget windowTitle()
|
||||||
|
* depending on the DockManager::FloatingContainerHasWidgetTitle flag
|
||||||
|
*/
|
||||||
void reflectCurrentWidget(DockWidget *currentWidget)
|
void reflectCurrentWidget(DockWidget *currentWidget)
|
||||||
{
|
{
|
||||||
// reflect CurrentWidget's title if configured to do so, otherwise display application name as window title
|
// reflect CurrentWidget's title if configured to do so, otherwise display application name as window title
|
||||||
if (testConfigFlag(DockManager::FloatingContainerHasWidgetTitle)) {
|
if (testConfigFlag(DockManager::FloatingContainerHasWidgetTitle))
|
||||||
setWindowTitle(currentWidget->windowTitle());
|
setWindowTitle(currentWidget->windowTitle());
|
||||||
} else {
|
else
|
||||||
setWindowTitle(QApplication::applicationDisplayName());
|
setWindowTitle(QApplication::applicationDisplayName());
|
||||||
}
|
|
||||||
|
|
||||||
// reflect CurrentWidget's icon if configured to do so, otherwise display application icon as window icon
|
// reflect currentWidget's icon if configured to do so, otherwise display application icon as window icon
|
||||||
QIcon CurrentWidgetIcon = currentWidget->icon();
|
QIcon currentWidgetIcon = currentWidget->icon();
|
||||||
if (testConfigFlag(DockManager::FloatingContainerHasWidgetIcon)
|
if (testConfigFlag(DockManager::FloatingContainerHasWidgetIcon) && !currentWidgetIcon.isNull())
|
||||||
&& !CurrentWidgetIcon.isNull())
|
|
||||||
{
|
|
||||||
q->setWindowIcon(currentWidget->icon());
|
q->setWindowIcon(currentWidget->icon());
|
||||||
} else {
|
else
|
||||||
q->setWindowIcon(QApplication::windowIcon());
|
q->setWindowIcon(QApplication::windowIcon());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* Handles escape key press when dragging around the floating widget
|
||||||
|
*/
|
||||||
|
void handleEscapeKey();
|
||||||
}; // class FloatingDockContainerPrivate
|
}; // class FloatingDockContainerPrivate
|
||||||
|
|
||||||
FloatingDockContainerPrivate::FloatingDockContainerPrivate(FloatingDockContainer *parent)
|
FloatingDockContainerPrivate::FloatingDockContainerPrivate(FloatingDockContainer *parent)
|
||||||
@@ -135,17 +141,15 @@ namespace ADS
|
|||||||
void FloatingDockContainerPrivate::titleMouseReleaseEvent()
|
void FloatingDockContainerPrivate::titleMouseReleaseEvent()
|
||||||
{
|
{
|
||||||
setState(DraggingInactive);
|
setState(DraggingInactive);
|
||||||
if (!m_dropContainer) {
|
if (!m_dropContainer)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (m_dockManager->dockAreaOverlay()->dropAreaUnderCursor() != InvalidDockWidgetArea
|
if (m_dockManager->dockAreaOverlay()->dropAreaUnderCursor() != InvalidDockWidgetArea
|
||||||
|| m_dockManager->containerOverlay()->dropAreaUnderCursor() != InvalidDockWidgetArea) {
|
|| m_dockManager->containerOverlay()->dropAreaUnderCursor() != InvalidDockWidgetArea) {
|
||||||
// Resize the floating widget to the size of the highlighted drop area rectangle
|
// Resize the floating widget to the size of the highlighted drop area rectangle
|
||||||
DockOverlay *overlay = m_dockManager->containerOverlay();
|
DockOverlay *overlay = m_dockManager->containerOverlay();
|
||||||
if (!overlay->dropOverlayRect().isValid()) {
|
if (!overlay->dropOverlayRect().isValid())
|
||||||
overlay = m_dockManager->dockAreaOverlay();
|
overlay = m_dockManager->dockAreaOverlay();
|
||||||
}
|
|
||||||
|
|
||||||
QRect rect = overlay->dropOverlayRect();
|
QRect rect = overlay->dropOverlayRect();
|
||||||
int frameWidth = (q->frameSize().width() - q->rect().width()) / 2;
|
int frameWidth = (q->frameSize().width() - q->rect().width()) / 2;
|
||||||
@@ -165,28 +169,24 @@ namespace ADS
|
|||||||
|
|
||||||
void FloatingDockContainerPrivate::updateDropOverlays(const QPoint &globalPosition)
|
void FloatingDockContainerPrivate::updateDropOverlays(const QPoint &globalPosition)
|
||||||
{
|
{
|
||||||
if (!q->isVisible() || !m_dockManager) {
|
if (!q->isVisible() || !m_dockManager)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
auto containers = m_dockManager->dockContainers();
|
auto containers = m_dockManager->dockContainers();
|
||||||
DockContainerWidget *topContainer = nullptr;
|
DockContainerWidget *topContainer = nullptr;
|
||||||
for (auto containerWidget : containers) {
|
for (auto containerWidget : containers) {
|
||||||
if (!containerWidget->isVisible()) {
|
if (!containerWidget->isVisible())
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (m_dockContainer == containerWidget) {
|
if (m_dockContainer == containerWidget)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
QPoint mappedPos = containerWidget->mapFromGlobal(globalPosition);
|
QPoint mappedPos = containerWidget->mapFromGlobal(globalPosition);
|
||||||
if (containerWidget->rect().contains(mappedPos)) {
|
if (containerWidget->rect().contains(mappedPos)) {
|
||||||
if (!topContainer || containerWidget->isInFrontOf(topContainer)) {
|
if (!topContainer || containerWidget->isInFrontOf(topContainer))
|
||||||
topContainer = containerWidget;
|
topContainer = containerWidget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
m_dropContainer = topContainer;
|
m_dropContainer = topContainer;
|
||||||
auto containerOverlay = m_dockManager->containerOverlay();
|
auto containerOverlay = m_dockManager->containerOverlay();
|
||||||
@@ -223,6 +223,14 @@ namespace ADS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FloatingDockContainerPrivate::handleEscapeKey()
|
||||||
|
{
|
||||||
|
qCInfo(adsLog) << Q_FUNC_INFO;
|
||||||
|
setState(DraggingInactive);
|
||||||
|
m_dockManager->containerOverlay()->hideOverlay();
|
||||||
|
m_dockManager->dockAreaOverlay()->hideOverlay();
|
||||||
|
}
|
||||||
|
|
||||||
FloatingDockContainer::FloatingDockContainer(DockManager *dockManager)
|
FloatingDockContainer::FloatingDockContainer(DockManager *dockManager)
|
||||||
: FloatingWidgetBaseType(dockManager)
|
: FloatingWidgetBaseType(dockManager)
|
||||||
, d(new FloatingDockContainerPrivate(this))
|
, d(new FloatingDockContainerPrivate(this))
|
||||||
@@ -268,10 +276,9 @@ namespace ADS
|
|||||||
d->m_titleBar->enableCloseButton(isClosable());
|
d->m_titleBar->enableCloseButton(isClosable());
|
||||||
|
|
||||||
auto dw = topLevelDockWidget();
|
auto dw = topLevelDockWidget();
|
||||||
if (dw) {
|
if (dw)
|
||||||
dw->emitTopLevelChanged(true);
|
dw->emitTopLevelChanged(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FloatingDockContainer::FloatingDockContainer(DockWidget *dockWidget)
|
FloatingDockContainer::FloatingDockContainer(DockWidget *dockWidget)
|
||||||
: FloatingDockContainer(dockWidget->dockManager())
|
: FloatingDockContainer(dockWidget->dockManager())
|
||||||
@@ -281,17 +288,16 @@ namespace ADS
|
|||||||
d->m_titleBar->enableCloseButton(isClosable());
|
d->m_titleBar->enableCloseButton(isClosable());
|
||||||
|
|
||||||
auto dw = topLevelDockWidget();
|
auto dw = topLevelDockWidget();
|
||||||
if (dw) {
|
if (dw)
|
||||||
dw->emitTopLevelChanged(true);
|
dw->emitTopLevelChanged(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FloatingDockContainer::~FloatingDockContainer()
|
FloatingDockContainer::~FloatingDockContainer()
|
||||||
{
|
{
|
||||||
qCInfo(adsLog) << Q_FUNC_INFO;
|
qCInfo(adsLog) << Q_FUNC_INFO;
|
||||||
if (d->m_dockManager) {
|
if (d->m_dockManager)
|
||||||
d->m_dockManager->removeFloatingWidget(this);
|
d->m_dockManager->removeFloatingWidget(this);
|
||||||
}
|
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -312,6 +318,10 @@ namespace ADS
|
|||||||
QWidget::moveEvent(event);
|
QWidget::moveEvent(event);
|
||||||
switch (d->m_draggingState) {
|
switch (d->m_draggingState) {
|
||||||
case DraggingMousePressed:
|
case DraggingMousePressed:
|
||||||
|
// TODO Is checking for windows only sufficient or has macOS also problems?
|
||||||
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
|
QApplication::instance()->installEventFilter(this);
|
||||||
|
|
||||||
d->setState(DraggingFloatingWidget);
|
d->setState(DraggingFloatingWidget);
|
||||||
d->updateDropOverlays(QCursor::pos());
|
d->updateDropOverlays(QCursor::pos());
|
||||||
break;
|
break;
|
||||||
@@ -340,10 +350,9 @@ namespace ADS
|
|||||||
if (isClosable()) {
|
if (isClosable()) {
|
||||||
auto dw = topLevelDockWidget();
|
auto dw = topLevelDockWidget();
|
||||||
if (dw && dw->features().testFlag(DockWidget::DockWidgetDeleteOnClose)) {
|
if (dw && dw->features().testFlag(DockWidget::DockWidgetDeleteOnClose)) {
|
||||||
if (!dw->closeDockWidgetInternal()) {
|
if (!dw->closeDockWidgetInternal())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this->hide();
|
this->hide();
|
||||||
}
|
}
|
||||||
@@ -352,21 +361,18 @@ namespace ADS
|
|||||||
void FloatingDockContainer::hideEvent(QHideEvent *event)
|
void FloatingDockContainer::hideEvent(QHideEvent *event)
|
||||||
{
|
{
|
||||||
Super::hideEvent(event);
|
Super::hideEvent(event);
|
||||||
if (event->spontaneous()) {
|
if (event->spontaneous())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent toogleView() events during restore state
|
// Prevent toogleView() events during restore state
|
||||||
if (d->m_dockManager->isRestoringState()) {
|
if (d->m_dockManager->isRestoringState())
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
for (auto dockArea : d->m_dockContainer->openedDockAreas()) {
|
for (auto dockArea : d->m_dockContainer->openedDockAreas()) {
|
||||||
for (auto dockWidget : dockArea->openedDockWidgets()) {
|
for (auto dockWidget : dockArea->openedDockWidgets())
|
||||||
dockWidget->toggleView(false);
|
dockWidget->toggleView(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void FloatingDockContainer::showEvent(QShowEvent *event) { Super::showEvent(event); }
|
void FloatingDockContainer::showEvent(QShowEvent *event) { Super::showEvent(event); }
|
||||||
|
|
||||||
@@ -379,22 +385,21 @@ namespace ADS
|
|||||||
// QEvent::NonClientAreaMouseButtonPress return the wrong mouse button
|
// QEvent::NonClientAreaMouseButtonPress return the wrong mouse button
|
||||||
// The event always returns Qt::RightButton even if the left button is clicked.
|
// The event always returns Qt::RightButton even if the left button is clicked.
|
||||||
// It is really great to work around the whole NonClientMouseArea bugs
|
// It is really great to work around the whole NonClientMouseArea bugs
|
||||||
|
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 2))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 2))
|
||||||
if (event->type()
|
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
||||||
== QEvent::
|
/*&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)*/)
|
||||||
NonClientAreaMouseButtonPress /*&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)*/) {
|
|
||||||
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::NonClientAreaMouseButtonPress"
|
|
||||||
<< event->type();
|
|
||||||
d->setState(DraggingMousePressed);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
if (event->type() == QEvent::NonClientAreaMouseButtonPress
|
||||||
&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton)) {
|
&& QGuiApplication::mouseButtons().testFlag(Qt::LeftButton))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::NonClientAreaMouseButtonPress"
|
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::NonClientAreaMouseButtonPress"
|
||||||
<< event->type();
|
<< event->type();
|
||||||
|
d->m_dragStartPos = pos();
|
||||||
d->setState(DraggingMousePressed);
|
d->setState(DraggingMousePressed);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DraggingMousePressed:
|
case DraggingMousePressed:
|
||||||
@@ -440,6 +445,37 @@ namespace ADS
|
|||||||
return QWidget::event(event);
|
return QWidget::event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FloatingDockContainer::eventFilter(QObject *watched, QEvent *event)
|
||||||
|
{
|
||||||
|
Q_UNUSED(watched);
|
||||||
|
// I have not found a way to detect non client area key press events to
|
||||||
|
// handle escape key presses. On Windows, if the escape key is pressed while
|
||||||
|
// dragging around a widget, the widget position is reset to its start position
|
||||||
|
// which in turn generates a QEvent::NonClientAreaMouseButtonRelease event
|
||||||
|
// if the mouse is outside of the widget after the move to its initial position
|
||||||
|
// or a QEvent::MouseButtonRelease event, if the mouse is inside of the widget
|
||||||
|
// after the position has been reset.
|
||||||
|
// So we can install an event filter on the application to get these events
|
||||||
|
// here to properly cancel dragging and hide the overlays.
|
||||||
|
// If we are in DraggingFloatingWidget state, it means the widget
|
||||||
|
// has been dragged already but if the position is the same like
|
||||||
|
// the start position, then this is an indication that the escape
|
||||||
|
// key has been pressed.
|
||||||
|
if (event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::NonClientAreaMouseButtonRelease)
|
||||||
|
{
|
||||||
|
qCInfo(adsLog) << Q_FUNC_INFO << "QEvent::MouseButtonRelease or QEvent::NonClientAreaMouseButtonRelease"
|
||||||
|
<< "d->m_draggingState " << d->m_draggingState;
|
||||||
|
QApplication::instance()->removeEventFilter(this);
|
||||||
|
if (d->m_dragStartPos == pos())
|
||||||
|
{
|
||||||
|
d->handleEscapeKey();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void FloatingDockContainer::startFloating(const QPoint &dragStartMousePos,
|
void FloatingDockContainer::startFloating(const QPoint &dragStartMousePos,
|
||||||
const QSize &size,
|
const QSize &size,
|
||||||
eDragState dragState,
|
eDragState dragState,
|
||||||
|
@@ -188,6 +188,7 @@ protected: // reimplements QWidget
|
|||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
virtual void hideEvent(QHideEvent *event) override;
|
virtual void hideEvent(QHideEvent *event) override;
|
||||||
virtual void showEvent(QShowEvent *event) override;
|
virtual void showEvent(QShowEvent *event) override;
|
||||||
|
virtual bool eventFilter(QObject *watched, QEvent *event) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Super = QWidget;
|
using Super = QWidget;
|
||||||
|
@@ -8,6 +8,8 @@ add_qtc_library(ClangSupport
|
|||||||
CLANG_RESOURCE_DIR="${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}/include"
|
CLANG_RESOURCE_DIR="${IDE_LIBEXEC_PATH}/clang/lib/clang/${CLANG_VERSION}/include"
|
||||||
CLANG_BINDIR="${IDE_LIBEXEC_PATH}/clang/bin"
|
CLANG_BINDIR="${IDE_LIBEXEC_PATH}/clang/bin"
|
||||||
DEFINES CLANGSUPPORT_BUILD_LIB
|
DEFINES CLANGSUPPORT_BUILD_LIB
|
||||||
|
PUBLIC_INCLUDES
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
alivemessage.cpp alivemessage.h
|
alivemessage.cpp alivemessage.h
|
||||||
annotationsmessage.cpp annotationsmessage.h
|
annotationsmessage.cpp annotationsmessage.h
|
||||||
|
@@ -3,6 +3,8 @@ add_qtc_library(Modeling
|
|||||||
DEPENDS Qt5::Widgets Utils
|
DEPENDS Qt5::Widgets Utils
|
||||||
PUBLIC_DEPENDS OptionalSvg
|
PUBLIC_DEPENDS OptionalSvg
|
||||||
INCLUDES qtserialization/inc
|
INCLUDES qtserialization/inc
|
||||||
|
PUBLIC_INCLUDES
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
qmt/config/configcontroller.cpp qmt/config/configcontroller.h
|
qmt/config/configcontroller.cpp qmt/config/configcontroller.h
|
||||||
qmt/config/sourcepos.cpp qmt/config/sourcepos.h
|
qmt/config/sourcepos.cpp qmt/config/sourcepos.h
|
||||||
|
@@ -4,7 +4,9 @@ add_qtc_library(Sqlite
|
|||||||
SQLITE_ENABLE_UNLOCK_NOTIFY SQLITE_ENABLE_COLUMN_METADATA
|
SQLITE_ENABLE_UNLOCK_NOTIFY SQLITE_ENABLE_COLUMN_METADATA
|
||||||
BUILD_SQLITE_LIBRARY
|
BUILD_SQLITE_LIBRARY
|
||||||
DEPENDS Qt5::Core Threads::Threads ${CMAKE_DL_LIBS}
|
DEPENDS Qt5::Core Threads::Threads ${CMAKE_DL_LIBS}
|
||||||
PUBLIC_INCLUDES ../3rdparty/sqlite
|
PUBLIC_INCLUDES
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
|
../3rdparty/sqlite
|
||||||
SOURCES
|
SOURCES
|
||||||
../3rdparty/sqlite/sqlite3.c
|
../3rdparty/sqlite/sqlite3.c
|
||||||
createtablesqlstatementbuilder.cpp createtablesqlstatementbuilder.h
|
createtablesqlstatementbuilder.cpp createtablesqlstatementbuilder.h
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QRegularExpression>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
@@ -81,7 +82,7 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
|
|||||||
const QTextCursor initialCursor = cursor;
|
const QTextCursor initialCursor = cursor;
|
||||||
|
|
||||||
const QChar &c = cursor.document()->characterAt(cursor.position());
|
const QChar &c = cursor.document()->characterAt(cursor.position());
|
||||||
if (!c.isLetter() && c != QLatin1Char('_'))
|
if (!c.isLetter() && c != QLatin1Char('_') && c != QLatin1Char('['))
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
// Try to find what would be the declaration we are interested in.
|
// Try to find what would be the declaration we are interested in.
|
||||||
@@ -109,8 +110,12 @@ QString DoxygenGenerator::generate(QTextCursor cursor,
|
|||||||
|
|
||||||
QString declCandidate = cursor.selectedText();
|
QString declCandidate = cursor.selectedText();
|
||||||
|
|
||||||
if (declCandidate.startsWith(QLatin1String("Q_INVOKABLE")))
|
// remove attributes like [[nodiscard]] because
|
||||||
declCandidate = declCandidate.mid(11);
|
// Document::Ptr::parse(Document::ParseDeclaration) fails on attributes
|
||||||
|
static QRegularExpression attribute("\\[\\s*\\[.*\\]\\s*\\]");
|
||||||
|
declCandidate.replace(attribute, "");
|
||||||
|
|
||||||
|
declCandidate.replace("Q_INVOKABLE", "");
|
||||||
|
|
||||||
declCandidate.replace(QChar::ParagraphSeparator, QLatin1Char('\n'));
|
declCandidate.replace(QChar::ParagraphSeparator, QLatin1Char('\n'));
|
||||||
|
|
||||||
|
@@ -118,6 +118,7 @@ QString simplifyType(const QString &typeIn)
|
|||||||
type.remove(0, 7);
|
type.remove(0, 7);
|
||||||
|
|
||||||
type.replace("short int", "short");
|
type.replace("short int", "short");
|
||||||
|
type.replace("long long int", "long long");
|
||||||
|
|
||||||
const bool isLibCpp = type.contains("std::__1");
|
const bool isLibCpp = type.contains("std::__1");
|
||||||
type.replace("std::__cxx11::", "std::");
|
type.replace("std::__cxx11::", "std::");
|
||||||
|
@@ -32,9 +32,12 @@ const char DEVICE_TYPE[] = "McuSupport.DeviceType";
|
|||||||
const char DEVICE_ID[] = "McuSupport.Device";
|
const char DEVICE_ID[] = "McuSupport.Device";
|
||||||
const char RUNCONFIGURATION[] = "McuSupport.RunConfiguration";
|
const char RUNCONFIGURATION[] = "McuSupport.RunConfiguration";
|
||||||
const char SETTINGS_ID[] = "CC.McuSupport.Configuration";
|
const char SETTINGS_ID[] = "CC.McuSupport.Configuration";
|
||||||
|
|
||||||
const char KIT_MCUTARGET_VENDOR_KEY[] = "McuSupport.McuTargetVendor";
|
const char KIT_MCUTARGET_VENDOR_KEY[] = "McuSupport.McuTargetVendor";
|
||||||
const char KIT_MCUTARGET_MODEL_KEY[] = "McuSupport.McuTargetModel";
|
const char KIT_MCUTARGET_MODEL_KEY[] = "McuSupport.McuTargetModel";
|
||||||
const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion";
|
const char KIT_MCUTARGET_SDKVERSION_KEY[] = "McuSupport.McuTargetSdkVersion";
|
||||||
|
const char KIT_MCUTARGET_KITVERSION_KEY[] = "McuSupport.McuTargetKitVersion";
|
||||||
|
const char KIT_MCUTARGET_COLORDEPTH_KEY[] = "McuSupport.McuTargetColorDepth";
|
||||||
|
|
||||||
const char SETTINGS_GROUP[] = "McuSupport";
|
const char SETTINGS_GROUP[] = "McuSupport";
|
||||||
const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_";
|
const char SETTINGS_KEY_PACKAGE_PREFIX[] = "Package_";
|
||||||
|
@@ -61,6 +61,8 @@
|
|||||||
namespace McuSupport {
|
namespace McuSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
static const int KIT_VERSION = 2; // Bumps up whenever details in Kit creation change
|
||||||
|
|
||||||
static QString packagePathFromSettings(const QString &settingsKey, const QString &defaultPath = {})
|
static QString packagePathFromSettings(const QString &settingsKey, const QString &defaultPath = {})
|
||||||
{
|
{
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
@@ -319,13 +321,13 @@ QVariant McuToolChainPackage::debuggerId() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
McuTarget::McuTarget(const QString &vendor, const QString &platform,
|
McuTarget::McuTarget(const QString &vendor, const QString &platform,
|
||||||
const QVector<McuPackage *> &packages, McuToolChainPackage *toolChainPackage)
|
const QVector<McuPackage *> &packages,
|
||||||
|
const McuToolChainPackage *toolChainPackage)
|
||||||
: m_vendor(vendor)
|
: m_vendor(vendor)
|
||||||
, m_qulPlatform(platform)
|
, m_qulPlatform(platform)
|
||||||
, m_packages(packages)
|
, m_packages(packages)
|
||||||
, m_toolChainPackage(toolChainPackage)
|
, m_toolChainPackage(toolChainPackage)
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_toolChainPackage == nullptr || m_packages.contains(m_toolChainPackage));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString McuTarget::vendor() const
|
QString McuTarget::vendor() const
|
||||||
@@ -338,7 +340,7 @@ QVector<McuPackage *> McuTarget::packages() const
|
|||||||
return m_packages;
|
return m_packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
McuToolChainPackage *McuTarget::toolChainPackage() const
|
const McuToolChainPackage *McuTarget::toolChainPackage() const
|
||||||
{
|
{
|
||||||
return m_toolChainPackage;
|
return m_toolChainPackage;
|
||||||
}
|
}
|
||||||
@@ -467,16 +469,18 @@ static void setKitProperties(const QString &kitName, ProjectExplorer::Kit *k,
|
|||||||
const McuTarget* mcuTarget)
|
const McuTarget* mcuTarget)
|
||||||
{
|
{
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Constants;
|
||||||
|
|
||||||
k->setUnexpandedDisplayName(kitName);
|
k->setUnexpandedDisplayName(kitName);
|
||||||
k->setValue(Constants::KIT_MCUTARGET_VENDOR_KEY, mcuTarget->vendor());
|
k->setValue(KIT_MCUTARGET_VENDOR_KEY, mcuTarget->vendor());
|
||||||
k->setValue(Constants::KIT_MCUTARGET_MODEL_KEY, mcuTarget->qulPlatform());
|
k->setValue(KIT_MCUTARGET_MODEL_KEY, mcuTarget->qulPlatform());
|
||||||
k->setValue(Constants::KIT_MCUTARGET_SDKVERSION_KEY,
|
k->setValue(KIT_MCUTARGET_COLORDEPTH_KEY, mcuTarget->colorDepth());
|
||||||
McuSupportOptions::supportedQulVersion().toString());
|
k->setValue(KIT_MCUTARGET_SDKVERSION_KEY, McuSupportOptions::supportedQulVersion().toString());
|
||||||
|
k->setValue(KIT_MCUTARGET_KITVERSION_KEY, KIT_VERSION);
|
||||||
k->setAutoDetected(true);
|
k->setAutoDetected(true);
|
||||||
k->makeSticky();
|
k->makeSticky();
|
||||||
if (mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop)
|
if (mcuTarget->toolChainPackage()->type() == McuToolChainPackage::TypeDesktop)
|
||||||
k->setDeviceTypeForIcon(Constants::DEVICE_TYPE);
|
k->setDeviceTypeForIcon(DEVICE_TYPE);
|
||||||
QSet<Core::Id> irrelevant = {
|
QSet<Core::Id> irrelevant = {
|
||||||
SysRootKitAspect::id(),
|
SysRootKitAspect::id(),
|
||||||
QtSupport::QtKitAspect::id()
|
QtSupport::QtKitAspect::id()
|
||||||
@@ -520,7 +524,7 @@ static void setKitDevice(ProjectExplorer::Kit *k, const McuTarget* mcuTarget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget,
|
static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarget,
|
||||||
McuPackage *qtForMCUsSdkPackage)
|
const McuPackage *qtForMCUsSdkPackage)
|
||||||
{
|
{
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -534,18 +538,17 @@ static void setKitEnvironment(ProjectExplorer::Kit *k, const McuTarget* mcuTarge
|
|||||||
&& !CMakeProjectManager::CMakeToolManager::defaultCMakeTool()->hasFileApi())
|
&& !CMakeProjectManager::CMakeToolManager::defaultCMakeTool()->hasFileApi())
|
||||||
pathAdditions.append(QDir::toNativeSeparators(qtForMCUsSdkPackage->path() + "/bin"));
|
pathAdditions.append(QDir::toNativeSeparators(qtForMCUsSdkPackage->path() + "/bin"));
|
||||||
|
|
||||||
QVector<McuPackage *> packagesIncludingSdk;
|
auto processPackage = [&pathAdditions, &changes](const McuPackage *package) {
|
||||||
packagesIncludingSdk.reserve(mcuTarget->packages().size() + 1);
|
|
||||||
packagesIncludingSdk.append(mcuTarget->packages());
|
|
||||||
packagesIncludingSdk.append(qtForMCUsSdkPackage);
|
|
||||||
|
|
||||||
for (auto package : packagesIncludingSdk) {
|
|
||||||
if (package->addToPath())
|
if (package->addToPath())
|
||||||
pathAdditions.append(QDir::toNativeSeparators(package->path()));
|
pathAdditions.append(QDir::toNativeSeparators(package->path()));
|
||||||
if (!package->environmentVariableName().isEmpty())
|
if (!package->environmentVariableName().isEmpty())
|
||||||
changes.append({package->environmentVariableName(),
|
changes.append({package->environmentVariableName(),
|
||||||
QDir::toNativeSeparators(package->path())});
|
QDir::toNativeSeparators(package->path())});
|
||||||
}
|
};
|
||||||
|
for (auto package : mcuTarget->packages())
|
||||||
|
processPackage(package);
|
||||||
|
processPackage(qtForMCUsSdkPackage);
|
||||||
|
|
||||||
pathAdditions.append("${Path}");
|
pathAdditions.append("${Path}");
|
||||||
pathAdditions.append(QDir::toNativeSeparators(Core::ICore::libexecPath() + "/clang/bin"));
|
pathAdditions.append(QDir::toNativeSeparators(Core::ICore::libexecPath() + "/clang/bin"));
|
||||||
const QString path = QLatin1String(Utils::HostOsInfo().isWindowsHost() ? "Path" : "PATH");
|
const QString path = QLatin1String(Utils::HostOsInfo().isWindowsHost() ? "Path" : "PATH");
|
||||||
@@ -589,7 +592,7 @@ static void setKitQtVersionOptions(ProjectExplorer::Kit *k)
|
|||||||
QtSupport::QtKitAspect::setQtVersion(k, nullptr);
|
QtSupport::QtKitAspect::setQtVersion(k, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const
|
QString McuSupportOptions::kitName(const McuTarget *mcuTarget)
|
||||||
{
|
{
|
||||||
// TODO: get version from qulSdkPackage and insert into name
|
// TODO: get version from qulSdkPackage and insert into name
|
||||||
const QString colorDepth = mcuTarget->colorDepth() > 0
|
const QString colorDepth = mcuTarget->colorDepth() > 0
|
||||||
@@ -604,28 +607,52 @@ QString McuSupportOptions::kitName(const McuTarget *mcuTarget) const
|
|||||||
.arg(supportedQulVersion().toString(), targetName, colorDepth);
|
.arg(supportedQulVersion().toString(), targetName, colorDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTargt)
|
QList<ProjectExplorer::Kit *> McuSupportOptions::existingKits(const McuTarget *mcuTarget)
|
||||||
{
|
{
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
const QString mcuTargetKitName = kitName(mcuTargt);
|
using namespace Constants;
|
||||||
return Utils::filtered(KitManager::kits(), [&mcuTargetKitName](Kit *kit) {
|
return Utils::filtered(KitManager::kits(), [mcuTarget](Kit *kit) {
|
||||||
return kit->isAutoDetected() && kit->unexpandedDisplayName() == mcuTargetKitName;
|
return kit->isAutoDetected()
|
||||||
|
&& kit->value(KIT_MCUTARGET_KITVERSION_KEY) == KIT_VERSION
|
||||||
|
&& kit->value(KIT_MCUTARGET_SDKVERSION_KEY) ==
|
||||||
|
McuSupportOptions::supportedQulVersion().toString()
|
||||||
|
&& (!mcuTarget || (
|
||||||
|
kit->value(KIT_MCUTARGET_VENDOR_KEY) == mcuTarget->vendor()
|
||||||
|
&& kit->value(KIT_MCUTARGET_MODEL_KEY) == mcuTarget->qulPlatform()
|
||||||
|
&& kit->value(KIT_MCUTARGET_COLORDEPTH_KEY) == mcuTarget->colorDepth()
|
||||||
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget)
|
QList<ProjectExplorer::Kit *> McuSupportOptions::outdatedKits()
|
||||||
|
{
|
||||||
|
return Utils::filtered(ProjectExplorer::KitManager::kits(), [](ProjectExplorer::Kit *kit) {
|
||||||
|
return kit->isAutoDetected()
|
||||||
|
&& !kit->value(Constants::KIT_MCUTARGET_VENDOR_KEY).isNull()
|
||||||
|
&& kit->value(Constants::KIT_MCUTARGET_KITVERSION_KEY) != KIT_VERSION;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void McuSupportOptions::removeOutdatedKits()
|
||||||
|
{
|
||||||
|
for (auto kit : McuSupportOptions::outdatedKits())
|
||||||
|
ProjectExplorer::KitManager::deregisterKit(kit);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectExplorer::Kit *McuSupportOptions::newKit(const McuTarget *mcuTarget,
|
||||||
|
const McuPackage *qtForMCUsSdk)
|
||||||
{
|
{
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
const auto init = [this, mcuTarget](Kit *k) {
|
const auto init = [mcuTarget, qtForMCUsSdk](Kit *k) {
|
||||||
KitGuard kitGuard(k);
|
KitGuard kitGuard(k);
|
||||||
|
|
||||||
setKitProperties(kitName(mcuTarget), k, mcuTarget);
|
setKitProperties(kitName(mcuTarget), k, mcuTarget);
|
||||||
setKitDevice(k, mcuTarget);
|
setKitDevice(k, mcuTarget);
|
||||||
setKitToolchains(k, mcuTarget->toolChainPackage());
|
setKitToolchains(k, mcuTarget->toolChainPackage());
|
||||||
setKitDebugger(k, mcuTarget->toolChainPackage());
|
setKitDebugger(k, mcuTarget->toolChainPackage());
|
||||||
setKitEnvironment(k, mcuTarget, qtForMCUsSdkPackage);
|
setKitEnvironment(k, mcuTarget, qtForMCUsSdk);
|
||||||
setKitCMakeOptions(k, mcuTarget, qtForMCUsSdkPackage->path());
|
setKitCMakeOptions(k, mcuTarget, qtForMCUsSdk->path());
|
||||||
setKitQtVersionOptions(k);
|
setKitQtVersionOptions(k);
|
||||||
|
|
||||||
k->setup();
|
k->setup();
|
||||||
|
@@ -132,11 +132,11 @@ class McuTarget : public QObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
McuTarget(const QString &vendor, const QString &platform, const QVector<McuPackage *> &packages,
|
McuTarget(const QString &vendor, const QString &platform, const QVector<McuPackage *> &packages,
|
||||||
McuToolChainPackage *toolChainPackage);
|
const McuToolChainPackage *toolChainPackage);
|
||||||
|
|
||||||
QString vendor() const;
|
QString vendor() const;
|
||||||
QVector<McuPackage *> packages() const;
|
QVector<McuPackage *> packages() const;
|
||||||
McuToolChainPackage *toolChainPackage() const;
|
const McuToolChainPackage *toolChainPackage() const;
|
||||||
QString qulPlatform() const;
|
QString qulPlatform() const;
|
||||||
void setColorDepth(int colorDepth);
|
void setColorDepth(int colorDepth);
|
||||||
int colorDepth() const;
|
int colorDepth() const;
|
||||||
@@ -146,7 +146,7 @@ private:
|
|||||||
const QString m_vendor;
|
const QString m_vendor;
|
||||||
const QString m_qulPlatform;
|
const QString m_qulPlatform;
|
||||||
const QVector<McuPackage*> m_packages;
|
const QVector<McuPackage*> m_packages;
|
||||||
McuToolChainPackage *m_toolChainPackage;
|
const McuToolChainPackage *m_toolChainPackage;
|
||||||
int m_colorDepth = -1;
|
int m_colorDepth = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,10 +165,12 @@ public:
|
|||||||
void setQulDir(const Utils::FilePath &dir);
|
void setQulDir(const Utils::FilePath &dir);
|
||||||
static Utils::FilePath qulDirFromSettings();
|
static Utils::FilePath qulDirFromSettings();
|
||||||
|
|
||||||
QString kitName(const McuTarget* mcuTarget) const;
|
static QString kitName(const McuTarget* mcuTarget);
|
||||||
|
|
||||||
QList<ProjectExplorer::Kit *> existingKits(const McuTarget *mcuTargt);
|
static QList<ProjectExplorer::Kit *> existingKits(const McuTarget *mcuTarget);
|
||||||
ProjectExplorer::Kit *newKit(const McuTarget *mcuTarget);
|
static QList<ProjectExplorer::Kit *> outdatedKits();
|
||||||
|
static void removeOutdatedKits();
|
||||||
|
static ProjectExplorer::Kit *newKit(const McuTarget *mcuTarget, const McuPackage *qtForMCUsSdk);
|
||||||
void populatePackagesAndTargets();
|
void populatePackagesAndTargets();
|
||||||
static void registerQchFiles();
|
static void registerQchFiles();
|
||||||
static void registerExamples();
|
static void registerExamples();
|
||||||
|
@@ -168,7 +168,7 @@ void McuSupportOptionsWidget::updateStatus()
|
|||||||
mcuTargetValid ? QString::fromLatin1(
|
mcuTargetValid ? QString::fromLatin1(
|
||||||
"A kit <b>%1</b> for the selected target can be "
|
"A kit <b>%1</b> for the selected target can be "
|
||||||
"generated. Press Apply to generate it.")
|
"generated. Press Apply to generate it.")
|
||||||
.arg(m_options.kitName(mcuTarget))
|
.arg(McuSupportOptions::kitName(mcuTarget))
|
||||||
: "Provide the package paths in order to create a kit "
|
: "Provide the package paths in order to create a kit "
|
||||||
"for your target.");
|
"for your target.");
|
||||||
}
|
}
|
||||||
@@ -231,14 +231,15 @@ void McuSupportOptionsWidget::apply()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
McuSupportOptions::registerQchFiles();
|
McuSupportOptions::registerQchFiles();
|
||||||
|
McuSupportOptions::removeOutdatedKits();
|
||||||
|
|
||||||
const McuTarget *mcuTarget = currentMcuTarget();
|
const McuTarget *mcuTarget = currentMcuTarget();
|
||||||
if (!mcuTarget)
|
if (!mcuTarget)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (auto existingKit : m_options.existingKits(mcuTarget))
|
for (auto existingKit : McuSupportOptions::existingKits(mcuTarget))
|
||||||
ProjectExplorer::KitManager::deregisterKit(existingKit);
|
ProjectExplorer::KitManager::deregisterKit(existingKit);
|
||||||
m_options.newKit(mcuTarget);
|
McuSupportOptions::newKit(mcuTarget, m_options.qtForMCUsSdkPackage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
||||||
@@ -246,8 +247,8 @@ void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
|||||||
m_options.populatePackagesAndTargets();
|
m_options.populatePackagesAndTargets();
|
||||||
m_mcuTargetsComboBox->clear();
|
m_mcuTargetsComboBox->clear();
|
||||||
m_mcuTargetsComboBox->addItems(
|
m_mcuTargetsComboBox->addItems(
|
||||||
Utils::transform<QStringList>(m_options.mcuTargets, [this](McuTarget *t){
|
Utils::transform<QStringList>(m_options.mcuTargets, [](McuTarget *t) {
|
||||||
return m_options.kitName(t);
|
return McuSupportOptions::kitName(t);
|
||||||
}));
|
}));
|
||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
@@ -178,12 +178,12 @@ void BaseStringAspect::toMap(QVariantMap &map) const
|
|||||||
|
|
||||||
FilePath BaseStringAspect::filePath() const
|
FilePath BaseStringAspect::filePath() const
|
||||||
{
|
{
|
||||||
return FilePath::fromString(d->m_value);
|
return FilePath::fromUserInput(d->m_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseStringAspect::setFilePath(const FilePath &val)
|
void BaseStringAspect::setFilePath(const FilePath &val)
|
||||||
{
|
{
|
||||||
setValue(val.toString());
|
setValue(val.toUserOutput());
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseStringAspect::setLabelText(const QString &labelText)
|
void BaseStringAspect::setLabelText(const QString &labelText)
|
||||||
|
@@ -469,7 +469,7 @@ void ExecutableAspect::setPlaceHolderText(const QString &placeHolderText)
|
|||||||
|
|
||||||
void ExecutableAspect::setExecutable(const FilePath &executable)
|
void ExecutableAspect::setExecutable(const FilePath &executable)
|
||||||
{
|
{
|
||||||
m_executable.setValue(executable.toString());
|
m_executable.setFilePath(executable);
|
||||||
m_executable.setShowToolTipOnLabel(true);
|
m_executable.setShowToolTipOnLabel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,7 +6,8 @@ add_qtc_plugin(QmlDesigner
|
|||||||
DESIGNER_CORE_LIBRARY
|
DESIGNER_CORE_LIBRARY
|
||||||
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
|
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
|
||||||
PUBLIC_INCLUDES
|
PUBLIC_INCLUDES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/designercore/include
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/designercore/include"
|
||||||
PLUGIN_DEPENDS
|
PLUGIN_DEPENDS
|
||||||
Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager
|
Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager
|
||||||
QtSupport TextEditor
|
QtSupport TextEditor
|
||||||
@@ -155,6 +156,7 @@ extend_qtc_plugin(QmlDesigner
|
|||||||
|
|
||||||
extend_qtc_plugin(QmlDesigner
|
extend_qtc_plugin(QmlDesigner
|
||||||
SOURCES_PREFIX ../../../share/qtcreator/qml/qmlpuppet/types
|
SOURCES_PREFIX ../../../share/qtcreator/qml/qmlpuppet/types
|
||||||
|
PUBLIC_INCLUDES ../../../share/qtcreator/qml/qmlpuppet/types
|
||||||
SOURCES enumeration.h
|
SOURCES enumeration.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -78,7 +78,8 @@ QList<ModelNode> SelectionContext::selectedModelNodes() const
|
|||||||
|
|
||||||
bool SelectionContext::hasSingleSelectedModelNode() const
|
bool SelectionContext::hasSingleSelectedModelNode() const
|
||||||
{
|
{
|
||||||
return view()->hasSelectedModelNodes();
|
return view()->hasSingleSelectedModelNode()
|
||||||
|
&& firstSelectedModelNode().isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractView *SelectionContext::view() const
|
AbstractView *SelectionContext::view() const
|
||||||
|
@@ -32,10 +32,13 @@
|
|||||||
#include <nodehints.h>
|
#include <nodehints.h>
|
||||||
#include <nodemetainfo.h>
|
#include <nodemetainfo.h>
|
||||||
|
|
||||||
|
#include <theme.h>
|
||||||
|
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QFontDatabase>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
@@ -47,6 +50,36 @@
|
|||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
const int flowBlockSize = 200;
|
const int flowBlockSize = 200;
|
||||||
|
const int blockRadius = 18;
|
||||||
|
const int blockAdjust = 40;
|
||||||
|
|
||||||
|
const char startNodeIcon[] = "\u0055";
|
||||||
|
|
||||||
|
void drawIcon(QPainter *painter,
|
||||||
|
int x,
|
||||||
|
int y,
|
||||||
|
const QString &iconSymbol,
|
||||||
|
int fontSize, int iconSize,
|
||||||
|
const QColor &penColor)
|
||||||
|
{
|
||||||
|
static QFontDatabase a;
|
||||||
|
|
||||||
|
const QString fontName = "qtds_propertyIconFont.ttf";
|
||||||
|
|
||||||
|
Q_ASSERT(a.hasFamily(fontName));
|
||||||
|
|
||||||
|
if (a.hasFamily(fontName)) {
|
||||||
|
QFont font(fontName);
|
||||||
|
font.setPixelSize(fontSize);
|
||||||
|
|
||||||
|
painter->save();
|
||||||
|
painter->setPen(penColor);
|
||||||
|
painter->setFont(font);
|
||||||
|
painter->drawText(QRectF(x, y, iconSize, iconSize), iconSymbol);
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FormEditorScene *FormEditorItem::scene() const {
|
FormEditorScene *FormEditorItem::scene() const {
|
||||||
return qobject_cast<FormEditorScene*>(QGraphicsItem::scene());
|
return qobject_cast<FormEditorScene*>(QGraphicsItem::scene());
|
||||||
@@ -578,6 +611,7 @@ void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setJoinStyle(Qt::MiterJoin);
|
pen.setJoinStyle(Qt::MiterJoin);
|
||||||
@@ -622,10 +656,9 @@ void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
fillColor = qmlItemNode().modelNode().auxiliaryData("fillColor").value<QColor>();
|
fillColor = qmlItemNode().modelNode().auxiliaryData("fillColor").value<QColor>();
|
||||||
|
|
||||||
if (fillColor.alpha() > 0)
|
if (fillColor.alpha() > 0)
|
||||||
painter->fillRect(boundingRect(), fillColor);
|
painter->setBrush(fillColor);
|
||||||
|
|
||||||
painter->drawRect(boundingRect());
|
|
||||||
|
|
||||||
|
painter->drawRoundedRect(boundingRect(), blockRadius, blockRadius);
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
@@ -990,6 +1023,7 @@ void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
ResolveConnection resolved(qmlItemNode());
|
ResolveConnection resolved(qmlItemNode());
|
||||||
|
|
||||||
@@ -1022,8 +1056,8 @@ void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
toRect.translate(QmlItemNode(resolved.to).flowPosition());
|
toRect.translate(QmlItemNode(resolved.to).flowPosition());
|
||||||
|
|
||||||
if (resolved.isStartLine) {
|
if (resolved.isStartLine) {
|
||||||
fromRect = QRectF(0,0,50,50);
|
fromRect = QRectF(0, 0, 96, 96);
|
||||||
fromRect.translate(QmlItemNode(resolved.to).flowPosition() + QPoint(-120, toRect.height() / 2 - 25));
|
fromRect.translate(QmlItemNode(resolved.to).flowPosition() + QPoint(-180, toRect.height() / 2 - 96 / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
toRect.translate(-pos());
|
toRect.translate(-pos());
|
||||||
@@ -1076,23 +1110,28 @@ void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphi
|
|||||||
if (qmlItemNode().modelNode().hasAuxiliaryData("breakPoint"))
|
if (qmlItemNode().modelNode().hasAuxiliaryData("breakPoint"))
|
||||||
breakOffset = qmlItemNode().modelNode().auxiliaryData("breakPoint").toInt();
|
breakOffset = qmlItemNode().modelNode().auxiliaryData("breakPoint").toInt();
|
||||||
|
|
||||||
|
if (resolved.isStartLine)
|
||||||
|
fromRect.translate(0, inOffset);
|
||||||
|
|
||||||
paintConnection(painter, fromRect, toRect, width, adjustedWidth ,color, dash, outOffset, inOffset, breakOffset);
|
paintConnection(painter, fromRect, toRect, width, adjustedWidth ,color, dash, outOffset, inOffset, breakOffset);
|
||||||
|
|
||||||
if (resolved.isStartLine) {
|
if (resolved.isStartLine) {
|
||||||
|
|
||||||
|
const QString icon = Theme::getIconUnicode(Theme::startNode);
|
||||||
|
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setCosmetic(true);
|
pen.setCosmetic(true);
|
||||||
|
|
||||||
pen.setColor(color);
|
pen.setColor(color);
|
||||||
painter->setPen(pen);
|
painter->setPen(pen);
|
||||||
painter->drawRect(fromRect);
|
|
||||||
|
|
||||||
if (scaleFactor > 0.4) {
|
const int iconAdjust = 48;
|
||||||
painter->drawLine(fromRect.topRight() + QPoint(20,10), fromRect.bottomRight() + QPoint(20,-10));
|
const int offset = 96;
|
||||||
painter->drawLine(fromRect.topRight() + QPoint(25,12), fromRect.bottomRight() + QPoint(25,-12));
|
const int size = fromRect.width();
|
||||||
painter->drawLine(fromRect.topRight() + QPoint(30,15), fromRect.bottomRight() + QPoint(30,-15));
|
const int iconSize = size - iconAdjust;
|
||||||
painter->drawLine(fromRect.topRight() + QPoint(35,17), fromRect.bottomRight() + QPoint(35,-17));
|
const int x = fromRect.topRight().x() - offset;
|
||||||
painter->drawLine(fromRect.topRight() + QPoint(40,20), fromRect.bottomRight() + QPoint(40,-20));
|
const int y = fromRect.topRight().y();
|
||||||
}
|
painter->drawRoundedRect(x, y , size - 10, size, size / 2, iconSize / 2);
|
||||||
|
drawIcon(painter, x + iconAdjust / 2, y + iconAdjust / 2, icon, iconSize, iconSize, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
@@ -1141,6 +1180,9 @@ void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGrap
|
|||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
painter->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setJoinStyle(Qt::MiterJoin);
|
pen.setJoinStyle(Qt::MiterJoin);
|
||||||
pen.setCosmetic(true);
|
pen.setCosmetic(true);
|
||||||
@@ -1179,20 +1221,37 @@ void FormEditorFlowDecisionItem::paint(QPainter *painter, const QStyleOptionGrap
|
|||||||
if (qmlItemNode().modelNode().hasAuxiliaryData("fillColor"))
|
if (qmlItemNode().modelNode().hasAuxiliaryData("fillColor"))
|
||||||
fillColor = qmlItemNode().modelNode().auxiliaryData("fillColor").value<QColor>();
|
fillColor = qmlItemNode().modelNode().auxiliaryData("fillColor").value<QColor>();
|
||||||
|
|
||||||
|
painter->save();
|
||||||
|
|
||||||
|
if (m_iconType == DecisionIcon) {
|
||||||
|
painter->translate(boundingRect().center());
|
||||||
|
painter->rotate(45);
|
||||||
|
painter->translate(-boundingRect().center());
|
||||||
|
}
|
||||||
|
|
||||||
if (fillColor.alpha() > 0)
|
if (fillColor.alpha() > 0)
|
||||||
painter->fillRect(boundingRect(), fillColor);
|
painter->setBrush(fillColor);
|
||||||
|
|
||||||
painter->drawLine(boundingRect().left(), boundingRect().center().y(),
|
int radius = blockRadius;
|
||||||
boundingRect().center().x(), boundingRect().top());
|
|
||||||
|
|
||||||
painter->drawLine(boundingRect().center().x(), boundingRect().top(),
|
const QRectF adjustedRect = boundingRect().adjusted(blockAdjust,
|
||||||
boundingRect().right(), boundingRect().center().y());
|
blockAdjust,
|
||||||
|
-blockAdjust,
|
||||||
|
-blockAdjust);
|
||||||
|
|
||||||
painter->drawLine(boundingRect().right(), boundingRect().center().y(),
|
painter->drawRoundedRect(adjustedRect, radius, radius);
|
||||||
boundingRect().center().x(), boundingRect().bottom());
|
|
||||||
|
|
||||||
painter->drawLine(boundingRect().center().x(), boundingRect().bottom(),
|
const int iconDecrement = 32;
|
||||||
boundingRect().left(), boundingRect().center().y());
|
const int iconSize = adjustedRect.width() - iconDecrement;
|
||||||
|
const int offset = iconDecrement / 2 + blockAdjust;
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
|
||||||
|
const QString icon = (m_iconType ==
|
||||||
|
WildcardIcon) ? Theme::getIconUnicode(Theme::wildcard)
|
||||||
|
: Theme::getIconUnicode(Theme::decisionNode);
|
||||||
|
|
||||||
|
drawIcon(painter, offset, offset, icon, iconSize, iconSize, flowColor);
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
@@ -207,9 +207,17 @@ public:
|
|||||||
bool flowHitTest(const QPointF &point) const override;
|
bool flowHitTest(const QPointF &point) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FormEditorFlowDecisionItem(const QmlItemNode &qmlItemNode, FormEditorScene* scene)
|
enum IconType {
|
||||||
: FormEditorFlowItem(qmlItemNode, scene)
|
DecisionIcon,
|
||||||
|
WildcardIcon
|
||||||
|
};
|
||||||
|
|
||||||
|
FormEditorFlowDecisionItem(const QmlItemNode &qmlItemNode,
|
||||||
|
FormEditorScene* scene,
|
||||||
|
IconType iconType = DecisionIcon)
|
||||||
|
: FormEditorFlowItem(qmlItemNode, scene), m_iconType(iconType)
|
||||||
{}
|
{}
|
||||||
|
IconType m_iconType;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FormEditorFlowWildcardItem : FormEditorFlowDecisionItem
|
class FormEditorFlowWildcardItem : FormEditorFlowDecisionItem
|
||||||
@@ -221,8 +229,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
FormEditorFlowWildcardItem(const QmlItemNode &qmlItemNode, FormEditorScene* scene)
|
FormEditorFlowWildcardItem(const QmlItemNode &qmlItemNode, FormEditorScene* scene)
|
||||||
: FormEditorFlowDecisionItem(qmlItemNode, scene)
|
: FormEditorFlowDecisionItem(qmlItemNode, scene, WildcardIcon)
|
||||||
{}
|
{
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline int FormEditorItem::type() const
|
inline int FormEditorItem::type() const
|
||||||
|
@@ -229,7 +229,7 @@ void TransitionTool::clear()
|
|||||||
void TransitionTool::mousePressEvent(const QList<QGraphicsItem*> &itemList,
|
void TransitionTool::mousePressEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent *event)
|
QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_block)
|
if (m_blockEvents)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event->button() != Qt::LeftButton)
|
if (event->button() != Qt::LeftButton)
|
||||||
@@ -291,7 +291,7 @@ void TransitionTool::dragMoveEvent(const QList<QGraphicsItem*> &/*itemList*/, Q
|
|||||||
void TransitionTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
void TransitionTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent *event)
|
QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (m_block)
|
if (m_blockEvents)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
@@ -362,7 +362,7 @@ void TransitionTool::activateTool()
|
|||||||
|
|
||||||
void TransitionTool::unblock()
|
void TransitionTool::unblock()
|
||||||
{
|
{
|
||||||
m_block = false;
|
m_blockEvents = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsLineItem *TransitionTool::lineItem()
|
QGraphicsLineItem *TransitionTool::lineItem()
|
||||||
@@ -389,7 +389,7 @@ FormEditorItem *TransitionTool::currentFormEditorItem() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TransitionTool::createItems() {
|
void TransitionTool::createItems() {
|
||||||
m_block = true;
|
m_blockEvents = true;
|
||||||
QTimer::singleShot(200, this, [this](){ unblock(); });
|
QTimer::singleShot(200, this, [this](){ unblock(); });
|
||||||
|
|
||||||
if (!lineItem())
|
if (!lineItem())
|
||||||
|
@@ -92,7 +92,7 @@ private:
|
|||||||
std::unique_ptr<QGraphicsLineItem> m_lineItem;
|
std::unique_ptr<QGraphicsLineItem> m_lineItem;
|
||||||
std::unique_ptr<QGraphicsRectItem> m_rectangleItem1;
|
std::unique_ptr<QGraphicsRectItem> m_rectangleItem1;
|
||||||
std::unique_ptr<QGraphicsRectItem> m_rectangleItem2;
|
std::unique_ptr<QGraphicsRectItem> m_rectangleItem2;
|
||||||
bool m_block = true;
|
bool m_blockEvents = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //QmlDesigner
|
} //QmlDesigner
|
||||||
|
@@ -103,11 +103,11 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
|
|||||||
|
|
||||||
m_itemViewQuickWidget->rootContext()->setContextProperties(
|
m_itemViewQuickWidget->rootContext()->setContextProperties(
|
||||||
QVector<QQmlContext::PropertyPair>{
|
QVector<QQmlContext::PropertyPair>{
|
||||||
{"itemLibraryModel", QVariant::fromValue(m_itemLibraryModel.data())},
|
{{"itemLibraryModel"}, QVariant::fromValue(m_itemLibraryModel.data())},
|
||||||
{"itemLibraryIconWidth", m_itemIconSize.width()},
|
{{"itemLibraryIconWidth"}, m_itemIconSize.width()},
|
||||||
{"itemLibraryIconHeight", m_itemIconSize.height()},
|
{{"itemLibraryIconHeight"}, m_itemIconSize.height()},
|
||||||
{"rootView", QVariant::fromValue(this)},
|
{{"rootView"}, QVariant::fromValue(this)},
|
||||||
{"highlightColor", Utils::StyleHelper::notTooBrightHighlightColor()}
|
{{"highlightColor"}, Utils::StyleHelper::notTooBrightHighlightColor()}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -421,6 +421,9 @@ void NavigatorView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeL
|
|||||||
|
|
||||||
void NavigatorView::updateItemSelection()
|
void NavigatorView::updateItemSelection()
|
||||||
{
|
{
|
||||||
|
if (!isAttached())
|
||||||
|
return;
|
||||||
|
|
||||||
QItemSelection itemSelection;
|
QItemSelection itemSelection;
|
||||||
foreach (const ModelNode &node, selectedModelNodes()) {
|
foreach (const ModelNode &node, selectedModelNodes()) {
|
||||||
const QModelIndex index = indexForModelNode(node);
|
const QModelIndex index = indexForModelNode(node);
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include "propertycontainer.h"
|
#include "propertycontainer.h"
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include <QSharedDataPointer>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ public:
|
|||||||
void addHints(const QHash<QString, QString> &hints);
|
void addHints(const QHash<QString, QString> &hints);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QExplicitlySharedDataPointer<Internal::ItemLibraryEntryData> m_data;
|
QSharedDataPointer<Internal::ItemLibraryEntryData> m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QMLDESIGNERCORE_EXPORT ItemLibraryInfo : public QObject
|
class QMLDESIGNERCORE_EXPORT ItemLibraryInfo : public QObject
|
||||||
|
@@ -91,7 +91,12 @@ QStringList globalQtEnums()
|
|||||||
"Horizontal", "Vertical", "AlignVCenter", "AlignLeft", "LeftToRight", "RightToLeft",
|
"Horizontal", "Vertical", "AlignVCenter", "AlignLeft", "LeftToRight", "RightToLeft",
|
||||||
"AlignHCenter", "AlignRight", "AlignBottom", "AlignBaseline", "AlignTop", "BottomLeft",
|
"AlignHCenter", "AlignRight", "AlignBottom", "AlignBaseline", "AlignTop", "BottomLeft",
|
||||||
"LeftEdge", "RightEdge", "BottomEdge", "TopEdge", "TabFocus", "ClickFocus", "StrongFocus",
|
"LeftEdge", "RightEdge", "BottomEdge", "TopEdge", "TabFocus", "ClickFocus", "StrongFocus",
|
||||||
"WheelFocus", "NoFocus"
|
"WheelFocus", "NoFocus", "ArrowCursor", "UpArrowCursor", "CrossCursor", "WaitCursor",
|
||||||
|
"IBeamCursor", "SizeVerCursor", "SizeHorCursor", "SizeBDiagCursor", "SizeFDiagCursor",
|
||||||
|
"SizeAllCursor", "BlankCursor", "SplitVCursor", "SplitHCursor", "PointingHandCursor",
|
||||||
|
"ForbiddenCursor", "WhatsThisCursor", "BusyCursor", "OpenHandCursor", "ClosedHandCursor",
|
||||||
|
"DragCopyCursor", "DragMoveCursor", "DragLinkCursor", "TopToBottom",
|
||||||
|
"LeftButton", "RightButton", "MiddleButton", "BackButton", "ForwardButton", "AllButtons"
|
||||||
};
|
};
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
@@ -101,7 +106,7 @@ QStringList knownEnumScopes()
|
|||||||
{
|
{
|
||||||
static const QStringList list = {
|
static const QStringList list = {
|
||||||
"TextInput", "TextEdit", "Material", "Universal", "Font", "Shape", "ShapePath",
|
"TextInput", "TextEdit", "Material", "Universal", "Font", "Shape", "ShapePath",
|
||||||
"AbstractButton", "Text", "ShaderEffectSource"
|
"AbstractButton", "Text", "ShaderEffectSource", "Grid"
|
||||||
};
|
};
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@@ -269,9 +269,12 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != SemanticHighlighter::UnknownType)
|
if (type != SemanticHighlighter::UnknownType) {
|
||||||
|
// do not add uses of length 0 - this messes up highlighting (e.g. anon functions)
|
||||||
|
if (location.length != 0)
|
||||||
addUse(location, type);
|
addUse(location, type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void processTypeId(UiQualifiedId *typeId)
|
void processTypeId(UiQualifiedId *typeId)
|
||||||
{
|
{
|
||||||
|
@@ -4,6 +4,8 @@ endif()
|
|||||||
|
|
||||||
add_qtc_library(designerintegrationv2 STATIC
|
add_qtc_library(designerintegrationv2 STATIC
|
||||||
DEPENDS Qt5::Designer Qt5::Widgets
|
DEPENDS Qt5::Designer Qt5::Widgets
|
||||||
|
PUBLIC_INCLUDES
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
formresizer.cpp formresizer.h
|
formresizer.cpp formresizer.h
|
||||||
sizehandlerect.cpp sizehandlerect.h
|
sizehandlerect.cpp sizehandlerect.h
|
||||||
|
@@ -18,6 +18,7 @@ add_qtc_library(shared_help STATIC
|
|||||||
"${PLUGIN_SOURCE_DIR}"
|
"${PLUGIN_SOURCE_DIR}"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/shared_help_autogen/include${autogen_suffix}"
|
"${CMAKE_CURRENT_BINARY_DIR}/shared_help_autogen/include${autogen_suffix}"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/"
|
"${CMAKE_CURRENT_BINARY_DIR}/"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
bookmarkdialog.ui
|
bookmarkdialog.ui
|
||||||
bookmarkmanager.cpp bookmarkmanager.h
|
bookmarkmanager.cpp bookmarkmanager.h
|
||||||
|
@@ -3,6 +3,7 @@ add_qtc_library(clangbackend_lib STATIC
|
|||||||
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
|
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
|
||||||
PUBLIC_INCLUDES
|
PUBLIC_INCLUDES
|
||||||
${CLANG_INCLUDE_DIRS}
|
${CLANG_INCLUDE_DIRS}
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
clangasyncjob.h
|
clangasyncjob.h
|
||||||
clangbackend_global.h
|
clangbackend_global.h
|
||||||
|
@@ -3,6 +3,7 @@ add_qtc_library(clangpchmanagerbackend_lib STATIC
|
|||||||
PUBLIC_DEPENDS libclang
|
PUBLIC_DEPENDS libclang
|
||||||
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
|
PUBLIC_DEFINES CLANGSUPPORT_BUILD_LIB
|
||||||
PUBLIC_INCLUDES
|
PUBLIC_INCLUDES
|
||||||
|
../../clangrefactoringbackend/source
|
||||||
${CLANG_INCLUDE_DIRS}
|
${CLANG_INCLUDE_DIRS}
|
||||||
SOURCES
|
SOURCES
|
||||||
builddependenciesprovider.cpp builddependenciesprovider.h
|
builddependenciesprovider.cpp builddependenciesprovider.h
|
||||||
|
@@ -10,6 +10,7 @@ add_qtc_library(clangrefactoringbackend_lib STATIC
|
|||||||
PUBLIC_INCLUDES
|
PUBLIC_INCLUDES
|
||||||
${CLANG_INCLUDE_DIRS}
|
${CLANG_INCLUDE_DIRS}
|
||||||
"../../clangpchmanagerbackend/source"
|
"../../clangpchmanagerbackend/source"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
clangquery.cpp clangquery.h
|
clangquery.cpp clangquery.h
|
||||||
clangquerygatherer.cpp clangquerygatherer.h
|
clangquerygatherer.cpp clangquerygatherer.h
|
||||||
|
Reference in New Issue
Block a user