Merge remote-tracking branch 'origin/4.14' into master
Conflicts: src/plugins/cppeditor/cppquickfix_test.cpp Change-Id: I470ee35f54f883244d819531131c172bd25c0e3f
6
.github/workflows/build_cmake.yml
vendored
@@ -4,7 +4,7 @@ on: [push, pull_request]
|
||||
|
||||
env:
|
||||
QT_VERSION: 5.15.1
|
||||
CLANG_VERSION: 100
|
||||
CLANG_VERSION: 110
|
||||
ELFUTILS_VERSION: 0.175
|
||||
CMAKE_VERSION: 3.18.3
|
||||
NINJA_VERSION: 1.10.1
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu Latest GCC", artifact: "Linux",
|
||||
os: ubuntu-latest,
|
||||
os: ubuntu-20.04,
|
||||
cc: "gcc", cxx: "g++"
|
||||
}
|
||||
- {
|
||||
@@ -251,7 +251,7 @@ jobs:
|
||||
set(libclang "libclang-release_${clang_version}-based-windows-vs2019_32.7z")
|
||||
endif()
|
||||
elseif ("${{ runner.os }}" STREQUAL "Linux")
|
||||
set(libclang "libclang-release_${clang_version}-based-linux-Ubuntu18.04-gcc9.2-x86_64.7z")
|
||||
set(libclang "libclang-release_${clang_version}-based-linux-Ubuntu20.04-gcc9.3-x86_64.7z")
|
||||
elseif ("${{ runner.os }}" STREQUAL "macOS")
|
||||
set(libclang "libclang-release_${clang_version}-based-mac.7z")
|
||||
endif()
|
||||
|
@@ -774,19 +774,6 @@ function(finalize_qtc_gtest test_name exclude_sources_regex)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# This is the CMake equivalent of "RESOURCES = $$files()" from qmake
|
||||
function(qtc_glob_resources)
|
||||
cmake_parse_arguments(_arg "" "QRC_FILE;ROOT;GLOB" "" ${ARGN})
|
||||
|
||||
file(GLOB_RECURSE fileList RELATIVE "${_arg_ROOT}" "${_arg_ROOT}/${_arg_GLOB}")
|
||||
set(qrcData "<RCC><qresource>\n")
|
||||
foreach(file IN LISTS fileList)
|
||||
string(APPEND qrcData " <file alias=\"${file}\">${_arg_ROOT}/${file}</file>\n")
|
||||
endforeach()
|
||||
string(APPEND qrcData "</qresource></RCC>")
|
||||
file(WRITE "${_arg_QRC_FILE}" "${qrcData}")
|
||||
endfunction()
|
||||
|
||||
function(qtc_copy_to_builddir custom_target_name)
|
||||
cmake_parse_arguments(_arg "CREATE_SUBDIRS" "DESTINATION" "FILES;DIRECTORIES" ${ARGN})
|
||||
set(timestampFiles)
|
||||
@@ -838,3 +825,84 @@ function(qtc_copy_to_builddir custom_target_name)
|
||||
|
||||
add_custom_target("${custom_target_name}" ALL DEPENDS ${timestampFiles})
|
||||
endfunction()
|
||||
|
||||
function(qtc_add_resources target resourceName)
|
||||
cmake_parse_arguments(rcc "" "PREFIX;LANG;BASE" "FILES;OPTIONS" ${ARGN})
|
||||
|
||||
string(REPLACE "/" "_" resourceName ${resourceName})
|
||||
string(REPLACE "." "_" resourceName ${resourceName})
|
||||
|
||||
# Apply base to all files
|
||||
if (rcc_BASE)
|
||||
foreach(file IN LISTS rcc_FILES)
|
||||
set(resource_file "${rcc_BASE}/${file}")
|
||||
file(TO_CMAKE_PATH ${resource_file} resource_file)
|
||||
list(APPEND resource_files ${resource_file})
|
||||
endforeach()
|
||||
else()
|
||||
set(resource_files ${rcc_FILES})
|
||||
endif()
|
||||
|
||||
set(newResourceName ${resourceName})
|
||||
set(resources ${resource_files})
|
||||
|
||||
set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/.rcc/generated_${newResourceName}.qrc")
|
||||
set(generatedSourceCode "${CMAKE_CURRENT_BINARY_DIR}/.rcc/qrc_${newResourceName}.cpp")
|
||||
|
||||
# Generate .qrc file:
|
||||
|
||||
# <RCC><qresource ...>
|
||||
set(qrcContents "<RCC>\n <qresource")
|
||||
if (rcc_PREFIX)
|
||||
string(APPEND qrcContents " prefix=\"${rcc_PREFIX}\"")
|
||||
endif()
|
||||
if (rcc_LANG)
|
||||
string(APPEND qrcContents " lang=\"${rcc_LANG}\"")
|
||||
endif()
|
||||
string(APPEND qrcContents ">\n")
|
||||
|
||||
set(resource_dependencies)
|
||||
foreach(file IN LISTS resources)
|
||||
set(file_resource_path ${file})
|
||||
|
||||
if (NOT IS_ABSOLUTE ${file})
|
||||
set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
|
||||
endif()
|
||||
|
||||
### FIXME: escape file paths to be XML conform
|
||||
# <file ...>...</file>
|
||||
string(APPEND qrcContents " <file alias=\"${file_resource_path}\">")
|
||||
string(APPEND qrcContents "${file}</file>\n")
|
||||
list(APPEND files "${file}")
|
||||
list(APPEND resource_dependencies ${file})
|
||||
target_sources(${target} PRIVATE "${file}")
|
||||
set_property(SOURCE "${file}" PROPERTY HEADER_FILE_ONLY ON)
|
||||
endforeach()
|
||||
|
||||
# </qresource></RCC>
|
||||
string(APPEND qrcContents " </qresource>\n</RCC>\n")
|
||||
|
||||
file(WRITE "${generatedResourceFile}.in" "${qrcContents}")
|
||||
configure_file("${generatedResourceFile}.in" "${generatedResourceFile}")
|
||||
|
||||
set_property(TARGET ${target} APPEND PROPERTY _qt_generated_qrc_files "${generatedResourceFile}")
|
||||
|
||||
set(rccArgs --name "${newResourceName}"
|
||||
--output "${generatedSourceCode}" "${generatedResourceFile}")
|
||||
if(rcc_OPTIONS)
|
||||
list(APPEND rccArgs ${rcc_OPTIONS})
|
||||
endif()
|
||||
|
||||
# Process .qrc file:
|
||||
add_custom_command(OUTPUT "${generatedSourceCode}"
|
||||
COMMAND Qt5::rcc ${rccArgs}
|
||||
DEPENDS
|
||||
${resource_dependencies}
|
||||
${generatedResourceFile}
|
||||
"Qt5::rcc"
|
||||
COMMENT "RCC ${newResourceName}"
|
||||
VERBATIM)
|
||||
|
||||
target_sources(${target} PRIVATE "${generatedSourceCode}")
|
||||
set_property(SOURCE "${generatedSourceCode}" PROPERTY SKIP_AUTOGEN ON)
|
||||
endfunction()
|
||||
|
@@ -1,5 +1,3 @@
|
||||
#PROJECT_USER_FILE_EXTENSION = .user
|
||||
|
||||
set(IDE_VERSION "4.13.82") # The IDE version.
|
||||
set(IDE_VERSION_COMPAT "4.13.82") # The IDE Compatibility version.
|
||||
set(IDE_VERSION_DISPLAY "4.14.0-beta1") # The IDE display version.
|
||||
@@ -11,3 +9,7 @@ set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name.
|
||||
set(IDE_ID "qtcreator") # The IDE id (no spaces, lowercase!)
|
||||
set(IDE_CASED_ID "QtCreator") # The cased IDE id (no spaces!)
|
||||
set(IDE_BUNDLE_IDENTIFIER "org.qt-project.${IDE_ID}") # The macOS application bundle identifier.
|
||||
|
||||
set(PROJECT_USER_FILE_EXTENSION .user)
|
||||
set(IDE_DOC_FILE "qtcreator/qtcreator.qdocconf")
|
||||
set(IDE_DOC_FILE_ONLINE "qtcreator/qtcreator-online.qdocconf")
|
||||
|
5
dist/changes-4.14.0.md
vendored
@@ -37,6 +37,7 @@ Editing
|
||||
(QTCREATORBUG-10066)
|
||||
* Added action for showing function arguments hint (QTCREATORBUG-19394)
|
||||
* Added option for after how many characters auto-completion may trigger (QTCREATORBUG-19920)
|
||||
* Added highlighting for structured bindings (QTCREATORBUG-24769)
|
||||
* Restricted completion for second argument of `connect` calls to signals (QTCREATORBUG-13558)
|
||||
* Fixed crash of backend with multiline `Q_PROPERTY` declarations (QTCREATORBUG-24746)
|
||||
* Fixed duplicate items appearing in include completion (QTCREATORBUG-24515)
|
||||
@@ -50,9 +51,11 @@ Editing
|
||||
implemented operators (QTCREATORBUG-12218)
|
||||
* Fixed that `Complete switch statement` indents unrelated code (QTCREATORBUG-12445)
|
||||
* Fixed `Complete switch statement` with templates (QTCREATORBUG-24752)
|
||||
* Fixed `Complete switch statement` for enum classes (QTCREATORBUG-20475)
|
||||
* Fixed that `Apply function signature change` removed return values from `std::function`
|
||||
arguments (QTCREATORBUG-13698)
|
||||
* Fixed handling of multiple inheritance in `Insert Virtual Functions` (QTCREATORBUG-12223)
|
||||
* Fixed issue with `Convert to Camel Case` (QTCREATORBUG-16560)
|
||||
* Fixed auto-indentation for lambdas with trailing return type (QTCREATORBUG-18497)
|
||||
* Fixed indentation when starting new line in documentation comments (QTCREATORBUG-11749)
|
||||
* Fixed that auto-indentation was applied within multiline string literals
|
||||
@@ -85,6 +88,7 @@ Projects
|
||||
### qmake
|
||||
|
||||
* Added option to not execute `system` directives (QTCREATORBUG-24551)
|
||||
* Fixed deployment with wildcards (QTCREATORBUG-24695)
|
||||
|
||||
### Wizards
|
||||
|
||||
@@ -135,6 +139,7 @@ Test Integration
|
||||
----------------
|
||||
|
||||
* Made it easier to re-run failed tests
|
||||
* Added support for `QTest::addRow()` (QTCREATORBUG-24777)
|
||||
|
||||
Platforms
|
||||
---------
|
||||
|
@@ -32,7 +32,7 @@ function(_find_all_includes _ret_includes _ret_framework_paths)
|
||||
endfunction()
|
||||
|
||||
if (WITH_DOCS)
|
||||
add_qtc_documentation("qtcreator/qtcreator.qdocconf")
|
||||
add_qtc_documentation(${IDE_DOC_FILE})
|
||||
if (BUILD_DEVELOPER_DOCS)
|
||||
_find_all_includes(_all_includes _framework_paths)
|
||||
add_qtc_documentation("qtcreatordev/qtcreator-dev.qdocconf"
|
||||
@@ -42,7 +42,7 @@ if (WITH_DOCS)
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_ONLINE_DOCS)
|
||||
add_qtc_documentation("qtcreator/qtcreator-online.qdocconf")
|
||||
add_qtc_documentation(${IDE_DOC_FILE_ONLINE})
|
||||
if (BUILD_DEVELOPER_DOCS)
|
||||
_find_all_includes(_all_includes _framework_paths)
|
||||
add_qtc_documentation("qtcreatordev/qtcreator-dev-online.qdocconf"
|
||||
|
@@ -32,6 +32,7 @@ imagedirs = ../images \
|
||||
../../../src/plugins/qmldesigner/components/formeditor \
|
||||
../../../src/plugins/qmldesigner/components/navigator \
|
||||
../../../src/plugins/qmldesigner/components/timelineeditor/images \
|
||||
../../../src/plugins/qmldesigner/componentsplugin/images \
|
||||
../../../src/plugins/qmldesigner/qmlpreviewplugin/images \
|
||||
../../../src/plugins/qmldesigner/qtquickplugin/images \
|
||||
../../../src/plugins/scxmleditor/common/images \
|
||||
|
BIN
doc/qtcreator/images/icons/frame-icon16.png
Normal file
After Width: | Height: | Size: 117 B |
BIN
doc/qtcreator/images/icons/groupbox-icon16.png
Normal file
After Width: | Height: | Size: 125 B |
BIN
doc/qtcreator/images/icons/label-icon16.png
Normal file
After Width: | Height: | Size: 182 B |
BIN
doc/qtcreator/images/icons/page-icon16.png
Normal file
After Width: | Height: | Size: 148 B |
BIN
doc/qtcreator/images/icons/pageindicator-icon16.png
Normal file
After Width: | Height: | Size: 158 B |
BIN
doc/qtcreator/images/icons/pane-icon16.png
Normal file
After Width: | Height: | Size: 92 B |
BIN
doc/qtcreator/images/qtquick-layout-grid-properties.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
doc/qtcreator/images/qtquick-positioner-column-properties.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
doc/qtcreator/images/qtquick-positioner-flow-properties.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
doc/qtcreator/images/qtquick-positioner-grid-properties.png
Normal file
After Width: | Height: | Size: 40 KiB |
@@ -188,7 +188,7 @@
|
||||
\li In the \uicontrol {Topic Filter} field, select a topic to view
|
||||
only checks related to that area in the \uicontrol Checks field.
|
||||
|
||||
\li To view all checks again, select \uicontrol {Reset to All}.
|
||||
\li To view all checks again, select \uicontrol {Reset Filter}.
|
||||
|
||||
\li To view more information about the checks online, select the
|
||||
\uicontrol {Web Page} links next to them.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -58,23 +58,7 @@
|
||||
|
||||
Copyright (c) 2008-2015 Jesse Beder.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b{Syntax highlighting engine for Kate syntax definitions}
|
||||
|
||||
@@ -83,29 +67,285 @@
|
||||
text rendering (e.g. as HTML), supporting both integration with a custom editor
|
||||
as well as a ready-to-use QSyntaxHighlighter sub-class.
|
||||
|
||||
Distributed under the:
|
||||
\badcode
|
||||
MIT License
|
||||
The following files are part of KDE's kate project, kdelibs/kate:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
\list
|
||||
\li \b alert.xml
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
Author: Dominik Haumann (dhaumann@kde.org).
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
\endcode
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b bash.xml
|
||||
|
||||
Copyright (c) 2004 by Wilbert Berendsen (wilbert@kde.nl).
|
||||
|
||||
Changes by: Matthew Woehlke (mw_triad@users.sourceforge.net),
|
||||
Sebastian Pipping (webmaster@hartwork.org), and
|
||||
Luiz Angelo Daros de Luca (luizluca@gmail.com).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b cmake.xml
|
||||
|
||||
Copyright 2004 Alexander Neundorf (neundorf@kde.org).
|
||||
|
||||
Copyright 2005 Dominik Haumann (dhdev@gmx.de).
|
||||
|
||||
Copyright 2007,2008,2013,2014 Matthew Woehlke (mw_triad@users.sourceforge.net).
|
||||
|
||||
Copyright 2013-2015,2017-2020 Alex Turbov (i.zaufi@gmail.com).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)} or later.
|
||||
|
||||
\badcode
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
\endcode
|
||||
|
||||
\li \b css.xml
|
||||
|
||||
Author: Wilbert Berendsen (wilbert@kde.nl).
|
||||
|
||||
Changes:
|
||||
Version 7 and 8 by Jonathan Poelen,
|
||||
Version 2.13 and 4 by Guo Yunhe (guoyunhebrave@gmail.com),
|
||||
Version 2.08 by Joseph Wenninger,
|
||||
Version 2.06 by Mte90,
|
||||
Version 2.03 by Milian Wolff.
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b doxygen.xml
|
||||
|
||||
Author: Dominik Haumann (dhaumann@kde.org).
|
||||
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b dtd.xml
|
||||
|
||||
Author: Andriy Lesyuk (s-andy@in.if.ua).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b html.xml
|
||||
|
||||
Author: Wilbert Berendsen (wilbert@kde.nl).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b ini.xml
|
||||
|
||||
Author: Jan Janssen (medhefgo@web.de).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b java.xml
|
||||
|
||||
Author: Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b javadoc.xml
|
||||
|
||||
Author: Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b json.xml
|
||||
|
||||
Author: Sebastian Pipping (sebastian@pipping.org).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/gpl-3.0.html}
|
||||
{GNU General Public License Version 3 (GPLv3)} or later.
|
||||
|
||||
\li \b makefile.xml
|
||||
|
||||
Author: v0.9 by Per Wigren (wigren@home.se).
|
||||
|
||||
Changes: Joseph Wenninger (jowenn@kde.org),
|
||||
Rui Santana (santana.rui@gmail.com),
|
||||
v2.0 by Andreas Nordal (andreas.nordal@gmail.com),
|
||||
v2.1 by Alex Turbov (i.zaufi@gmail.com),
|
||||
v4 by Alex Richardson (arichardson.kde@gmail.com).
|
||||
|
||||
\li \b markdown.xml
|
||||
|
||||
Copyright 2008 Darrin Yeager (http://www.dyeager.org/).
|
||||
|
||||
Dual-licensed under both the \l{https://www.gnu.org/licenses/gpl-2.0.html}
|
||||
{GNU General Public License Version 2 (GPLv2)} BSD licenses.
|
||||
|
||||
Extended 2009 Claes Holmerson (http://github.com/claes/kate-markdown/).
|
||||
|
||||
Extended 2019 Nibaldo Gonz\unicode{0x00E1}lez S. (nibgonz@gmail.com).
|
||||
Changes under MIT license.
|
||||
|
||||
\badcode
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
\endcode
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b modelines.xml
|
||||
|
||||
Author: Alex Turbov (i.zaufi@gmail.com).
|
||||
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b perl.xml
|
||||
|
||||
Copyright (C) 2001, 2002, 2003, 2004 Anders Lund (anders@alweb.dk).
|
||||
|
||||
\badcode
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License version 2 as published by the Free Software Foundation.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
\endcode
|
||||
|
||||
\li \b perl6.xml
|
||||
|
||||
Author: Jonathan Poelen (jonathan.poelen@gmail.com).
|
||||
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b powershell.xml
|
||||
|
||||
Authors: Motoki Kashihara (motoki8791@gmail.com),
|
||||
Michael Lombardi (Michael.T.Lombardi@outlook.com).
|
||||
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b python.xml
|
||||
|
||||
Author: Michael Bueker
|
||||
|
||||
Changes: v0.9 by Per Wigren,
|
||||
v1.9 by Michael Bueker,
|
||||
v1.97 by Paul Giannaros,
|
||||
v1.99 by Primoz Anzur,
|
||||
v2.01 by Paul Giannaros.
|
||||
|
||||
\li \b qdocconf.xml
|
||||
|
||||
Author: Volker Krause (vkrause@kde.org).
|
||||
|
||||
Distributed under the MIT license.
|
||||
|
||||
\include license-mit.qdocinc
|
||||
|
||||
\li \b ruby.xml
|
||||
|
||||
Copyright (C) 2004 by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi).
|
||||
|
||||
Copyright (C) 2004 by Stefan Lang (langstefan@gmx.at).
|
||||
|
||||
Copyright (C) 2008 by Robin Pedersen (robinpeder@gmail.com).
|
||||
|
||||
Copyright (C) 2011 by Miquel Sabat\unicode{0xe9} (mikisabate@gmail.com).
|
||||
|
||||
\badcode
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
\endcode
|
||||
|
||||
\li \b valgrind-suppression.xml
|
||||
|
||||
Author: Milian Wolff (mail@milianw.de).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b xml.xml
|
||||
|
||||
Author: Wilbert Berendsen (wilbert@kde.nl).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\li \b yacc.xml
|
||||
|
||||
YACC.XML supports syntax highlighting for Yacc/Bison source under Kate.
|
||||
|
||||
Copyright (C) 2004, Jan Villat (jan.villat@net2000.ch).
|
||||
|
||||
Changes by: Nibaldo Gonz\unicode{0x00E1}lez (nibgonz@gmail.com),
|
||||
Sebastian Pipping (webmaster@hartwork.org).
|
||||
|
||||
Released under the \l{https://www.gnu.org/licenses/lgpl-2.1.html}
|
||||
{GNU Lesser General Public License Version 2.1 (LGPLv2.1)}.
|
||||
|
||||
\endlist
|
||||
|
||||
The source code of KSyntaxHighlighting can be found
|
||||
here:
|
||||
|
22
doc/qtcreator/src/overview/license-mit.qdocinc
Normal file
@@ -0,0 +1,22 @@
|
||||
\badcode
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
\endcode
|
@@ -103,6 +103,7 @@
|
||||
\endlist
|
||||
\li \l{Managing Item Hierarchy}
|
||||
\li \l{Specifying Item Properties}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Using Custom Fonts}
|
||||
\li \l{Annotating Designs}
|
||||
\li \l{Loading Placeholder Data}
|
||||
|
@@ -274,7 +274,7 @@
|
||||
and set the button text for each button instance, for example.
|
||||
|
||||
For more information about positioning buttons on screens, see
|
||||
\l{Positioning Items in UIs}.
|
||||
\l{Positioning Items}.
|
||||
|
||||
\image qmldesigner-borderimage.png "Button preview as part of a screen"
|
||||
*/
|
||||
|
@@ -180,279 +180,6 @@
|
||||
\l{SwipeDelegate}{Swipe Delegate} delegate components are also available
|
||||
in \uicontrol Library.
|
||||
|
||||
\section1 Positioning Items in UIs
|
||||
|
||||
The position of an item in the UI can be either absolute or
|
||||
relative to other items. If you are designing a static UI,
|
||||
\l{Important Concepts In Qt Quick - Positioning#manual-positioning}
|
||||
{manual positioning} provides the most efficient form of positioning
|
||||
items. For a dynamic UI, you can employ the following positioning
|
||||
methods provided by Qt Quick:
|
||||
|
||||
\list
|
||||
\li \l{Setting Bindings}
|
||||
\li \l{Setting Anchors and Margins}
|
||||
\li \l{Aligning and Distributing Items}
|
||||
\li \l{Using Positioners}
|
||||
\li \l{Using Layouts}
|
||||
\li \l{Organizing Items}
|
||||
\endlist
|
||||
|
||||
\section2 Setting Bindings
|
||||
|
||||
\l{Positioning with Bindings} {Property binding} is a declarative way of
|
||||
specifying the value of a property. Binding allows a property value to be
|
||||
expressed as a JavaScript expression that defines the value relative to
|
||||
other property values or data accessible in the application. The property
|
||||
value is automatically kept up to date if the other properties or data
|
||||
values change.
|
||||
|
||||
Property bindings are created implicitly in QML whenever a property is
|
||||
assigned a JavaScript expression. To set JavaScript expressions as values
|
||||
of properties in the Design mode, select the
|
||||
\inlineimage icons/action-icon.png
|
||||
(\uicontrol Actions) menu next to a property, and then select
|
||||
\uicontrol {Set Binding}.
|
||||
|
||||
\image qmldesigner-set-expression.png "Type properties context menu"
|
||||
|
||||
In \uicontrol {Binding Editor}, select an item and a property from
|
||||
lists of available items and their properties.
|
||||
|
||||
\image qmldesigner-binding-editor.png "Binding Editor"
|
||||
|
||||
Alternatively, start typing a
|
||||
string and press \key Ctrl+Space to display a list of properties, IDs, and
|
||||
code snippets. When you enter a period (.) after a property name, a list of
|
||||
available values is displayed. Press \key Enter to accept the first
|
||||
suggestion in the list and to complete the code.
|
||||
|
||||
When a binding is set, the \uicontrol Actions menu icon changes to
|
||||
\inlineimage icons/action-icon-binding
|
||||
. To remove bindings, select \uicontrol Actions > \uicontrol Reset.
|
||||
|
||||
You can set bindings also in the \uicontrol Connections view. For more
|
||||
information, see \l {Adding Bindings Between Properties}.
|
||||
|
||||
For more information on the JavaScript environment provided by QML, see
|
||||
\l{Integrating QML and JavaScript}.
|
||||
|
||||
Bindings are a black box for the Design mode and using them might have a
|
||||
negative impact on performance, so consider setting anchors and margins for
|
||||
items, instead. For example, instead of setting \c {parent.width} for an
|
||||
item, you could anchor the item to its sibling items on the left and the
|
||||
right.
|
||||
|
||||
\section2 Setting Anchors and Margins
|
||||
|
||||
In an \l{Important Concepts In Qt Quick - Positioning#anchors}
|
||||
{anchor-based} layout, each QML type can be thought of as having a set of
|
||||
invisible \e anchor lines: top, bottom, left, right, fill, horizontal
|
||||
center, vertical center, and baseline.
|
||||
|
||||
In the \uicontrol Layout tab you can set anchors and margins for items. To
|
||||
set the anchors of an item, click the anchor buttons. You can combine the
|
||||
top/bottom, left/right, and horizontal/vertical anchors to anchor items in
|
||||
the corners of the parent item or center them horizontally or vertically
|
||||
within the parent item.
|
||||
|
||||
\image qmldesigner-anchor-buttons.png "Anchor buttons"
|
||||
|
||||
For convenience, you can click the \inlineimage anchor-fill.png
|
||||
(\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to an
|
||||
item and the \inlineimage qtcreator-anchors-reset-icon.png
|
||||
(\uicontrol {Reset Anchors}) button to reset the anchors to their saved
|
||||
state.
|
||||
|
||||
You can specify the baseline anchor in \uicontrol {Text Editor} in the
|
||||
Design mode.
|
||||
|
||||
For performance reasons, you can only anchor an item to its siblings
|
||||
and direct parent. By default, an item is anchored to its parent when
|
||||
you use the anchor buttons. Select a sibling of the item in the
|
||||
\uicontrol Target field to anchor to it, instead.
|
||||
|
||||
Arbitrary anchoring is not supported. For example, you cannot specify:
|
||||
\c {anchor.left: parent.right}. You have to specify:
|
||||
\c {anchor.left: parent.left}. When you use the anchor buttons, anchors to
|
||||
the parent item are always specified to the same side. However, anchors to
|
||||
sibling items are specified to the opposite side:
|
||||
\c {anchor.left: sibling.right}. This allows you to keep sibling items
|
||||
together.
|
||||
|
||||
In the following image, \uicontrol{Rectangle 2} is anchored to
|
||||
\uicontrol {Rectangle 1} on its left and to the bottom of its parent.
|
||||
|
||||
\image qmldesigner-anchors.png "Anchoring sibling items"
|
||||
|
||||
The anchors for \uicontrol{Rectangle 2} are specified as follows in code:
|
||||
|
||||
\qml
|
||||
Rectangle {
|
||||
id: rectangle2
|
||||
anchors.left: rectangle1.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 10
|
||||
//
|
||||
}
|
||||
\endqml
|
||||
|
||||
Margins specify the amount of empty space to leave to the outside of an
|
||||
item. Margins only have meaning for anchors. They do not take any effect
|
||||
when using layouts or absolute positioning.
|
||||
|
||||
\section2 Aligning and Distributing Items
|
||||
|
||||
When you're working with a group of items, you can select them to align
|
||||
and distribute them evenly. As the positions of the items are fixed, you
|
||||
cannot apply these functions to anchored items. For scalability, you can
|
||||
anchor the aligned and distributed items when your design is ready.
|
||||
|
||||
\image qmldesigner-alignment.png "Aligning sibling items"
|
||||
|
||||
Select the buttons in the \uicontrol Align group to align the top/bottom
|
||||
or left/right edges of the items in the group to the one farthest away from
|
||||
the center of the group. For example, when left-aligning, the items are
|
||||
aligned to the leftmost item. You can also align the horizontal/vertical
|
||||
centers of items, or both, as in the image above.
|
||||
|
||||
In the \uicontrol {Align to} field, select whether to align the items in
|
||||
respect to the selection, the root item, or a \e {key object} that you
|
||||
select in the \uicontrol {Key object} field. The key object must be a part
|
||||
of the selection.
|
||||
|
||||
You can distribute either \e objects or the \e spacing between them. If the
|
||||
objects or spacing cannot be distributed to equal pixel values without
|
||||
ending up with half pixels, you receive a notification. You can either allow
|
||||
\QDS to distribute objects or spacing using the closest values possible or
|
||||
tweak your design so that the objects and spacing can be distributed
|
||||
perfectly.
|
||||
|
||||
When distributing objects, you can select whether the distance between
|
||||
them is calculated from their top/bottom or left/right edges or their
|
||||
horizontal/vertical center.
|
||||
|
||||
\image qmldesigner-distribute-objects.png "Distribute objects buttons"
|
||||
|
||||
You can distribute spacing either evenly within a target area or at
|
||||
specified distances, calculated from a starting point.
|
||||
|
||||
You can select the orientation in which the objects are distributed evenly
|
||||
within the target area: horizontally along the x axis or vertically along
|
||||
the y axis.
|
||||
|
||||
\image qmldesigner-distribute-spacing-evenly.png "Distribute spacing evenly"
|
||||
|
||||
Alternatively, you can distribute spacing in pixels by selecting one of the
|
||||
starting point buttons: left/right or top/bottom edge of the target area,
|
||||
or its horizontal/vertical center. Note that some items might end up outside
|
||||
the target area.
|
||||
|
||||
\image qmldesigner-distribute-spacing-pixels.png "Distribute spacing in pixels"
|
||||
|
||||
You can set the space between objects in pixels. You can
|
||||
disable the distribution of spacing in pixels by clicking
|
||||
the \inlineimage qmldesigner-distribute-spacing-x.png
|
||||
button.
|
||||
|
||||
\section2 Using Positioners
|
||||
|
||||
\l{Important Concepts In Qt Quick - Positioning#positioners}
|
||||
{Positioner items} are container items that manage the positions of items
|
||||
in a declarative user interface. Positioners behave in a similar way to
|
||||
the layout managers used with standard Qt widgets, except that they are
|
||||
also containers in their own right.
|
||||
|
||||
You can use the following positioners to arrange items in UIs:
|
||||
|
||||
\list
|
||||
\li \l[QtQuick] {Column} arranges its child items vertically.
|
||||
\li \l[QtQuick] {Row} arranges its child items horizontally.
|
||||
\li \l[QtQuick] {Grid}
|
||||
arranges its child items so that they are aligned in a grid and
|
||||
are not overlapping.
|
||||
\li \l[QtQuick] {Flow}
|
||||
arranges its child items side by side, wrapping as necessary.
|
||||
\endlist
|
||||
|
||||
To position several items in a \uicontrol Column, \uicontrol Row,
|
||||
\uicontrol Grid, or \uicontrol Flow, select the items in
|
||||
\uicontrol {Form Editor}, and then select \uicontrol Position in
|
||||
the context menu.
|
||||
|
||||
\section2 Using Layouts
|
||||
|
||||
Since Qt 5.1, you can use QML types in the \l{qtquicklayouts-index.html}
|
||||
{Qt Quick Layouts} module to arrange Qt Quick items in UIs. Unlike
|
||||
positioners, they manage both the positions and sizes of items in a
|
||||
declarative interface. They are well suited for resizable UIs.
|
||||
|
||||
You can use the following layout types to arrange items in UIs:
|
||||
|
||||
\list
|
||||
\li \l{ColumnLayout}{Column Layout} provides a grid layout with only
|
||||
one column.
|
||||
\li \l{RowLayout}{Row Layout} provides a grid layout with only one row.
|
||||
\li \l{GridLayout}{Grid Layout} provides a way of dynamically arranging
|
||||
items in a grid.
|
||||
\li \l{StackLayout}{Stack Layout} provides a stack of items where only
|
||||
one item is visible at a time.
|
||||
\endlist
|
||||
|
||||
To lay out several items in a column, row, grid, or
|
||||
\uicontrol {Stack Layout}, select the items in \uicontrol {Form Editor},
|
||||
and then select \uicontrol Layout in the context menu.
|
||||
|
||||
You can also click the \inlineimage column.png
|
||||
(\uicontrol {Column Layout}), \inlineimage row.png
|
||||
(\uicontrol {Row Layout}), and \inlineimage grid.png
|
||||
(\uicontrol {Grid Layout}) toolbar buttons to apply
|
||||
layouts to the selected items.
|
||||
|
||||
To make an item within a layout as wide as possible while respecting the
|
||||
given constraints, select the item in \uicontrol {Form Editor}, and then
|
||||
select \uicontrol Layout > \uicontrol {Fill Width} in the context menu. To
|
||||
make the item as high as possible, select \uicontrol {Fill Height}.
|
||||
|
||||
\section2 Editing Stack Layouts
|
||||
|
||||
\image qtquick-designer-stacked-view.png
|
||||
|
||||
To add items to a \uicontrol {Stack Layout}, select the
|
||||
\inlineimage plus.png
|
||||
button next to the type name in \uicontrol {Form Editor}. To move
|
||||
between items, select the \inlineimage prev.png
|
||||
(\uicontrol Previous) and \inlineimage next.png
|
||||
(\uicontrol Next) buttons.
|
||||
|
||||
To add a tab bar to a stack layout, select \uicontrol {Stacked Container} >
|
||||
\uicontrol {Add Tab Bar}.
|
||||
|
||||
To raise or lower the stacking order of an item, select
|
||||
\uicontrol {Stacked Container} > \uicontrol {Increase Index} or
|
||||
\uicontrol {Decrease Index}.
|
||||
|
||||
\section2 Organizing Items
|
||||
|
||||
Since Qt 5.7, you can use the following \l{Qt Quick Controls} types to
|
||||
organize items in UIs:
|
||||
|
||||
\list
|
||||
\li \l [QtQuickControls]{Frame} places a logical group of controls
|
||||
within a visual frame.
|
||||
\li \l [QtQuickControls]{GroupBox}{Group Box} is used to lay out a
|
||||
logical group of controls together, within a titled visual frame.
|
||||
\li \l [QtQuickControls]{Label} is a text label with inherited styling
|
||||
and font.
|
||||
\li \l [QtQuickControls]{Page} provides a styled page control with
|
||||
support for a header and footer.
|
||||
\li \l [QtQuickControls]{PageIndicator}{Page Indicator} indicates the
|
||||
currently active page.
|
||||
\li \l [QtQuickControls]{Pane} provides a background matching with the
|
||||
application style and theme.
|
||||
\endlist
|
||||
|
||||
\section1 User Interaction Methods
|
||||
|
||||
You can use the following QML types to add basic interaction methods to
|
||||
|
@@ -24,7 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\previouspage qtquick-properties.html
|
||||
\previouspage qtquick-positioning.html
|
||||
\page qtquick-fonts.html
|
||||
\nextpage qtquick-annotations.html
|
||||
|
||||
|
466
doc/qtcreator/src/qtquick/qtquick-positioning.qdoc
Normal file
@@ -0,0 +1,466 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\page qtquick-positioning.html
|
||||
\previouspage qtquick-properties.html
|
||||
\nextpage qtquick-fonts.html
|
||||
|
||||
\title Positioning Items
|
||||
|
||||
The position of an item in a UI can be either absolute or relative to
|
||||
other items. The visual types exist at a particular location in the screen
|
||||
coordinate system at any instant in time. The x and y coordinates of a
|
||||
visual item are relative to those of its visual parent, with the top-left
|
||||
corner having the coordinate (0, 0).
|
||||
|
||||
If you are designing a static UI,
|
||||
\l{Important Concepts In Qt Quick - Positioning#manual-positioning}
|
||||
{manual positioning} provides the most efficient form of positioning
|
||||
items. For a dynamic UI, you can employ the following positioning
|
||||
methods:
|
||||
|
||||
\list
|
||||
\li \l{Setting Bindings}
|
||||
\li \l{Setting Anchors and Margins}
|
||||
\li \l{Aligning and Distributing Items}
|
||||
\li \l{Using Positioners}
|
||||
\li \l{Using Layouts}
|
||||
\li \l{Organizing Items}
|
||||
\endlist
|
||||
|
||||
\section2 Setting Bindings
|
||||
|
||||
\l{Positioning with Bindings} {Property binding} is a declarative way of
|
||||
specifying the value of a property. Binding allows a property value to be
|
||||
expressed as a JavaScript expression that defines the value relative to
|
||||
other property values or data accessible in the application. The property
|
||||
value is automatically kept up to date if the other properties or data
|
||||
values change.
|
||||
|
||||
Property bindings are created implicitly in QML whenever a property is
|
||||
assigned a JavaScript expression. To set JavaScript expressions as values
|
||||
of properties in the \uicontrol Properties view, select the
|
||||
\inlineimage icons/action-icon.png
|
||||
(\uicontrol Actions) menu next to a property, and then select
|
||||
\uicontrol {Set Binding}.
|
||||
|
||||
\image qmldesigner-set-expression.png "Type properties context menu"
|
||||
|
||||
In \uicontrol {Binding Editor}, select an item and a property from
|
||||
lists of available items and their properties.
|
||||
|
||||
\image qmldesigner-binding-editor.png "Binding Editor"
|
||||
|
||||
Alternatively, start typing a
|
||||
string and press \key Ctrl+Space to display a list of properties, IDs, and
|
||||
code snippets. When you enter a period (.) after a property name, a list of
|
||||
available values is displayed. Press \key Enter to accept the first
|
||||
suggestion in the list and to complete the code.
|
||||
|
||||
When a binding is set, the \uicontrol Actions menu icon changes to
|
||||
\inlineimage icons/action-icon-binding
|
||||
. To remove bindings, select \uicontrol Actions > \uicontrol Reset.
|
||||
|
||||
You can set bindings also in the \uicontrol Connections view. For more
|
||||
information, see \l {Adding Bindings Between Properties}.
|
||||
|
||||
For more information on the JavaScript environment provided by QML, see
|
||||
\l{Integrating QML and JavaScript}.
|
||||
|
||||
Bindings are a black box for \QC and using them might have a
|
||||
negative impact on performance, so consider setting anchors and margins for
|
||||
items, instead. For example, instead of setting \c {parent.width} for an
|
||||
item, you could anchor the item to its sibling items on the left and the
|
||||
right.
|
||||
|
||||
\section2 Setting Anchors and Margins
|
||||
|
||||
In an \l{Important Concepts In Qt Quick - Positioning#anchors}
|
||||
{anchor-based} layout, each QML type can be thought of as having a set of
|
||||
invisible \e anchor lines: top, bottom, left, right, fill, horizontal
|
||||
center, vertical center, and baseline.
|
||||
|
||||
In the \uicontrol Layout tab you can set anchors and margins for items. To
|
||||
set the anchors of an item, click the anchor buttons. You can combine the
|
||||
top/bottom, left/right, and horizontal/vertical anchors to anchor items in
|
||||
the corners of the parent item or center them horizontally or vertically
|
||||
within the parent item.
|
||||
|
||||
\image qmldesigner-anchor-buttons.png "Anchor buttons"
|
||||
|
||||
For convenience, you can click the \inlineimage anchor-fill.png
|
||||
(\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to an
|
||||
item and the \inlineimage qtcreator-anchors-reset-icon.png
|
||||
(\uicontrol {Reset Anchors}) button to reset the anchors to their saved
|
||||
state.
|
||||
|
||||
You can specify the baseline anchor in \uicontrol {Text Editor}.
|
||||
|
||||
For performance reasons, you can only anchor an item to its siblings
|
||||
and direct parent. By default, an item is anchored to its parent when
|
||||
you use the anchor buttons. Select a sibling of the item in the
|
||||
\uicontrol Target field to anchor to it, instead.
|
||||
|
||||
Arbitrary anchoring is not supported. For example, you cannot specify:
|
||||
\c {anchor.left: parent.right}. You have to specify:
|
||||
\c {anchor.left: parent.left}. When you use the anchor buttons, anchors to
|
||||
the parent item are always specified to the same side. However, anchors to
|
||||
sibling items are specified to the opposite side:
|
||||
\c {anchor.left: sibling.right}. This allows you to keep sibling items
|
||||
together.
|
||||
|
||||
In the following image, \uicontrol{Rectangle 2} is anchored to
|
||||
\uicontrol {Rectangle 1} on its left and to the bottom of its parent.
|
||||
|
||||
\image qmldesigner-anchors.png "Anchoring sibling items"
|
||||
|
||||
The anchors for \uicontrol{Rectangle 2} are specified as follows in code:
|
||||
|
||||
\qml
|
||||
Rectangle {
|
||||
id: rectangle2
|
||||
anchors.left: rectangle1.right
|
||||
anchors.leftMargin: 10
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 10
|
||||
//
|
||||
}
|
||||
\endqml
|
||||
|
||||
Margins specify the amount of empty space to leave to the outside of an
|
||||
item. Margins only have meaning for anchors. They do not take any effect
|
||||
when using layouts or absolute positioning.
|
||||
|
||||
\section2 Aligning and Distributing Items
|
||||
|
||||
When you're working with a group of items, you can select them to align
|
||||
and distribute them evenly. As the positions of the items are fixed, you
|
||||
cannot apply these functions to anchored items. For scalability, you can
|
||||
anchor the aligned and distributed items when your design is ready.
|
||||
|
||||
\image qmldesigner-alignment.png "Aligning sibling items"
|
||||
|
||||
Select the buttons in the \uicontrol Align group to align the top/bottom
|
||||
or left/right edges of the items in the group to the one farthest away from
|
||||
the center of the group. For example, when left-aligning, the items are
|
||||
aligned to the leftmost item. You can also align the horizontal/vertical
|
||||
centers of items, or both, as in the image above.
|
||||
|
||||
In the \uicontrol {Align to} field, select whether to align the items in
|
||||
respect to the selection, the root item, or a \e {key object} that you
|
||||
select in the \uicontrol {Key object} field. The key object must be a part
|
||||
of the selection.
|
||||
|
||||
You can distribute either \e objects or the \e spacing between them. If the
|
||||
objects or spacing cannot be distributed to equal pixel values without
|
||||
ending up with half pixels, you receive a notification. You can either allow
|
||||
\QDS to distribute objects or spacing using the closest values possible or
|
||||
tweak your design so that the objects and spacing can be distributed
|
||||
perfectly.
|
||||
|
||||
When distributing objects, you can select whether the distance between
|
||||
them is calculated from their top/bottom or left/right edges or their
|
||||
horizontal/vertical center.
|
||||
|
||||
\image qmldesigner-distribute-objects.png "Distribute objects buttons"
|
||||
|
||||
You can distribute spacing either evenly within a target area or at
|
||||
specified distances, calculated from a starting point.
|
||||
|
||||
You can select the orientation in which the objects are distributed evenly
|
||||
within the target area: horizontally along the x axis or vertically along
|
||||
the y axis.
|
||||
|
||||
\image qmldesigner-distribute-spacing-evenly.png "Distribute spacing evenly"
|
||||
|
||||
Alternatively, you can distribute spacing in pixels by selecting one of the
|
||||
starting point buttons: left/right or top/bottom edge of the target area,
|
||||
or its horizontal/vertical center. Note that some items might end up outside
|
||||
the target area.
|
||||
|
||||
\image qmldesigner-distribute-spacing-pixels.png "Distribute spacing in pixels"
|
||||
|
||||
You can set the space between objects in pixels. You can
|
||||
disable the distribution of spacing in pixels by clicking
|
||||
the \inlineimage qmldesigner-distribute-spacing-x.png
|
||||
button.
|
||||
|
||||
\section2 Using Positioners
|
||||
|
||||
Positioner items are container items that manage the positions of
|
||||
items. For many use cases, the best positioner to use is a simple
|
||||
column, row, flow, or grid. You can use the QML types available in
|
||||
the \uicontrol {Qt Quick - Positioner} section of \uicontrol Library
|
||||
to position the children of an item in these formations in the most
|
||||
efficient manner possible.
|
||||
|
||||
To position several items in a \uicontrol Column, \uicontrol Row,
|
||||
\uicontrol Flow, or \uicontrol Grid, select the items in
|
||||
\uicontrol {Form Editor}, and then select \uicontrol Position in
|
||||
the context menu.
|
||||
|
||||
\section3 Column Positioner
|
||||
|
||||
A \uicontrol Column positions its child items along a single column.
|
||||
It can be used as a convenient way to vertically position a series of
|
||||
items without using anchors.
|
||||
|
||||
\image qtquick-positioner-column-properties.png "Column properties"
|
||||
|
||||
For all positioners, you can specify the spacing between the child
|
||||
items that they contain in the \uicontrol Spacing field.
|
||||
|
||||
In addition, you can specify the vertical and horizontal padding between
|
||||
content and the left, right, top, and bottom edges of items as values of
|
||||
the fields in the \uicontrol Padding group.
|
||||
|
||||
\section3 Row and Flow Positioners
|
||||
|
||||
A \uicontrol Row positions its child items along a single row. It can be
|
||||
used as a convenient way to horizontally position a series of items without
|
||||
using anchors.
|
||||
|
||||
The \uicontrol Flow type positions its child items like words on a page,
|
||||
wrapping them to create rows or columns of items.
|
||||
|
||||
\image qtquick-positioner-flow-properties.png "Flow properties"
|
||||
|
||||
For flow and row positioners, you can also set the direction of a flow to
|
||||
either left-to-right or top-to-bottom in the \uicontrol Flow field.
|
||||
Items are positioned next to to each other according to the value you set
|
||||
in the \uicontrol {Layout direction} field until the width or height of the
|
||||
Flow item is exceeded, then wrapped to the next row or column.
|
||||
|
||||
You can set the layout direction to either \uicontrol LeftToRight or
|
||||
\uicontrol RightToLeft in the \uicontrol {Layout direction} field. If
|
||||
the width of the row is explicitly set, the left anchor remains to the
|
||||
left of the row and the right anchor remains to the right of it.
|
||||
|
||||
\section3 Grid Positioner
|
||||
|
||||
A \uicontrol Grid creates a grid of cells that is large enough to hold all
|
||||
of its child items, and places these items in the cells from left to right
|
||||
and top to bottom. Each item is positioned at the top-left corner of its
|
||||
cell with position (0, 0).
|
||||
|
||||
\QC generates the grid based on the positions of the child items in
|
||||
\uicontrol {Form Editor}. You can modify the number of rows and columns
|
||||
in the \uicontrol Rows and \uicontrol Columns fields.
|
||||
|
||||
\image qtquick-positioner-grid-properties.png "Grid properties"
|
||||
|
||||
In addition to the flow and layout direction, you can set the horizontal
|
||||
and vertical alignment of grid items. By default, grid items are vertically
|
||||
aligned to the top. Horizontal alignment follows the value of the
|
||||
\uicontrol {Layout direction} field. For example, when layout direction is
|
||||
set to \uicontrol LeftToRight, the items are aligned on the left.
|
||||
|
||||
To mirror the layout, set the layout direction to \uicontrol RightToLeft.
|
||||
To also mirror the horizontal alignment of items, select
|
||||
\uicontrol AlignRight in the \uicontrol {Horizontal item alignment} field.
|
||||
|
||||
\section3 Summary of Positioners
|
||||
|
||||
The following table lists the positioners that you can use to arrange items
|
||||
in UIs. They are available in the \uicontrol {Qt Quick - Positioner} section
|
||||
of \uicontrol Library.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Icon
|
||||
\li Name
|
||||
\li Purpose
|
||||
\row
|
||||
\li \inlineimage column-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Column}
|
||||
\li Arranges its child items vertically.
|
||||
\row
|
||||
\li \inlineimage row-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Row}
|
||||
\li Arranges its child items horizontally.
|
||||
\row
|
||||
\li \inlineimage grid-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Grid}
|
||||
\li Arranges its child items so that they are aligned in a grid and
|
||||
are not overlapping.
|
||||
\row
|
||||
\li \inlineimage flow-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Flow}
|
||||
\li Arranges its child items side by side, wrapping as necessary.
|
||||
\endtable
|
||||
|
||||
\section2 Using Layouts
|
||||
|
||||
\if defined(qtcreator)
|
||||
Since Qt 5.1, you can use QML types in the \l{qtquicklayouts-index.html}
|
||||
{Qt Quick Layouts} module to arrange items in UIs.
|
||||
\else
|
||||
You can use the QML types available in the \uicontrol {Qt Quick - Layouts}
|
||||
section of \uicontrol Library to arrange items in UIs.
|
||||
\endif
|
||||
Unlike positioners, layouts manage both the positions and sizes of their
|
||||
child items, and are therefore well suited for dynamic and resizable UIs.
|
||||
However, this means that you should not specify fixed positions and sizes
|
||||
for the child items in the \uicontrol Geometry group in their properties,
|
||||
unless their implicit sizes are not satisfactory.
|
||||
|
||||
You can use anchors or the width and height properties of the layout itself
|
||||
to specify its size in respect to its non-layout parent item. However, do
|
||||
not anchor the child items within layouts.
|
||||
|
||||
To arrange several items in a column, row, grid, or
|
||||
\uicontrol {Stack Layout}, select the items in \uicontrol {Form Editor},
|
||||
and then select \uicontrol Layout in the context menu.
|
||||
|
||||
You can also click the \inlineimage column.png
|
||||
(\uicontrol {Column Layout}), \inlineimage row.png
|
||||
(\uicontrol {Row Layout}), and \inlineimage grid.png
|
||||
(\uicontrol {Grid Layout}) toolbar buttons to apply
|
||||
layouts to the selected items.
|
||||
|
||||
To make an item within a layout as wide as possible while respecting the
|
||||
given constraints, select the item in \uicontrol {Form Editor}, and then
|
||||
select \uicontrol Layout > \uicontrol {Fill Width} in the context menu. To
|
||||
make the item as high as possible, select \uicontrol {Fill Height}.
|
||||
|
||||
\section3 Layout Properties
|
||||
|
||||
A \uicontrol {Grid Layout} type provides a way of dynamically arranging
|
||||
items in a grid. If the grid layout is resized, all its child items are
|
||||
rearranged. If you want a layout with just one row or one column, use the
|
||||
\uicontrol {Row Layout} or \uicontrol {Column Layout} type.
|
||||
|
||||
The child items of row and column layout items are automatically positioned
|
||||
either horizontally from left to right as rows or vertically from
|
||||
top to bottom as columns. The number of the child items determines the width
|
||||
of the row or the height of the column. You can specify the spacing between
|
||||
the child items in the \uicontrol Spacing field.
|
||||
|
||||
The child items of grid layout items are arranged according to the
|
||||
\uicontrol Flow property. When the direction of a flow is set to
|
||||
\uicontrol LeftToRight, child items are positioned next to to each
|
||||
other until the the number of \uicontrol Columns is reached. Then,
|
||||
the auto-positioning wraps back to the beginning of the next row.
|
||||
|
||||
\image qtquick-layout-grid-properties.png "Grid Layout properties"
|
||||
|
||||
If you set the direction of the flow to \uicontrol TopToBottom, child
|
||||
items are auto-positioned vertically using the value of the \uicontrol Rows
|
||||
field to determine the maximum number of rows.
|
||||
|
||||
You can set the layout direction to either \uicontrol LeftToRight or
|
||||
\uicontrol RightToLeft in the \uicontrol {Layout direction} field.
|
||||
When you select \uicontrol RightToLeft, the alignment of the items
|
||||
will be mirrored.
|
||||
|
||||
You can specify the spacing between rows and columns in the
|
||||
\uicontrol {Row spacing} and \uicontrol {Column spacing} fields.
|
||||
|
||||
\section3 Stack Layout
|
||||
|
||||
\image qtquick-designer-stacked-view.png
|
||||
|
||||
To add items to a \uicontrol {Stack Layout}, select the
|
||||
\inlineimage plus.png
|
||||
button next to the type name in \uicontrol {Form Editor}. To move
|
||||
between items, select the \inlineimage prev.png
|
||||
(\uicontrol Previous) and \inlineimage next.png
|
||||
(\uicontrol Next) buttons.
|
||||
|
||||
To add a tab bar to a stack layout, select \uicontrol {Stacked Container} >
|
||||
\uicontrol {Add Tab Bar}.
|
||||
|
||||
To raise or lower the stacking order of an item, select
|
||||
\uicontrol {Stacked Container} > \uicontrol {Increase Index} or
|
||||
\uicontrol {Decrease Index}.
|
||||
|
||||
\section3 Summary of Layouts
|
||||
|
||||
The following table lists the layout types that you can use to arrange items
|
||||
in UIs. They are available in the \uicontrol {Qt Quick - Layouts} section
|
||||
of \uicontrol Library.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Icon
|
||||
\li Name
|
||||
\li Purpose
|
||||
\row
|
||||
\li \inlineimage column-layouts-icon-16px.png
|
||||
\li \l{ColumnLayout}{Column Layout}
|
||||
\li Provides a grid layout with only one column.
|
||||
\row
|
||||
\li\inlineimage row-layouts-icon-16px.png
|
||||
\li \l{RowLayout}{Row Layout}
|
||||
\li Provides a grid layout with only one row.
|
||||
\row
|
||||
\li \inlineimage grid-layouts-icon-16px.png
|
||||
\li \l{GridLayout}{Grid Layout}
|
||||
\li Provides a way of dynamically arranging items in a grid.
|
||||
\row
|
||||
\li \inlineimage stack-layouts-icon-16px.png
|
||||
\li \l{StackLayout}{Stack Layout}
|
||||
\li Provides a stack of items where only one item is visible at a time.
|
||||
\endtable
|
||||
|
||||
|
||||
\section2 Organizing Items
|
||||
|
||||
The following table lists the UI controls that you can use to
|
||||
organize items in UIs (since Qt 5.7). They are available in the
|
||||
\uicontrol {Qt Quick - Controls 2} section of \uicontrol Library.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Icon
|
||||
\li Name
|
||||
\li Purpose
|
||||
\row
|
||||
\li \inlineimage icons/frame-icon16.png
|
||||
\li \l [QtQuickControls]{Frame}
|
||||
\li A visual frame around a group of controls.
|
||||
\row
|
||||
\li \inlineimage icons/groupbox-icon16.png
|
||||
\li \l [QtQuickControls]{GroupBox}{Group Box}
|
||||
\li A titled visual frame around a group of controls.
|
||||
\row
|
||||
\li \inlineimage icons/label-icon16.png
|
||||
\li \l [QtQuickControls]{Label}
|
||||
\li A text label with inherited styling and font.
|
||||
\row
|
||||
\li \inlineimage icons/page-icon16.png
|
||||
\li \l [QtQuickControls]{Page}
|
||||
\li A styled page control with support for a header and footer.
|
||||
\row
|
||||
\li \inlineimage icons/pageindicator-icon16.png
|
||||
\li \l [QtQuickControls]{PageIndicator}{Page Indicator}
|
||||
\li An indicator for the currently active page.
|
||||
\row
|
||||
\li \inlineimage icons/pane-icon16.png
|
||||
\li \l [QtQuickControls]{Pane}
|
||||
\li A background that matches the application style and theme.
|
||||
\endtable
|
||||
*/
|
@@ -26,7 +26,7 @@
|
||||
/*!
|
||||
\page qtquick-properties.html
|
||||
\previouspage qtquick-navigator.html
|
||||
\nextpage qtquick-fonts.html
|
||||
\nextpage qtquick-positioning.html
|
||||
|
||||
\title Specifying Item Properties
|
||||
|
||||
@@ -235,7 +235,9 @@
|
||||
\section2 Geometry
|
||||
|
||||
In the \uicontrol Position group, you can set the position of an item on
|
||||
the x and y axis.
|
||||
the x and y axis. The position of an item in the UI can be either absolute
|
||||
or relative to other items. For more information, see
|
||||
\l{Positioning Items}.
|
||||
|
||||
The z position of an item determines its position in relation to its
|
||||
sibling items in the type hierarchy. You can set it in the \uicontrol Z
|
||||
|
@@ -34,6 +34,7 @@ imagedirs = ../images \
|
||||
../../../src/plugins/qmldesigner/components/formeditor \
|
||||
../../../src/plugins/qmldesigner/components/navigator \
|
||||
../../../src/plugins/qmldesigner/components/timelineeditor/images \
|
||||
../../../src/plugins/qmldesigner/componentsplugin/images \
|
||||
../../../src/plugins/qmldesigner/qmlpreviewplugin/images \
|
||||
../../../src/plugins/qmldesigner/qtquickplugin/images \
|
||||
../../../src/plugins/texteditor/images
|
||||
|
@@ -200,7 +200,7 @@
|
||||
\section1 Next Steps
|
||||
|
||||
To learn more about positioning items in \QDS, see
|
||||
\l{Positioning Items in UIs}.
|
||||
\l{Positioning Items}.
|
||||
|
||||
To learn how to add a second page and move to it from the main page, see
|
||||
the next example in the series, \l {Log In UI - Part 3}.
|
||||
|
@@ -83,6 +83,7 @@
|
||||
\endlist
|
||||
\li \l{Managing Item Hierarchy}
|
||||
\li \l{Specifying Item Properties}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Using Custom Fonts}
|
||||
\li \l{Annotating Designs}
|
||||
\li \l{Qt Quick UI Forms}
|
||||
|
@@ -62,7 +62,7 @@
|
||||
\li \l{Creating Components}
|
||||
\li \l{Managing Item Hierarchy}
|
||||
\li \l{Specifying Item Properties}
|
||||
\li \l{Using Custom Fonts}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Annotating Designs}
|
||||
\endlist
|
||||
\li \b {\l{Adding Dynamics}}
|
||||
|
@@ -29,6 +29,10 @@ Product {
|
||||
}
|
||||
}
|
||||
Depends { name: "Qt.core"; versionAtLeast: "5.14.0" }
|
||||
Depends {
|
||||
name: "Qt.core5compat"
|
||||
condition: Utilities.versionCompare(Qt.core.version, "6") >= 0
|
||||
}
|
||||
|
||||
// TODO: Should fall back to what came from Qt.core for Qt < 5.7, but we cannot express that
|
||||
// atm. Conditionally pulling in a module that sets the property is also not possible,
|
||||
|
@@ -244,6 +244,7 @@ qt {
|
||||
|
||||
QBSFILE = $$replace(_PRO_FILE_, \\.pro$, .qbs)
|
||||
exists($$QBSFILE):DISTFILES += $$QBSFILE
|
||||
DISTFILES += $$_PRO_FILE_PWD_/CMakeLists.txt
|
||||
|
||||
!isEmpty(QTC_PLUGIN_DEPENDS) {
|
||||
LIBS *= -L$$IDE_PLUGIN_PATH # plugin path from output directory
|
||||
|
@@ -20,6 +20,7 @@ DISTFILES += dist/copyright_template.txt \
|
||||
$$files(dist/changes-*) \
|
||||
qtcreator.qbs \
|
||||
$$files(qbs/*, true) \
|
||||
$$files(cmake/*) \
|
||||
$$files(scripts/*.py) \
|
||||
$$files(scripts/*.sh) \
|
||||
$$files(scripts/*.pl)
|
||||
|
@@ -91,6 +91,10 @@ def get_arguments():
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--with-tests', help='Enable building of tests',
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--add-path', help='Prepends a CMAKE_PREFIX_PATH to the build',
|
||||
action='append', dest='prefix_paths', default=[])
|
||||
parser.add_argument('--add-module-path', help='Prepends a CMAKE_MODULE_PATH to the build',
|
||||
action='append', dest='module_paths', default=[])
|
||||
parser.add_argument('--add-make-arg', help='Passes the argument to the make tool.',
|
||||
action='append', dest='make_args', default=[])
|
||||
parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. '
|
||||
@@ -103,7 +107,7 @@ def get_arguments():
|
||||
def build_qtcreator(args, paths):
|
||||
if not os.path.exists(paths.build):
|
||||
os.makedirs(paths.build)
|
||||
prefix_paths = [paths.qt]
|
||||
prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt]
|
||||
if paths.llvm:
|
||||
prefix_paths += [paths.llvm]
|
||||
if paths.elfutils:
|
||||
@@ -126,6 +130,10 @@ def build_qtcreator(args, paths):
|
||||
if args.python3:
|
||||
cmake_args += ['-DPYTHON_EXECUTABLE=' + args.python3]
|
||||
|
||||
if args.module_paths:
|
||||
module_paths = [os.path.abspath(fp) for fp in args.module_paths]
|
||||
cmake_args += ['-DCMAKE_MODULE_PATH=' + ';'.join(module_paths)]
|
||||
|
||||
# force MSVC on Windows, because it looks for GCC in the PATH first,
|
||||
# even if MSVC is first mentioned in the PATH...
|
||||
# TODO would be nicer if we only did this if cl.exe is indeed first in the PATH
|
||||
|
@@ -46,8 +46,10 @@ def get_arguments():
|
||||
help='Path to Qt Creator installation including development package',
|
||||
required=True)
|
||||
parser.add_argument('--output-path', help='Output path for resulting 7zip files')
|
||||
parser.add_argument('--add-path', help='Adds a CMAKE_PREFIX_PATH to the build',
|
||||
parser.add_argument('--add-path', help='Prepends a CMAKE_PREFIX_PATH to the build',
|
||||
action='append', dest='prefix_paths', default=[])
|
||||
parser.add_argument('--add-make-arg', help='Passes the argument to the make tool.',
|
||||
action='append', dest='make_args', default=[])
|
||||
parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. '
|
||||
'Use "--add-config=-DSOMEVAR=SOMEVALUE" if the argument begins with a dash.'),
|
||||
action='append', dest='config_args', default=[])
|
||||
@@ -63,7 +65,7 @@ def build(args, paths):
|
||||
os.makedirs(paths.build)
|
||||
if not os.path.exists(paths.result):
|
||||
os.makedirs(paths.result)
|
||||
prefix_paths = [paths.qt, paths.qt_creator] + [os.path.abspath(fp) for fp in args.prefix_paths]
|
||||
prefix_paths = [os.path.abspath(fp) for fp in args.prefix_paths] + [paths.qt_creator, paths.qt]
|
||||
build_type = 'Debug' if args.debug else 'Release'
|
||||
cmake_args = ['cmake',
|
||||
'-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths),
|
||||
@@ -92,7 +94,10 @@ def build(args, paths):
|
||||
|
||||
cmake_args += args.config_args
|
||||
common.check_print_call(cmake_args + [paths.src], paths.build)
|
||||
common.check_print_call(['cmake', '--build', '.'], paths.build)
|
||||
build_args = ['cmake', '--build', '.']
|
||||
if args.make_args:
|
||||
build_args += ['--'] + args.make_args
|
||||
common.check_print_call(build_args, paths.build)
|
||||
if args.with_docs:
|
||||
common.check_print_call(['cmake', '--build', '.', '--target', 'docs'], paths.build)
|
||||
common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'],
|
||||
|
@@ -133,16 +133,17 @@ def get_rpath(libfilepath, chrpath=None):
|
||||
chrpath = 'chrpath'
|
||||
try:
|
||||
output = subprocess.check_output([chrpath, '-l', libfilepath]).strip()
|
||||
decoded_output = output.decode(encoding) if encoding else output
|
||||
except subprocess.CalledProcessError: # no RPATH or RUNPATH
|
||||
return []
|
||||
marker = 'RPATH='
|
||||
index = output.decode(encoding).find(marker)
|
||||
index = decoded_output.find(marker)
|
||||
if index < 0:
|
||||
marker = 'RUNPATH='
|
||||
index = output.find(marker)
|
||||
index = decoded_output.find(marker)
|
||||
if index < 0:
|
||||
return []
|
||||
return output[index + len(marker):].split(':')
|
||||
return decoded_output[index + len(marker):].split(':')
|
||||
|
||||
def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None):
|
||||
if chrpath is None:
|
||||
@@ -155,12 +156,13 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None):
|
||||
if len(rpath) <= 0:
|
||||
return
|
||||
# remove previous Qt RPATH
|
||||
new_rpath = filter(lambda path: not path.startswith(qt_install_prefix) and not path.startswith(qt_install_libs),
|
||||
rpath)
|
||||
new_rpath = list(filter(lambda path: not path.startswith(qt_install_prefix) and not path.startswith(qt_install_libs),
|
||||
rpath))
|
||||
|
||||
# check for Qt linking
|
||||
lddOutput = subprocess.check_output(['ldd', filepath])
|
||||
if lddOutput.decode(encoding).find('libQt5') >= 0 or lddOutput.find('libicu') >= 0:
|
||||
lddDecodedOutput = lddOutput.decode(encoding) if encoding else lddOutput
|
||||
if lddDecodedOutput.find('libQt5') >= 0 or lddDecodedOutput.find('libicu') >= 0:
|
||||
# add Qt RPATH if necessary
|
||||
relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath))
|
||||
if relative_path == '.':
|
||||
@@ -180,7 +182,7 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None):
|
||||
def is_unix_executable(filepath):
|
||||
# Whether a file is really a binary executable and not a script and not a symlink (unix only)
|
||||
if os.path.exists(filepath) and os.access(filepath, os.X_OK) and not os.path.islink(filepath):
|
||||
with open(filepath) as f:
|
||||
with open(filepath, 'rb') as f:
|
||||
return f.read(2) != "#!"
|
||||
|
||||
def is_unix_library(filepath):
|
||||
|
@@ -64,9 +64,7 @@ if [ -d "$assetimporterSrcDir" ]; then
|
||||
if [ ! -d "$assetimporterDestDir" ]; then
|
||||
echo "- Copying 3d assetimporter plugins"
|
||||
mkdir -p "$assetimporterDestDir"
|
||||
for plugin in "$assetimporterSrcDir"/*.dylib; do
|
||||
cp "$plugin" "$assetimporterDestDir"/ || exit 1
|
||||
done
|
||||
find "$assetimporterSrcDir" -iname "*.dylib" -maxdepth 1 -exec cp {} "$assetimporterDestDir"/ \;
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -201,6 +201,7 @@ Item {
|
||||
MouseArea {
|
||||
id: mapMouseArea
|
||||
anchors.fill: parent
|
||||
preventStealing: true
|
||||
onPositionChanged: {
|
||||
if (pressed && mouse.buttons === Qt.LeftButton) {
|
||||
var xx = Math.max(0, Math.min(mouse.x, parent.width))
|
||||
|
282
src/libs/3rdparty/syntax-highlighting/data/syntax/licenses/LICENSE.GPLv2
vendored
Normal file
@@ -0,0 +1,282 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom
|
||||
to share and change it. By contrast, the GNU General Public License is
|
||||
intended to guarantee your freedom to share and change free software
|
||||
--to make sure the software is free for all its users. This General
|
||||
Public License applies to most of the Free Software Foundation's
|
||||
software and to any other program whose authors commit to using it.
|
||||
(Some other Free Software Foundation software is covered by the GNU
|
||||
Lesser General Public License instead.) You can apply it to your
|
||||
programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price.
|
||||
Our General Public Licenses are designed to make sure that you have the
|
||||
freedom to distribute copies of free software (and charge for this
|
||||
service if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone
|
||||
to deny you these rights or to ask you to surrender the rights. These
|
||||
restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that you
|
||||
have. You must make sure that they, too, receive or can get the source
|
||||
code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents.
|
||||
We wish to avoid the danger that redistributors of a free program will
|
||||
individually obtain patent licenses, in effect making the program
|
||||
proprietary. To prevent this, we have made it clear that any patent
|
||||
must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a
|
||||
notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of running
|
||||
the Program is not restricted, and the output from the Program is
|
||||
covered only if its contents constitute a work based on the Program
|
||||
(independent of having been made by running the Program). Whether that
|
||||
is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source
|
||||
code as you receive it, in any medium, provided that you conspicuously
|
||||
and appropriately publish on each copy an appropriate copyright notice
|
||||
and disclaimer of warranty; keep intact all the notices that refer to
|
||||
this License and to the absence of any warranty; and give any other
|
||||
recipients of the Program a copy of this License along with the
|
||||
Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of
|
||||
it, thus forming a work based on the Program, and copy and distribute
|
||||
such modifications or work under the terms of Section 1 above, provided
|
||||
that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but does
|
||||
not normally print such an announcement, your work based on the
|
||||
Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of a
|
||||
storage or distribution medium does not bring the other work under the
|
||||
scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software
|
||||
interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your cost
|
||||
of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to control
|
||||
compilation and installation of the executable. However, as a special
|
||||
exception, the source code distributed need not include anything that
|
||||
is normally distributed (in either source or binary form) with the
|
||||
major components (compiler, kernel, and so on) of the operating system
|
||||
on which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access
|
||||
to copy from a designated place, then offering equivalent access to
|
||||
copy the source code from the same place counts as distribution of the
|
||||
source code, even though third parties are not compelled to copy the
|
||||
source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt otherwise
|
||||
to copy, modify, sublicense or distribute the Program is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this License
|
||||
will not have their licenses terminated so long as such parties remain
|
||||
in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further restrictions
|
||||
on the recipients' exercise of the rights granted herein. You are not
|
||||
responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent license
|
||||
would not permit royalty-free redistribution of the Program by all
|
||||
those who receive copies directly or indirectly through you, then the
|
||||
only way you could satisfy both it and this License would be to refrain
|
||||
entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License may
|
||||
add an explicit geographical distribution limitation excluding those
|
||||
countries, so that distribution is permitted only in or among countries
|
||||
not thus excluded. In such case, this License incorporates the limitation
|
||||
as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail
|
||||
to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Program does not specify a version
|
||||
number of this License, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the
|
||||
author to ask for permission. For software which is copyrighted by
|
||||
the Free Software Foundation, write to the Free Software Foundation;
|
||||
we sometimes make exceptions for this. Our decision will be guided by
|
||||
the two goals of preserving the free status of all derivatives of our
|
||||
free software and of promoting the sharing and reuse of software
|
||||
generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
||||
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
|
||||
YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
||||
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE
|
||||
TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
674
src/libs/3rdparty/syntax-highlighting/data/syntax/licenses/LICENSE.GPLv3
vendored
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
504
src/libs/3rdparty/syntax-highlighting/data/syntax/licenses/LICENSE.LGPLv21
vendored
Normal file
@@ -0,0 +1,504 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
163
src/libs/3rdparty/syntax-highlighting/data/syntax/licenses/LICENSE.LGPLv3
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
licensedocument, but changing it is not allowed.
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, “this License” refers to version 3 of the GNU Lesser
|
||||
General Public License, and the “GNU GPL” refers to version 3 of the
|
||||
GNU General Public License.
|
||||
|
||||
“The Library” refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An “Application” is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A “Combined Work” is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the “Linked
|
||||
Version”.
|
||||
|
||||
The “Minimal Corresponding Source” for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The “Corresponding Application Code” for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort
|
||||
to ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this
|
||||
license document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that, taken
|
||||
together, effectively do not restrict modification of the portions of
|
||||
the Library contained in the Combined Work and reverse engineering for
|
||||
debugging such modifications, if you also do each of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this
|
||||
license document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of
|
||||
this License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with
|
||||
the Library. A suitable mechanism is one that (a) uses at run
|
||||
time a copy of the Library already present on the user's
|
||||
computer system, and (b) will operate properly with a modified
|
||||
version of the Library that is interface-compatible with the
|
||||
Linked Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would
|
||||
otherwise be required to provide such information under section 6
|
||||
of the GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the Application
|
||||
with a modified version of the Linked Version. (If you use option
|
||||
4d0, the Installation Information must accompany the Minimal
|
||||
Corresponding Source and Corresponding Application Code. If you
|
||||
use option 4d1, you must provide the Installation Information in
|
||||
the manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the Library
|
||||
side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities, conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of
|
||||
it is a work based on the Library, and explaining where to find
|
||||
the accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
as you received it specifies that a certain numbered version of the
|
||||
GNU Lesser General Public License “or any later version” applies to
|
||||
it, you have the option of following the terms and conditions either
|
||||
of that published version or of any later version published by the
|
||||
Free Software Foundation. If the Library as you received it does not
|
||||
specify a version number of the GNU Lesser General Public License,
|
||||
you may choose any version of the GNU Lesser General Public License
|
||||
ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the Library.
|
||||
|
@@ -383,6 +383,31 @@ static bool endsWithPtrOrRef(const QString &type)
|
||||
|
||||
void TypePrettyPrinter::visit(Function *type)
|
||||
{
|
||||
if (_overview->showTemplateParameters) {
|
||||
QStringList nameParts = _name.split("::");
|
||||
int i = nameParts.length() - 1;
|
||||
for (Scope *s = type->enclosingScope(); s && i >= 0; s = s->enclosingScope()) {
|
||||
if (Template *templ = s->asTemplate()) {
|
||||
QString &n = nameParts[i];
|
||||
n += '<';
|
||||
for (int index = 0; index < templ->templateParameterCount(); ++index) {
|
||||
if (index)
|
||||
n += QLatin1String(", ");
|
||||
QString arg = _overview->prettyName(templ->templateParameterAt(index)->name());
|
||||
if (arg.isEmpty()) {
|
||||
arg += 'T';
|
||||
arg += QString::number(index + 1);
|
||||
}
|
||||
n += arg;
|
||||
}
|
||||
n += '>';
|
||||
}
|
||||
if (s->identifier())
|
||||
--i;
|
||||
}
|
||||
_name = nameParts.join("::");
|
||||
}
|
||||
|
||||
if (_needsParens) {
|
||||
_text.prepend(QLatin1Char('('));
|
||||
if (! _name.isEmpty()) {
|
||||
@@ -417,7 +442,10 @@ void TypePrettyPrinter::visit(Function *type)
|
||||
if (TypenameArgument *typenameArg = param->asTypenameArgument()) {
|
||||
templateScope.append(QLatin1String(typenameArg->isClassDeclarator()
|
||||
? "class " : "typename "));
|
||||
templateScope.append(_overview->prettyName(typenameArg->name()));
|
||||
QString name = _overview->prettyName(typenameArg->name());
|
||||
if (name.isEmpty())
|
||||
name.append('T').append(QString::number(i + 1));
|
||||
templateScope.append(name);
|
||||
} else if (Argument *arg = param->asArgument()) {
|
||||
templateScope.append(operator()(arg->type(),
|
||||
_overview->prettyName(arg->name())));
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "sshsettings.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDir>
|
||||
@@ -45,12 +46,7 @@ SshKeyCreationDialog::SshKeyCreationDialog(QWidget *parent)
|
||||
: QDialog(parent), m_ui(new Ui::SshKeyCreationDialog)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
// Not using Utils::PathChooser::browseButtonLabel to avoid dependency
|
||||
#ifdef Q_OS_MAC
|
||||
m_ui->privateKeyFileButton->setText(tr("Choose..."));
|
||||
#else
|
||||
m_ui->privateKeyFileButton->setText(tr("Browse..."));
|
||||
#endif
|
||||
m_ui->privateKeyFileButton->setText(Utils::PathChooser::browseButtonLabel());
|
||||
const QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
|
||||
+ QLatin1String("/.ssh/qtc_id");
|
||||
setPrivateKeyFile(defaultPath);
|
||||
|
@@ -9,6 +9,7 @@ Project {
|
||||
|
||||
QtcLibrary {
|
||||
Depends { name: "Qt"; submodules: ["qml", "quick", "gui"] }
|
||||
Depends { name: "Qt.testlib"; condition: project.withAutotests }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Group {
|
||||
@@ -48,7 +49,7 @@ Project {
|
||||
|
||||
Group {
|
||||
name: "Unit test utilities"
|
||||
condition: qtc.testsEnabled
|
||||
condition: project.withAutotests
|
||||
files: [
|
||||
"runscenegraphtest.cpp", "runscenegraphtest.h"
|
||||
]
|
||||
|
@@ -171,9 +171,8 @@ int AndroidQtVersion::minimumNDK() const
|
||||
|
||||
void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
|
||||
{
|
||||
if (supportsMultipleQtAbis())
|
||||
m_androidAbis = evaluator->values("ALL_ANDROID_ABIS");
|
||||
else
|
||||
m_androidAbis = evaluator->values("ALL_ANDROID_ABIS");
|
||||
if (m_androidAbis.isEmpty())
|
||||
m_androidAbis = QStringList{evaluator->value("ANDROID_TARGET_ARCH")};
|
||||
const QString androidPlatform = evaluator->value("ANDROID_PLATFORM");
|
||||
if (!androidPlatform.isEmpty()) {
|
||||
|
@@ -14,6 +14,7 @@ add_qtc_plugin(BareMetal
|
||||
debugserverprovidermanager.cpp debugserverprovidermanager.h
|
||||
debugserverproviderssettingspage.cpp debugserverproviderssettingspage.h
|
||||
debugservers/gdb/gdbserverprovider.cpp debugservers/gdb/gdbserverprovider.h
|
||||
debugservers/gdb/genericgdbserverprovider.cpp debugservers/gdb/genericgdbserverprovider.h
|
||||
debugservers/gdb/openocdgdbserverprovider.cpp debugservers/gdb/openocdgdbserverprovider.h
|
||||
debugservers/gdb/stlinkutilgdbserverprovider.cpp debugservers/gdb/stlinkutilgdbserverprovider.h
|
||||
debugservers/gdb/jlinkgdbserverprovider.cpp debugservers/gdb/jlinkgdbserverprovider.h
|
||||
|
@@ -42,6 +42,7 @@ QtcPlugin {
|
||||
prefix: "debugservers/gdb/"
|
||||
files: [
|
||||
"gdbserverprovider.cpp", "gdbserverprovider.h",
|
||||
"genericgdbserverprovider.cpp", "genericgdbserverprovider.h",
|
||||
"openocdgdbserverprovider.cpp", "openocdgdbserverprovider.h",
|
||||
"stlinkutilgdbserverprovider.cpp", "stlinkutilgdbserverprovider.h",
|
||||
"jlinkgdbserverprovider.cpp", "jlinkgdbserverprovider.h",
|
||||
|
@@ -39,6 +39,7 @@ const char DEBUG_SERVER_PROVIDERS_SETTINGS_ID[] = "EE.BareMetal.DebugServerProvi
|
||||
// GDB Debugger Server Provider Ids.
|
||||
const char GDBSERVER_OPENOCD_PROVIDER_ID[] = "BareMetal.GdbServerProvider.OpenOcd";
|
||||
const char GDBSERVER_JLINK_PROVIDER_ID[] = "BareMetal.GdbServerProvider.JLink";
|
||||
const char GDBSERVER_GENERIC_PROVIDER_ID[] = "BareMetal.GdbServerProvider.Generic";
|
||||
const char GDBSERVER_STLINK_UTIL_PROVIDER_ID[] = "BareMetal.GdbServerProvider.STLinkUtil";
|
||||
const char GDBSERVER_EBLINK_PROVIDER_ID[] = "BareMetal.GdbServerProvider.EBlink";
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "idebugserverprovider.h"
|
||||
|
||||
// GDB debug servers.
|
||||
#include "debugservers/gdb/genericgdbserverprovider.h"
|
||||
#include "debugservers/gdb/openocdgdbserverprovider.h"
|
||||
#include "debugservers/gdb/stlinkutilgdbserverprovider.h"
|
||||
#include "debugservers/gdb/jlinkgdbserverprovider.h"
|
||||
@@ -61,7 +62,8 @@ static DebugServerProviderManager *m_instance = nullptr;
|
||||
|
||||
DebugServerProviderManager::DebugServerProviderManager()
|
||||
: m_configFile(Utils::FilePath::fromString(Core::ICore::userResourcePath() + fileNameKeyC))
|
||||
, m_factories({new JLinkGdbServerProviderFactory,
|
||||
, m_factories({new GenericGdbServerProviderFactory,
|
||||
new JLinkGdbServerProviderFactory,
|
||||
new OpenOcdGdbServerProviderFactory,
|
||||
new StLinkUtilGdbServerProviderFactory,
|
||||
new EBlinkGdbServerProviderFactory,
|
||||
@@ -115,7 +117,13 @@ void DebugServerProviderManager::restoreProviders()
|
||||
if (!data.contains(key))
|
||||
break;
|
||||
|
||||
const QVariantMap map = data.value(key).toMap();
|
||||
QVariantMap map = data.value(key).toMap();
|
||||
const QStringList keys = map.keys();
|
||||
for (const QString &key : keys) {
|
||||
const int lastDot = key.lastIndexOf('.');
|
||||
if (lastDot != -1)
|
||||
map[key.mid(lastDot + 1)] = map[key];
|
||||
}
|
||||
bool restored = false;
|
||||
for (IDebugServerProviderFactory *f : qAsConst(m_factories)) {
|
||||
if (f->canRestore(map)) {
|
||||
|
@@ -46,17 +46,17 @@ using namespace Utils;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char executableFileKeyC[] = "BareMetal.EBlinkGdbServerProvider.ExecutableFile";
|
||||
const char verboseLevelKeyC[] = "BareMetal.EBlinkGdbServerProvider.VerboseLevel";
|
||||
const char deviceScriptC[] = "BareMetal.EBlinkGdbServerProvider.DeviceScript";
|
||||
const char interfaceTypeC[] = "BareMetal.EBlinkGdbServerProvider.InterfaceType";
|
||||
const char interfaceResetOnConnectC[] = "BareMetal.EBlinkGdbServerProvider.interfaceResetOnConnect";
|
||||
const char interfaceSpeedC[] = "BareMetal.EBlinkGdbServerProvider.InterfaceSpeed";
|
||||
const char interfaceExplicidDeviceC[] = "BareMetal.EBlinkGdbServerProvider.InterfaceExplicidDevice";
|
||||
const char targetNameC[] = "BareMetal.EBlinkGdbServerProvider.TargetName";
|
||||
const char targetDisableStackC[] = "BareMetal.EBlinkGdbServerProvider.TargetDisableStack";
|
||||
const char gdbShutDownAfterDisconnectC[] = "BareMetal.EBlinkGdbServerProvider.GdbShutDownAfterDisconnect";
|
||||
const char gdbNotUseCacheC[] = "BareMetal.EBlinkGdbServerProvider.GdbNotUseCache";
|
||||
const char executableFileKeyC[] = "ExecutableFile";
|
||||
const char verboseLevelKeyC[] = "VerboseLevel";
|
||||
const char deviceScriptC[] = "DeviceScript";
|
||||
const char interfaceTypeC[] = "InterfaceType";
|
||||
const char interfaceResetOnConnectC[] = "interfaceResetOnConnect";
|
||||
const char interfaceSpeedC[] = "InterfaceSpeed";
|
||||
const char interfaceExplicidDeviceC[] = "InterfaceExplicidDevice";
|
||||
const char targetNameC[] = "TargetName";
|
||||
const char targetDisableStackC[] = "TargetDisableStack";
|
||||
const char gdbShutDownAfterDisconnectC[] = "GdbShutDownAfterDisconnect";
|
||||
const char gdbNotUseCacheC[] = "GdbNotUseCache";
|
||||
|
||||
// EBlinkGdbServerProvider
|
||||
|
||||
@@ -66,7 +66,6 @@ EBlinkGdbServerProvider::EBlinkGdbServerProvider()
|
||||
setInitCommands(defaultInitCommands());
|
||||
setResetCommands(defaultResetCommands());
|
||||
setChannel("127.0.0.1", 2331);
|
||||
setSettingsKeyBase("BareMetal.EBlinkGdbServerProvider");
|
||||
setTypeDisplayName(GdbServerProvider::tr("EBlink"));
|
||||
setConfigurationWidgetCreator([this] { return new EBlinkGdbServerProviderConfigWidget(this); });
|
||||
}
|
||||
|
@@ -49,11 +49,11 @@ using namespace Utils;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char startupModeKeyC[] = "BareMetal.GdbServerProvider.Mode";
|
||||
const char peripheralDescriptionFileKeyC[] = "BareMetal.GdbServerProvider.PeripheralDescriptionFile";
|
||||
const char initCommandsKeyC[] = "BareMetal.GdbServerProvider.InitCommands";
|
||||
const char resetCommandsKeyC[] = "BareMetal.GdbServerProvider.ResetCommands";
|
||||
const char useExtendedRemoteKeyC[] = "BareMetal.GdbServerProvider.UseExtendedRemote";
|
||||
const char startupModeKeyC[] = "Mode";
|
||||
const char peripheralDescriptionFileKeyC[] = "PeripheralDescriptionFile";
|
||||
const char initCommandsKeyC[] = "InitCommands";
|
||||
const char resetCommandsKeyC[] = "ResetCommands";
|
||||
const char useExtendedRemoteKeyC[] = "UseExtendedRemote";
|
||||
|
||||
// GdbServerProvider
|
||||
|
||||
|
@@ -1,13 +1,15 @@
|
||||
HEADERS += \
|
||||
$$PWD/eblinkgdbserverprovider.h \
|
||||
$$PWD/gdbserverprovider.h \
|
||||
$$PWD/genericgdbserverprovider.h \
|
||||
$$PWD/jlinkgdbserverprovider.h \
|
||||
$$PWD/openocdgdbserverprovider.h \
|
||||
$$PWD/stlinkutilgdbserverprovider.h \
|
||||
$$PWD/jlinkgdbserverprovider.h \
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/eblinkgdbserverprovider.cpp \
|
||||
$$PWD/gdbserverprovider.cpp \
|
||||
$$PWD/genericgdbserverprovider.cpp \
|
||||
$$PWD/jlinkgdbserverprovider.cpp \
|
||||
$$PWD/openocdgdbserverprovider.cpp \
|
||||
$$PWD/stlinkutilgdbserverprovider.cpp \
|
||||
$$PWD/jlinkgdbserverprovider.cpp \
|
||||
|
@@ -0,0 +1,134 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com>
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "genericgdbserverprovider.h"
|
||||
|
||||
#include <baremetal/baremetalconstants.h>
|
||||
#include <baremetal/debugserverprovidermanager.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QFormLayout>
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
// GenericGdbServerProvider
|
||||
|
||||
GenericGdbServerProvider::GenericGdbServerProvider()
|
||||
: GdbServerProvider(Constants::GDBSERVER_GENERIC_PROVIDER_ID)
|
||||
{
|
||||
setChannel("localhost", 3333);
|
||||
setTypeDisplayName(GdbServerProvider::tr("Generic"));
|
||||
setConfigurationWidgetCreator([this] { return new GenericGdbServerProviderConfigWidget(this); });
|
||||
}
|
||||
|
||||
QSet<GdbServerProvider::StartupMode> GenericGdbServerProvider::supportedStartupModes() const
|
||||
{
|
||||
return {StartupOnNetwork};
|
||||
}
|
||||
|
||||
// GenericGdbServerProviderFactory
|
||||
|
||||
GenericGdbServerProviderFactory::GenericGdbServerProviderFactory()
|
||||
{
|
||||
setId(Constants::GDBSERVER_GENERIC_PROVIDER_ID);
|
||||
setDisplayName(GdbServerProvider::tr("Generic"));
|
||||
setCreator([] { return new GenericGdbServerProvider; });
|
||||
}
|
||||
|
||||
// GdbServerProviderConfigWidget
|
||||
|
||||
GenericGdbServerProviderConfigWidget::GenericGdbServerProviderConfigWidget(
|
||||
GenericGdbServerProvider *provider)
|
||||
: GdbServerProviderConfigWidget(provider)
|
||||
{
|
||||
Q_ASSERT(provider);
|
||||
|
||||
m_hostWidget = new HostWidget(this);
|
||||
m_mainLayout->addRow(tr("Host:"), m_hostWidget);
|
||||
|
||||
m_useExtendedRemoteCheckBox = new QCheckBox(this);
|
||||
m_useExtendedRemoteCheckBox->setToolTip("Use GDB target extended-remote");
|
||||
m_mainLayout->addRow(tr("Extended mode:"), m_useExtendedRemoteCheckBox);
|
||||
m_initCommandsTextEdit = new QPlainTextEdit(this);
|
||||
m_initCommandsTextEdit->setToolTip(defaultInitCommandsTooltip());
|
||||
m_mainLayout->addRow(tr("Init commands:"), m_initCommandsTextEdit);
|
||||
m_resetCommandsTextEdit = new QPlainTextEdit(this);
|
||||
m_resetCommandsTextEdit->setToolTip(defaultResetCommandsTooltip());
|
||||
m_mainLayout->addRow(tr("Reset commands:"), m_resetCommandsTextEdit);
|
||||
|
||||
addErrorLabel();
|
||||
setFromProvider();
|
||||
|
||||
const auto chooser = new Utils::VariableChooser(this);
|
||||
chooser->addSupportedWidget(m_initCommandsTextEdit);
|
||||
chooser->addSupportedWidget(m_resetCommandsTextEdit);
|
||||
|
||||
connect(m_hostWidget, &HostWidget::dataChanged,
|
||||
this, &GdbServerProviderConfigWidget::dirty);
|
||||
connect(m_useExtendedRemoteCheckBox, &QCheckBox::stateChanged,
|
||||
this, &GdbServerProviderConfigWidget::dirty);
|
||||
connect(m_initCommandsTextEdit, &QPlainTextEdit::textChanged,
|
||||
this, &GdbServerProviderConfigWidget::dirty);
|
||||
connect(m_resetCommandsTextEdit, &QPlainTextEdit::textChanged,
|
||||
this, &GdbServerProviderConfigWidget::dirty);
|
||||
}
|
||||
|
||||
void GenericGdbServerProviderConfigWidget::apply()
|
||||
{
|
||||
const auto p = static_cast<GenericGdbServerProvider *>(m_provider);
|
||||
Q_ASSERT(p);
|
||||
|
||||
p->setChannel(m_hostWidget->channel());
|
||||
p->setUseExtendedRemote(m_useExtendedRemoteCheckBox->isChecked());
|
||||
p->setInitCommands(m_initCommandsTextEdit->toPlainText());
|
||||
p->setResetCommands(m_resetCommandsTextEdit->toPlainText());
|
||||
IDebugServerProviderConfigWidget::apply();
|
||||
}
|
||||
|
||||
void GenericGdbServerProviderConfigWidget::discard()
|
||||
{
|
||||
setFromProvider();
|
||||
IDebugServerProviderConfigWidget::discard();
|
||||
}
|
||||
|
||||
void GenericGdbServerProviderConfigWidget::setFromProvider()
|
||||
{
|
||||
const auto p = static_cast<GenericGdbServerProvider *>(m_provider);
|
||||
Q_ASSERT(p);
|
||||
|
||||
const QSignalBlocker blocker(this);
|
||||
m_hostWidget->setChannel(p->channel());
|
||||
m_useExtendedRemoteCheckBox->setChecked(p->useExtendedRemote());
|
||||
m_initCommandsTextEdit->setPlainText(p->initCommands());
|
||||
m_resetCommandsTextEdit->setPlainText(p->resetCommands());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 Denis Shienkov <denis.shienkov@gmail.com>
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gdbserverprovider.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QCheckBox;
|
||||
class QPlainTextEdit;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
// GenericGdbServerProvider
|
||||
|
||||
class GenericGdbServerProvider final : public GdbServerProvider
|
||||
{
|
||||
private:
|
||||
GenericGdbServerProvider();
|
||||
QSet<StartupMode> supportedStartupModes() const final;
|
||||
|
||||
friend class GenericGdbServerProviderConfigWidget;
|
||||
friend class GenericGdbServerProviderFactory;
|
||||
friend class BareMetalDevice;
|
||||
};
|
||||
|
||||
// GenericGdbServerProviderFactory
|
||||
|
||||
class GenericGdbServerProviderFactory final : public IDebugServerProviderFactory
|
||||
{
|
||||
public:
|
||||
GenericGdbServerProviderFactory();
|
||||
};
|
||||
|
||||
// GenericGdbServerProviderConfigWidget
|
||||
|
||||
class GenericGdbServerProviderConfigWidget final
|
||||
: public GdbServerProviderConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GenericGdbServerProviderConfigWidget(
|
||||
GenericGdbServerProvider *provider);
|
||||
|
||||
private:
|
||||
void apply() final;
|
||||
void discard() final;
|
||||
|
||||
void setFromProvider();
|
||||
|
||||
HostWidget *m_hostWidget = nullptr;
|
||||
QCheckBox *m_useExtendedRemoteCheckBox = nullptr;
|
||||
QPlainTextEdit *m_initCommandsTextEdit = nullptr;
|
||||
QPlainTextEdit *m_resetCommandsTextEdit = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace BareMetal
|
@@ -46,13 +46,13 @@ using namespace Utils;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char executableFileKeyC[] = "BareMetal.JLinkGdbServerProvider.ExecutableFile";
|
||||
const char jlinkDeviceKeyC[] = "BareMetal.JLinkGdbServerProvider.JLinkDevice";
|
||||
const char jlinkHostInterfaceKeyC[] = "BareMetal.JLinkGdbServerProvider.JLinkHostInterface";
|
||||
const char jlinkHostInterfaceIPAddressKeyC[] = "BareMetal.JLinkGdbServerProvider.JLinkHostInterfaceIPAddress";
|
||||
const char jlinkTargetInterfaceKeyC[] = "BareMetal.JLinkGdbServerProvider.JLinkTargetInterface";
|
||||
const char jlinkTargetInterfaceSpeedKeyC[] = "BareMetal.JLinkGdbServerProvider.JLinkTargetInterfaceSpeed";
|
||||
const char additionalArgumentsKeyC[] = "BareMetal.JLinkGdbServerProvider.AdditionalArguments";
|
||||
const char executableFileKeyC[] = "ExecutableFile";
|
||||
const char jlinkDeviceKeyC[] = "JLinkDevice";
|
||||
const char jlinkHostInterfaceKeyC[] = "JLinkHostInterface";
|
||||
const char jlinkHostInterfaceIPAddressKeyC[] = "JLinkHostInterfaceIPAddress";
|
||||
const char jlinkTargetInterfaceKeyC[] = "JLinkTargetInterface";
|
||||
const char jlinkTargetInterfaceSpeedKeyC[] = "JLinkTargetInterfaceSpeed";
|
||||
const char additionalArgumentsKeyC[] = "AdditionalArguments";
|
||||
|
||||
// JLinkGdbServerProvider
|
||||
|
||||
@@ -62,7 +62,6 @@ JLinkGdbServerProvider::JLinkGdbServerProvider()
|
||||
setInitCommands(defaultInitCommands());
|
||||
setResetCommands(defaultResetCommands());
|
||||
setChannel("localhost", 2331);
|
||||
setSettingsKeyBase("BareMetal.JLinkGdbServerProvider");
|
||||
setTypeDisplayName(GdbServerProvider::tr("JLink"));
|
||||
setConfigurationWidgetCreator([this] { return new JLinkGdbServerProviderConfigWidget(this); });
|
||||
}
|
||||
|
@@ -44,10 +44,10 @@ using namespace Utils;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char executableFileKeyC[] = "BareMetal.OpenOcdGdbServerProvider.ExecutableFile";
|
||||
const char rootScriptsDirKeyC[] = "BareMetal.OpenOcdGdbServerProvider.RootScriptsDir";
|
||||
const char configurationFileKeyC[] = "BareMetal.OpenOcdGdbServerProvider.ConfigurationPath";
|
||||
const char additionalArgumentsKeyC[] = "BareMetal.OpenOcdGdbServerProvider.AdditionalArguments";
|
||||
const char executableFileKeyC[] = "ExecutableFile";
|
||||
const char rootScriptsDirKeyC[] = "RootScriptsDir";
|
||||
const char configurationFileKeyC[] = "ConfigurationPath";
|
||||
const char additionalArgumentsKeyC[] = "AdditionalArguments";
|
||||
|
||||
// OpenOcdGdbServerProvider
|
||||
|
||||
@@ -57,7 +57,6 @@ OpenOcdGdbServerProvider::OpenOcdGdbServerProvider()
|
||||
setInitCommands(defaultInitCommands());
|
||||
setResetCommands(defaultResetCommands());
|
||||
setChannel("localhost", 3333);
|
||||
setSettingsKeyBase("BareMetal.OpenOcdGdbServerProvider");
|
||||
setTypeDisplayName(GdbServerProvider::tr("OpenOCD"));
|
||||
setConfigurationWidgetCreator([this] { return new OpenOcdGdbServerProviderConfigWidget(this); });
|
||||
}
|
||||
|
@@ -44,11 +44,11 @@ using namespace Utils;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char executableFileKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.ExecutableFile";
|
||||
const char verboseLevelKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.VerboseLevel";
|
||||
const char extendedModeKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.ExtendedMode";
|
||||
const char resetBoardKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.ResetBoard";
|
||||
const char transportLayerKeyC[] = "BareMetal.StLinkUtilGdbServerProvider.TransportLayer";
|
||||
const char executableFileKeyC[] = "ExecutableFile";
|
||||
const char verboseLevelKeyC[] = "VerboseLevel";
|
||||
const char extendedModeKeyC[] = "ExtendedMode";
|
||||
const char resetBoardKeyC[] = "ResetBoard";
|
||||
const char transportLayerKeyC[] = "TransportLayer";
|
||||
|
||||
// StLinkUtilGdbServerProvider
|
||||
|
||||
@@ -58,7 +58,6 @@ StLinkUtilGdbServerProvider::StLinkUtilGdbServerProvider()
|
||||
setInitCommands(defaultInitCommands());
|
||||
setResetCommands(defaultResetCommands());
|
||||
setChannel("localhost", 4242);
|
||||
setSettingsKeyBase("BareMetal.StLinkUtilGdbServerProvider");
|
||||
setTypeDisplayName(GdbServerProvider::tr("ST-LINK Utility"));
|
||||
setConfigurationWidgetCreator([this] { return new StLinkUtilGdbServerProviderConfigWidget(this); });
|
||||
}
|
||||
|
@@ -52,9 +52,9 @@ namespace Internal {
|
||||
|
||||
using namespace Uv;
|
||||
|
||||
constexpr char adapterOptionsKeyC[] = "BareMetal.JLinkUvscServerProvider.AdapterOptions";
|
||||
constexpr char adapterPortKeyC[] = "BareMetal.JLinkUvscServerProvider.AdapterPort";
|
||||
constexpr char adapterSpeedKeyC[] = "BareMetal.JLinkUvscServerProvider.AdapterSpeed";
|
||||
constexpr char adapterOptionsKeyC[] = "AdapterOptions";
|
||||
constexpr char adapterPortKeyC[] = "AdapterPort";
|
||||
constexpr char adapterSpeedKeyC[] = "AdapterSpeed";
|
||||
|
||||
static int decodeSpeedCode(JLinkUvscAdapterOptions::Speed speed)
|
||||
{
|
||||
|
@@ -50,7 +50,7 @@ namespace Internal {
|
||||
|
||||
using namespace Uv;
|
||||
|
||||
const char limitSpeedKeyC[] = "BareMetal.SimulatorUvscServerProvider.LimitSpeed";
|
||||
const char limitSpeedKeyC[] = "LimitSpeed";
|
||||
|
||||
static DriverSelection defaultSimulatorDriverSelection()
|
||||
{
|
||||
|
@@ -52,9 +52,9 @@ namespace Internal {
|
||||
|
||||
using namespace Uv;
|
||||
|
||||
constexpr char adapterOptionsKeyC[] = "BareMetal.StLinkUvscServerProvider.AdapterOptions";
|
||||
constexpr char adapterPortKeyC[] = "BareMetal.StLinkUvscServerProvider.AdapterPort";
|
||||
constexpr char adapterSpeedKeyC[] = "BareMetal.StLinkUvscServerProvider.AdapterSpeed";
|
||||
constexpr char adapterOptionsKeyC[] = "AdapterOptions";
|
||||
constexpr char adapterPortKeyC[] = "AdapterPort";
|
||||
constexpr char adapterSpeedKeyC[] = "AdapterSpeed";
|
||||
|
||||
static QString buildAdapterOptions(const StLinkUvscAdapterOptions &opts)
|
||||
{
|
||||
|
@@ -58,9 +58,9 @@ namespace Internal {
|
||||
using namespace Uv;
|
||||
|
||||
// Whole software package selection keys.
|
||||
constexpr char toolsIniKeyC[] = "BareMetal.UvscServerProvider.ToolsIni";
|
||||
constexpr char deviceSelectionKeyC[] = "BareMetal.UvscServerProvider.DeviceSelection";
|
||||
constexpr char driverSelectionKeyC[] = "BareMetal.UvscServerProvider.DriverSelection";
|
||||
constexpr char toolsIniKeyC[] = "ToolsIni";
|
||||
constexpr char deviceSelectionKeyC[] = "DeviceSelection";
|
||||
constexpr char driverSelectionKeyC[] = "DriverSelection";
|
||||
|
||||
constexpr int defaultPortNumber = 5101;
|
||||
|
||||
|
@@ -38,39 +38,39 @@ namespace Internal {
|
||||
namespace Uv {
|
||||
|
||||
// Software package data keys.
|
||||
constexpr char packageDescrKeyC[] = "BareMetal.UvscServerProvider.PackageDescription";
|
||||
constexpr char packageFileKeyC[] = "BareMetal.UvscServerProvider.PackageFile";
|
||||
constexpr char packageNameKeyC[] = "BareMetal.UvscServerProvider.PackageName";
|
||||
constexpr char packageUrlKeyC[] = "BareMetal.UvscServerProvider.PackageUrl";
|
||||
constexpr char packageVendorNameKeyC[] = "BareMetal.UvscServerProvider.PackageVendorName";
|
||||
constexpr char packageVendorIdKeyC[] = "BareMetal.UvscServerProvider.PackageVendorId";
|
||||
constexpr char packageVersionKeyC[] = "BareMetal.UvscServerProvider.PackageVersion";
|
||||
constexpr char packageDescrKeyC[] = "PackageDescription";
|
||||
constexpr char packageFileKeyC[] = "PackageFile";
|
||||
constexpr char packageNameKeyC[] = "PackageName";
|
||||
constexpr char packageUrlKeyC[] = "PackageUrl";
|
||||
constexpr char packageVendorNameKeyC[] = "PackageVendorName";
|
||||
constexpr char packageVendorIdKeyC[] = "PackageVendorId";
|
||||
constexpr char packageVersionKeyC[] = "PackageVersion";
|
||||
// Device data keys.
|
||||
constexpr char deviceNameKeyC[] = "BareMetal.UvscServerProvider.DeviceName";
|
||||
constexpr char deviceDescrKeyC[] = "BareMetal.UvscServerProvider.DeviceDescription";
|
||||
constexpr char deviceFamilyKeyC[] = "BareMetal.UvscServerProvider.DeviceFamily";
|
||||
constexpr char deviceSubFamilyKeyC[] = "BareMetal.UvscServerProvider.DeviceSubFamily";
|
||||
constexpr char deviceVendorNameKeyC[] = "BareMetal.UvscServerProvider.DeviceVendorName";
|
||||
constexpr char deviceVendorIdKeyC[] = "BareMetal.UvscServerProvider.DeviceVendorId";
|
||||
constexpr char deviceSvdKeyC[] = "BareMetal.UvscServerProvider.DeviceSVD";
|
||||
constexpr char deviceNameKeyC[] = "DeviceName";
|
||||
constexpr char deviceDescrKeyC[] = "DeviceDescription";
|
||||
constexpr char deviceFamilyKeyC[] = "DeviceFamily";
|
||||
constexpr char deviceSubFamilyKeyC[] = "DeviceSubFamily";
|
||||
constexpr char deviceVendorNameKeyC[] = "DeviceVendorName";
|
||||
constexpr char deviceVendorIdKeyC[] = "DeviceVendorId";
|
||||
constexpr char deviceSvdKeyC[] = "DeviceSVD";
|
||||
// Device CPU data keys.
|
||||
constexpr char deviceClockKeyC[] = "BareMetal.UvscServerProvider.DeviceClock";
|
||||
constexpr char deviceCoreKeyC[] = "BareMetal.UvscServerProvider.DeviceCore";
|
||||
constexpr char deviceFpuKeyC[] = "BareMetal.UvscServerProvider.DeviceFPU";
|
||||
constexpr char deviceMpuKeyC[] = "BareMetal.UvscServerProvider.DeviceMPU";
|
||||
constexpr char deviceClockKeyC[] = "DeviceClock";
|
||||
constexpr char deviceCoreKeyC[] = "DeviceCore";
|
||||
constexpr char deviceFpuKeyC[] = "DeviceFPU";
|
||||
constexpr char deviceMpuKeyC[] = "DeviceMPU";
|
||||
// Device MEMORY data keys.
|
||||
constexpr char deviceMemoryKeyC[] = "BareMetal.UvscServerProvider.DeviceMemory";
|
||||
constexpr char deviceMemoryIdKeyC[] = "BareMetal.UvscServerProvider.DeviceMemoryId";
|
||||
constexpr char deviceMemoryStartKeyC[] = "BareMetal.UvscServerProvider.DeviceMemoryStart";
|
||||
constexpr char deviceMemorySizeKeyC[] = "BareMetal.UvscServerProvider.DeviceMemorySize";
|
||||
constexpr char deviceMemoryKeyC[] = "DeviceMemory";
|
||||
constexpr char deviceMemoryIdKeyC[] = "DeviceMemoryId";
|
||||
constexpr char deviceMemoryStartKeyC[] = "DeviceMemoryStart";
|
||||
constexpr char deviceMemorySizeKeyC[] = "DeviceMemorySize";
|
||||
// Device ALGORITHM data keys.
|
||||
constexpr char deviceAlgorithmKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithm";
|
||||
constexpr char deviceAlgorithmPathKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmPath";
|
||||
constexpr char deviceAlgorithmFlashStartKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmStart";
|
||||
constexpr char deviceAlgorithmFlashSizeKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmSize";
|
||||
constexpr char deviceAlgorithmRamStartKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmRamStart";
|
||||
constexpr char deviceAlgorithmRamSizeKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmRamSize";
|
||||
constexpr char deviceAlgorithmIndexKeyC[] = "BareMetal.UvscServerProvider.DeviceAlgorithmIndex";
|
||||
constexpr char deviceAlgorithmKeyC[] = "DeviceAlgorithm";
|
||||
constexpr char deviceAlgorithmPathKeyC[] = "DeviceAlgorithmPath";
|
||||
constexpr char deviceAlgorithmFlashStartKeyC[] = "DeviceAlgorithmStart";
|
||||
constexpr char deviceAlgorithmFlashSizeKeyC[] = "DeviceAlgorithmSize";
|
||||
constexpr char deviceAlgorithmRamStartKeyC[] = "DeviceAlgorithmRamStart";
|
||||
constexpr char deviceAlgorithmRamSizeKeyC[] = "DeviceAlgorithmRamSize";
|
||||
constexpr char deviceAlgorithmIndexKeyC[] = "DeviceAlgorithmIndex";
|
||||
|
||||
// DeviceSelection
|
||||
|
||||
|
@@ -36,11 +36,11 @@ namespace Internal {
|
||||
namespace Uv {
|
||||
|
||||
// Driver data keys.
|
||||
constexpr char driverIndexKeyC[] = "BareMetal.UvscServerProvider.DriverIndex";
|
||||
constexpr char driverCpuDllIndexKeyC[] = "BareMetal.UvscServerProvider.DriverCpuDllIndex";
|
||||
constexpr char driverDllKeyC[] = "BareMetal.UvscServerProvider.DriverDll";
|
||||
constexpr char driverCpuDllsKeyC[] = "BareMetal.UvscServerProvider.DriverCpuDlls";
|
||||
constexpr char driverNameKeyC[] = "BareMetal.UvscServerProvider.DriverName";
|
||||
constexpr char driverIndexKeyC[] = "DriverIndex";
|
||||
constexpr char driverCpuDllIndexKeyC[] = "DriverCpuDllIndex";
|
||||
constexpr char driverDllKeyC[] = "DriverDll";
|
||||
constexpr char driverCpuDllsKeyC[] = "DriverCpuDlls";
|
||||
constexpr char driverNameKeyC[] = "DriverName";
|
||||
|
||||
// DriverSelection
|
||||
|
||||
|
@@ -58,9 +58,9 @@ namespace Internal {
|
||||
|
||||
// Helpers:
|
||||
|
||||
static const char compilerCommandKeyC[] = "BareMetal.IarToolChain.CompilerPath";
|
||||
static const char compilerPlatformCodeGenFlagsKeyC[] = "BareMetal.IarToolChain.PlatformCodeGenFlags";
|
||||
static const char targetAbiKeyC[] = "BareMetal.IarToolChain.TargetAbi";
|
||||
static const char compilerCommandKeyC[] = "CompilerPath";
|
||||
static const char compilerPlatformCodeGenFlagsKeyC[] = "PlatformCodeGenFlags";
|
||||
static const char targetAbiKeyC[] = "TargetAbi";
|
||||
|
||||
static bool compilerExists(const FilePath &compilerPath)
|
||||
{
|
||||
|
@@ -43,12 +43,12 @@ using namespace ProjectExplorer;
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
const char idKeyC[] = "BareMetal.IDebugServerProvider.Id";
|
||||
const char displayNameKeyC[] = "BareMetal.IDebugServerProvider.DisplayName";
|
||||
const char engineTypeKeyC[] = "BareMetal.IDebugServerProvider.EngineType";
|
||||
const char idKeyC[] = "Id";
|
||||
const char displayNameKeyC[] = "DisplayName";
|
||||
const char engineTypeKeyC[] = "EngineType";
|
||||
|
||||
const char hostKeySuffixC[] = ".Host";
|
||||
const char portKeySuffixC[] = ".Port";
|
||||
const char hostKeyC[] = "Host";
|
||||
const char portKeyC[] = "Port";
|
||||
|
||||
static QString createId(const QString &id)
|
||||
{
|
||||
@@ -139,11 +139,6 @@ void IDebugServerProvider::setEngineType(DebuggerEngineType engineType)
|
||||
providerUpdated();
|
||||
}
|
||||
|
||||
void IDebugServerProvider::setSettingsKeyBase(const QString &settingsBase)
|
||||
{
|
||||
m_settingsBase = settingsBase;
|
||||
}
|
||||
|
||||
bool IDebugServerProvider::operator==(const IDebugServerProvider &other) const
|
||||
{
|
||||
if (this == &other)
|
||||
@@ -170,8 +165,8 @@ QVariantMap IDebugServerProvider::toMap() const
|
||||
{idKeyC, m_id},
|
||||
{displayNameKeyC, m_displayName},
|
||||
{engineTypeKeyC, m_engineType},
|
||||
{m_settingsBase + hostKeySuffixC, m_channel.host()},
|
||||
{m_settingsBase + portKeySuffixC, m_channel.port()},
|
||||
{hostKeyC, m_channel.host()},
|
||||
{portKeyC, m_channel.port()},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -201,8 +196,8 @@ bool IDebugServerProvider::fromMap(const QVariantMap &data)
|
||||
m_displayName = data.value(displayNameKeyC).toString();
|
||||
m_engineType = static_cast<DebuggerEngineType>(
|
||||
data.value(engineTypeKeyC, NoEngineType).toInt());
|
||||
m_channel.setHost(data.value(m_settingsBase + hostKeySuffixC).toString());
|
||||
m_channel.setPort(data.value(m_settingsBase + portKeySuffixC).toInt());
|
||||
m_channel.setHost(data.value(hostKeyC).toString());
|
||||
m_channel.setPort(data.value(portKeyC).toInt());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -238,9 +233,7 @@ IDebugServerProvider *IDebugServerProviderFactory::create() const
|
||||
IDebugServerProvider *IDebugServerProviderFactory::restore(const QVariantMap &data) const
|
||||
{
|
||||
IDebugServerProvider *p = m_creator();
|
||||
const auto updated = data;
|
||||
|
||||
if (p->fromMap(updated))
|
||||
if (p->fromMap(data))
|
||||
return p;
|
||||
delete p;
|
||||
return nullptr;
|
||||
|
@@ -104,7 +104,6 @@ public:
|
||||
protected:
|
||||
void setTypeDisplayName(const QString &typeDisplayName);
|
||||
void setEngineType(Debugger::DebuggerEngineType engineType);
|
||||
void setSettingsKeyBase(const QString &settingsBase);
|
||||
|
||||
void providerUpdated();
|
||||
void resetId();
|
||||
@@ -112,7 +111,6 @@ protected:
|
||||
QString m_id;
|
||||
mutable QString m_displayName;
|
||||
QString m_typeDisplayName;
|
||||
QString m_settingsBase;
|
||||
QUrl m_channel;
|
||||
Debugger::DebuggerEngineType m_engineType = Debugger::NoEngineType;
|
||||
QSet<BareMetalDevice *> m_devices;
|
||||
|
@@ -60,9 +60,9 @@ namespace Internal {
|
||||
|
||||
// Helpers:
|
||||
|
||||
static const char compilerCommandKeyC[] = "BareMetal.KeilToolchain.CompilerPath";
|
||||
static const char compilerPlatformCodeGenFlagsKeyC[] = "BareMetal.KeilToolchain.PlatformCodeGenFlags";
|
||||
static const char targetAbiKeyC[] = "BareMetal.KeilToolchain.TargetAbi";
|
||||
static const char compilerCommandKeyC[] = "CompilerPath";
|
||||
static const char compilerPlatformCodeGenFlagsKeyC[] = "PlatformCodeGenFlags";
|
||||
static const char targetAbiKeyC[] = "TargetAbi";
|
||||
|
||||
static bool compilerExists(const FilePath &compilerPath)
|
||||
{
|
||||
|
@@ -58,8 +58,8 @@ namespace Internal {
|
||||
|
||||
// Helpers:
|
||||
|
||||
static const char compilerCommandKeyC[] = "BareMetal.SdccToolChain.CompilerPath";
|
||||
static const char targetAbiKeyC[] = "BareMetal.SdccToolChain.TargetAbi";
|
||||
static const char compilerCommandKeyC[] = "CompilerPath";
|
||||
static const char targetAbiKeyC[] = "TargetAbi";
|
||||
|
||||
static bool compilerExists(const FilePath &compilerPath)
|
||||
{
|
||||
|
@@ -121,7 +121,7 @@ AnalyzeUnit::AnalyzeUnit(const FileInfo &fileInfo,
|
||||
{
|
||||
CompilerOptionsBuilder optionsBuilder(*fileInfo.projectPart,
|
||||
UseSystemHeader::No,
|
||||
UseTweakedHeaderPaths::Yes,
|
||||
UseTweakedHeaderPaths::Tools,
|
||||
UseLanguageDefines::No,
|
||||
UseBuildSystemWarnings::No,
|
||||
clangVersion,
|
||||
|
@@ -629,8 +629,10 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||
const Diagnostic &diag = diagnosticItem->diagnostic();
|
||||
|
||||
// Filtered out?
|
||||
if (m_filterOptions && !m_filterOptions->checks.contains(diag.name))
|
||||
if (m_filterOptions && !m_filterOptions->checks.contains(diag.name)) {
|
||||
diagnosticItem->textMark()->setVisible(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Explicitly suppressed?
|
||||
foreach (const SuppressedDiagnostic &d, m_suppressedDiagnostics) {
|
||||
@@ -640,10 +642,12 @@ bool DiagnosticFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
|
||||
QFileInfo fi(filePath);
|
||||
if (fi.isRelative())
|
||||
filePath = m_lastProjectDirectory.toString() + QLatin1Char('/') + filePath;
|
||||
if (filePath == diag.location.filePath)
|
||||
if (filePath == diag.location.filePath) {
|
||||
diagnosticItem->textMark()->setVisible(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
diagnosticItem->textMark()->setVisible(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -74,6 +74,7 @@ public:
|
||||
~DiagnosticItem() override;
|
||||
|
||||
const Diagnostic &diagnostic() const { return m_diagnostic; }
|
||||
TextEditor::TextMark *textMark() { return m_mark; }
|
||||
|
||||
FixitStatus fixItStatus() const { return m_fixitStatus; }
|
||||
void setFixItStatus(const FixitStatus &status);
|
||||
|
@@ -232,12 +232,14 @@ void DiagnosticView::goNext()
|
||||
{
|
||||
const QModelIndex currentIndex = selectionModel()->currentIndex();
|
||||
selectIndex(getIndex(currentIndex, Next));
|
||||
openEditorForCurrentIndex();
|
||||
}
|
||||
|
||||
void DiagnosticView::goBack()
|
||||
{
|
||||
const QModelIndex currentIndex = selectionModel()->currentIndex();
|
||||
selectIndex(getIndex(currentIndex, Previous));
|
||||
openEditorForCurrentIndex();
|
||||
}
|
||||
|
||||
QModelIndex DiagnosticView::getIndex(const QModelIndex &index, Direction direction) const
|
||||
|
@@ -69,7 +69,7 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="topicsResetButton">
|
||||
<property name="text">
|
||||
<string>Reset to All</string>
|
||||
<string>Reset Filter</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@@ -199,13 +199,6 @@ static bool needsLink(ProjectExplorer::Tree *node) {
|
||||
return !node->isDir && !node->fullPath.toString().startsWith("clang-analyzer-");
|
||||
}
|
||||
|
||||
static void selectAll(QAbstractItemView *view)
|
||||
{
|
||||
view->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
view->selectAll();
|
||||
view->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
}
|
||||
|
||||
class BaseChecksTreeModel : public ProjectExplorer::SelectableFilesModel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -628,7 +621,7 @@ public:
|
||||
const auto *node = ClazyChecksTree::fromIndex(index);
|
||||
if (node->kind == ClazyChecksTree::CheckNode) {
|
||||
const QStringList topics = node->check.topics;
|
||||
return Utils::anyOf(m_topics, [topics](const QString &topic) {
|
||||
return m_topics.isEmpty() || Utils::anyOf(m_topics, [topics](const QString &topic) {
|
||||
return topics.contains(topic);
|
||||
});
|
||||
}
|
||||
@@ -717,8 +710,9 @@ DiagnosticConfigsWidget::DiagnosticConfigsWidget(const ClangDiagnosticConfigs &c
|
||||
topicsModel->sort(0);
|
||||
m_clazyChecks->topicsView->setModel(topicsModel);
|
||||
connect(m_clazyChecks->topicsResetButton, &QPushButton::clicked, [this](){
|
||||
selectAll(m_clazyChecks->topicsView);
|
||||
m_clazyChecks->topicsView->clearSelection();
|
||||
});
|
||||
m_clazyChecks->topicsView->setSelectionMode(QAbstractItemView::MultiSelection);
|
||||
connect(m_clazyChecks->topicsView->selectionModel(),
|
||||
&QItemSelectionModel::selectionChanged,
|
||||
[this, topicsModel](const QItemSelection &, const QItemSelection &) {
|
||||
@@ -731,7 +725,6 @@ DiagnosticConfigsWidget::DiagnosticConfigsWidget(const ClangDiagnosticConfigs &c
|
||||
this->syncClazyChecksGroupBox();
|
||||
});
|
||||
|
||||
selectAll(m_clazyChecks->topicsView);
|
||||
connect(m_clazyChecks->checksView,
|
||||
&QTreeView::clicked,
|
||||
[model = m_clazySortFilterProxyModel](const QModelIndex &index) {
|
||||
@@ -866,7 +859,7 @@ void DiagnosticConfigsWidget::syncClazyWidgets(const ClangDiagnosticConfig &conf
|
||||
const bool enabled = !config.isReadOnly();
|
||||
m_clazyChecks->topicsResetButton->setEnabled(enabled);
|
||||
m_clazyChecks->enableLowerLevelsCheckBox->setEnabled(enabled);
|
||||
selectAll(m_clazyChecks->topicsView);
|
||||
m_clazyChecks->topicsView->clearSelection();
|
||||
m_clazyChecks->topicsView->setEnabled(enabled);
|
||||
m_clazyTreeModel->setEnabled(enabled);
|
||||
|
||||
|
@@ -194,6 +194,9 @@ void DocumentClangToolRunner::run()
|
||||
const RunSettings &runSettings = projectSettings->useGlobalSettings()
|
||||
? ClangToolsSettings::instance()->runSettings()
|
||||
: projectSettings->runSettings();
|
||||
|
||||
m_suppressed = projectSettings->suppressedDiagnostics();
|
||||
m_lastProjectDirectory = project->projectDirectory();
|
||||
m_projectSettingsUpdate = connect(projectSettings.data(),
|
||||
&ClangToolsProjectSettings::changed,
|
||||
this,
|
||||
@@ -293,6 +296,9 @@ void DocumentClangToolRunner::onSuccess()
|
||||
TextEditor::RefactorMarkers markers;
|
||||
|
||||
for (const Diagnostic &diagnostic : diagnostics) {
|
||||
if (isSuppressed(diagnostic))
|
||||
continue;
|
||||
|
||||
auto mark = new DiagnosticMark(diagnostic);
|
||||
mark->source = m_currentRunner->name();
|
||||
|
||||
@@ -351,6 +357,20 @@ void DocumentClangToolRunner::cancel()
|
||||
}
|
||||
}
|
||||
|
||||
bool DocumentClangToolRunner::isSuppressed(const Diagnostic &diagnostic) const
|
||||
{
|
||||
auto equalsSuppressed = [this, &diagnostic](const SuppressedDiagnostic &suppressed) {
|
||||
if (suppressed.description != diagnostic.description)
|
||||
return false;
|
||||
QString filePath = suppressed.filePath.toString();
|
||||
QFileInfo fi(filePath);
|
||||
if (fi.isRelative())
|
||||
filePath = m_lastProjectDirectory.toString() + QLatin1Char('/') + filePath;
|
||||
return filePath == diagnostic.location.filePath;
|
||||
};
|
||||
return Utils::anyOf(m_suppressed, equalsSuppressed);
|
||||
}
|
||||
|
||||
const CppTools::ClangDiagnosticConfig DocumentClangToolRunner::getDiagnosticConfig(ProjectExplorer::Project *project)
|
||||
{
|
||||
const auto projectSettings = ClangToolsProjectSettings::getSettings(project);
|
||||
|
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "clangfileinfo.h"
|
||||
#include "clangtoolsdiagnostic.h"
|
||||
#include "clangtoolsprojectsettings.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/temporarydirectory.h>
|
||||
@@ -67,6 +68,7 @@ private:
|
||||
|
||||
void cancel();
|
||||
|
||||
bool isSuppressed(const Diagnostic &diagnostic) const;
|
||||
|
||||
const CppTools::ClangDiagnosticConfig getDiagnosticConfig(ProjectExplorer::Project *project);
|
||||
template<class T>
|
||||
@@ -82,6 +84,8 @@ private:
|
||||
FileInfo m_fileInfo;
|
||||
QMetaObject::Connection m_projectSettingsUpdate;
|
||||
QSet<TextEditor::TextEditorWidget *> m_editorsWithMarkers;
|
||||
SuppressedDiagnosticsList m_suppressed;
|
||||
Utils::FilePath m_lastProjectDirectory;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -1650,62 +1650,91 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
|
||||
if (acceptedEditors.isEmpty())
|
||||
return false;
|
||||
|
||||
QList<EditorView*> closedViews;
|
||||
EditorView *focusView = nullptr;
|
||||
|
||||
// remove the editors
|
||||
foreach (IEditor *editor, acceptedEditors) {
|
||||
emit m_instance->editorAboutToClose(editor);
|
||||
if (!editor->document()->filePath().isEmpty()
|
||||
&& !editor->document()->isTemporary()) {
|
||||
// save editor states
|
||||
for (IEditor *editor : qAsConst(acceptedEditors)) {
|
||||
if (!editor->document()->filePath().isEmpty() && !editor->document()->isTemporary()) {
|
||||
QByteArray state = editor->saveState();
|
||||
if (!state.isEmpty())
|
||||
d->m_editorStates.insert(editor->document()->filePath().toString(), QVariant(state));
|
||||
}
|
||||
}
|
||||
|
||||
EditorView *focusView = nullptr;
|
||||
|
||||
// Remove accepted editors from document model/manager and context list,
|
||||
// and sort them per view, so we can remove them from views in an orderly
|
||||
// manner.
|
||||
QMultiHash<EditorView *, IEditor *> editorsPerView;
|
||||
for (IEditor *editor : qAsConst(acceptedEditors)) {
|
||||
emit m_instance->editorAboutToClose(editor);
|
||||
removeEditor(editor, flag != CloseFlag::Suspend);
|
||||
if (EditorView *view = viewForEditor(editor)) {
|
||||
if (QApplication::focusWidget() && QApplication::focusWidget() == editor->widget()->focusWidget())
|
||||
editorsPerView.insert(view, editor);
|
||||
if (QApplication::focusWidget()
|
||||
&& QApplication::focusWidget() == editor->widget()->focusWidget()) {
|
||||
focusView = view;
|
||||
if (editor == view->currentEditor())
|
||||
closedViews += view;
|
||||
if (d->m_currentEditor == editor) {
|
||||
// avoid having a current editor without view
|
||||
setCurrentView(view);
|
||||
setCurrentEditor(nullptr);
|
||||
}
|
||||
view->removeEditor(editor);
|
||||
}
|
||||
}
|
||||
QTC_CHECK(!focusView || focusView == currentView);
|
||||
|
||||
// TODO doesn't work as expected with multiple areas in main window and some other cases
|
||||
// instead each view should have its own file history and handle solely themselves
|
||||
// which editor is shown if their current editor closes
|
||||
EditorView *forceViewToShowEditor = nullptr;
|
||||
if (!closedViews.isEmpty() && EditorManager::visibleEditors().isEmpty()) {
|
||||
if (closedViews.contains(currentView))
|
||||
forceViewToShowEditor = currentView;
|
||||
else
|
||||
forceViewToShowEditor = closedViews.first();
|
||||
}
|
||||
foreach (EditorView *view, closedViews) {
|
||||
IEditor *newCurrent = view->currentEditor();
|
||||
if (!newCurrent && forceViewToShowEditor == view)
|
||||
newCurrent = pickUnusedEditor();
|
||||
if (newCurrent) {
|
||||
activateEditor(view, newCurrent, EditorManager::DoNotChangeCurrentEditor);
|
||||
} else if (forceViewToShowEditor == view) {
|
||||
DocumentModel::Entry *entry = DocumentModelPrivate::firstSuspendedEntry();
|
||||
if (entry) {
|
||||
activateEditorForEntry(view, entry, EditorManager::DoNotChangeCurrentEditor);
|
||||
} else { // no "suspended" ones, so any entry left should have a document
|
||||
const QList<DocumentModel::Entry *> documents = DocumentModel::entries();
|
||||
if (!documents.isEmpty()) {
|
||||
if (IDocument *document = documents.last()->document) {
|
||||
activateEditorForDocument(view, document, EditorManager::DoNotChangeCurrentEditor);
|
||||
// Go through views, remove the editors from them.
|
||||
// Sort such that views for which the current editor is closed come last,
|
||||
// and if the global current view is one of them, that comes very last.
|
||||
// When handling the last view in the list we handle the case where all
|
||||
// visible editors are closed, and we need to e.g. revive an invisible or
|
||||
// a suspended editor
|
||||
QList<EditorView *> views = editorsPerView.keys();
|
||||
Utils::sort(views, [editorsPerView, currentView](EditorView *a, EditorView *b) {
|
||||
if (a == b)
|
||||
return false;
|
||||
const bool aHasCurrent = editorsPerView.values(a).contains(a->currentEditor());
|
||||
const bool bHasCurrent = editorsPerView.values(b).contains(b->currentEditor());
|
||||
const bool aHasGlobalCurrent = (a == currentView && aHasCurrent);
|
||||
const bool bHasGlobalCurrent = (b == currentView && bHasCurrent);
|
||||
if (bHasGlobalCurrent && !aHasGlobalCurrent)
|
||||
return true;
|
||||
if (bHasCurrent && !aHasCurrent)
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
for (EditorView *view : qAsConst(views)) {
|
||||
QList<IEditor *> editors = editorsPerView.values(view);
|
||||
// handle current editor in view last
|
||||
IEditor *viewCurrentEditor = view->currentEditor();
|
||||
if (editors.contains(viewCurrentEditor) && editors.last() != viewCurrentEditor) {
|
||||
editors.removeAll(viewCurrentEditor);
|
||||
editors.append(viewCurrentEditor);
|
||||
}
|
||||
for (IEditor *editor : qAsConst(editors)) {
|
||||
if (editor == viewCurrentEditor && view == views.last()) {
|
||||
// Avoid removing the globally current editor from its view,
|
||||
// set a new current editor before.
|
||||
const EditorManager::OpenEditorFlags flags = view != currentView
|
||||
? EditorManager::DoNotChangeCurrentEditor
|
||||
: EditorManager::NoFlags;
|
||||
const QList<IEditor *> viewEditors = view->editors();
|
||||
IEditor *newCurrent = viewEditors.size() > 1 ? viewEditors.at(viewEditors.size() - 2)
|
||||
: nullptr;
|
||||
if (!newCurrent)
|
||||
newCurrent = pickUnusedEditor();
|
||||
if (newCurrent) {
|
||||
activateEditor(view, newCurrent, flags);
|
||||
} else {
|
||||
DocumentModel::Entry *entry = DocumentModelPrivate::firstSuspendedEntry();
|
||||
if (entry) {
|
||||
activateEditorForEntry(view, entry, flags);
|
||||
} else { // no "suspended" ones, so any entry left should have a document
|
||||
const QList<DocumentModel::Entry *> documents = DocumentModel::entries();
|
||||
if (!documents.isEmpty()) {
|
||||
if (IDocument *document = documents.last()->document) {
|
||||
activateEditorForDocument(view, document, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
view->removeEditor(editor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -190,6 +190,7 @@ private slots:
|
||||
void test_quickfix_MoveFuncDefOutside_respectWsInOperatorNames2();
|
||||
void test_quickfix_MoveFuncDefOutside_macroUses();
|
||||
void test_quickfix_MoveFuncDefOutside_template();
|
||||
void test_quickfix_MoveFuncDefOutside_unnamedTemplate();
|
||||
|
||||
void test_quickfix_MoveAllFuncDefOutside_MemberFuncToCpp();
|
||||
void test_quickfix_MoveAllFuncDefOutside_MemberFuncOutside();
|
||||
|
@@ -383,6 +383,32 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_basic1_enum class")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" @switch (t) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" switch (t) {\n"
|
||||
" case EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: All enum values are added as case statements for a blank switch when
|
||||
// the variable is declared alongside the enum definition.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_basic1_enum_with_declaration")
|
||||
@@ -408,6 +434,30 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_basic1_enum_with_declaration_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class EnumType { V1, V2 } t;\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" @switch (t) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class EnumType { V1, V2 } t;\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" switch (t) {\n"
|
||||
" case EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: All enum values are added as case statements for a blank switch
|
||||
// for anonymous enums.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_basic1_anonymous_enum")
|
||||
@@ -463,6 +513,36 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_basic2_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" @switch (t) {\n"
|
||||
" default:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" switch (t) {\n"
|
||||
" case EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" default:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Enum type in class is found.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_enumTypeInClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -485,6 +565,28 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_enumClassInClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"struct C { enum class EnumType { V1, V2 }; };\n"
|
||||
"\n"
|
||||
"void f(C::EnumType t) {\n"
|
||||
" @switch (t) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"struct C { enum class EnumType { V1, V2 }; };\n"
|
||||
"\n"
|
||||
"void f(C::EnumType t) {\n"
|
||||
" switch (t) {\n"
|
||||
" case C::EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case C::EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Enum type in namespace is found.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_enumTypeInNamespace")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -507,6 +609,28 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_enumClassInNamespace")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"namespace N { enum class EnumType { V1, V2 }; };\n"
|
||||
"\n"
|
||||
"void f(N::EnumType t) {\n"
|
||||
" @switch (t) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"namespace N { enum class EnumType { V1, V2 }; };\n"
|
||||
"\n"
|
||||
"void f(N::EnumType t) {\n"
|
||||
" switch (t) {\n"
|
||||
" case N::EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case N::EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: The missing enum value is added.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_oneValueMissing")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -539,6 +663,38 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_oneValueMissing_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" @switch (t) {\n"
|
||||
" case EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" default:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class EnumType { V1, V2 };\n"
|
||||
"\n"
|
||||
"void f()\n"
|
||||
"{\n"
|
||||
" EnumType t;\n"
|
||||
" switch (t) {\n"
|
||||
" case EnumType::V1:\n"
|
||||
" break;\n"
|
||||
" case EnumType::V2:\n"
|
||||
" break;\n"
|
||||
" default:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Find the correct enum type despite there being a declaration with the same name.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG10366_1")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -563,6 +719,30 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG10366_1_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class test { TEST_1, TEST_2 };\n"
|
||||
"\n"
|
||||
"void f() {\n"
|
||||
" enum test test;\n"
|
||||
" @switch (test) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class test { TEST_1, TEST_2 };\n"
|
||||
"\n"
|
||||
"void f() {\n"
|
||||
" enum test test;\n"
|
||||
" switch (test) {\n"
|
||||
" case test::TEST_1:\n"
|
||||
" break;\n"
|
||||
" case test::TEST_2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Find the correct enum type despite there being a declaration with the same name.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG10366_2")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -591,6 +771,34 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG10366_2_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class test1 { Wrong11, Wrong12 };\n"
|
||||
"enum class test { Right1, Right2 };\n"
|
||||
"enum class test2 { Wrong21, Wrong22 };\n"
|
||||
"\n"
|
||||
"int main() {\n"
|
||||
" enum test test;\n"
|
||||
" @switch (test) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class test1 { Wrong11, Wrong12 };\n"
|
||||
"enum class test { Right1, Right2 };\n"
|
||||
"enum class test2 { Wrong21, Wrong22 };\n"
|
||||
"\n"
|
||||
"int main() {\n"
|
||||
" enum test test;\n"
|
||||
" switch (test) {\n"
|
||||
" case test::Right1:\n"
|
||||
" break;\n"
|
||||
" case test::Right2:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: Do not crash on incomplete case statetement.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_doNotCrashOnIncompleteCase")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -606,6 +814,21 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
""
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_doNotCrashOnIncompleteCase_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class E {};\n"
|
||||
"void f(E o)\n"
|
||||
"{\n"
|
||||
" @switch (o)\n"
|
||||
" {\n"
|
||||
" case\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
""
|
||||
);
|
||||
|
||||
// Checks: complete switch statement where enum is goes via a template type parameter
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG-24752")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
@@ -632,6 +855,32 @@ void CppEditorPlugin::test_quickfix_data()
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Same as above for enum class.
|
||||
QTest::newRow("CompleteSwitchCaseStatement_QTCREATORBUG-24752_enumClass")
|
||||
<< CppQuickFixFactoryPtr(new CompleteSwitchCaseStatement) << _(
|
||||
"enum class E {A, B};\n"
|
||||
"template<typename T> struct S {\n"
|
||||
" static T theType() { return T(); }\n"
|
||||
"};\n"
|
||||
"int main() {\n"
|
||||
" @switch (S<E>::theType()) {\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
) << _(
|
||||
"enum class E {A, B};\n"
|
||||
"template<typename T> struct S {\n"
|
||||
" static T theType() { return T(); }\n"
|
||||
"};\n"
|
||||
"int main() {\n"
|
||||
" switch (S<E>::theType()) {\n"
|
||||
" case E::A:\n"
|
||||
" break;\n"
|
||||
" case E::B:\n"
|
||||
" break;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
);
|
||||
|
||||
// Checks: No special treatment for reference to non const.
|
||||
|
||||
// Check: Quick fix is not triggered on a member function.
|
||||
@@ -5954,7 +6203,24 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_template()
|
||||
"class Foo { void fu@nc(); };\n"
|
||||
"\n"
|
||||
"template<class T>\n"
|
||||
"void Foo::func() {}\n"; // Should be Foo<T>::func
|
||||
"void Foo<T>::func() {}\n";
|
||||
;
|
||||
|
||||
MoveFuncDefOutside factory;
|
||||
QuickFixOperationTest(singleDocument(original, expected), &factory);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_unnamedTemplate()
|
||||
{
|
||||
QByteArray original =
|
||||
"template<typename T, typename>\n"
|
||||
"class Foo { void fu@nc() {} };\n";
|
||||
QByteArray expected =
|
||||
"template<typename T, typename>\n"
|
||||
"class Foo { void fu@nc(); };\n"
|
||||
"\n"
|
||||
"template<typename T, typename T2>\n"
|
||||
"void Foo<T, T2>::func() {}\n";
|
||||
;
|
||||
|
||||
MoveFuncDefOutside factory;
|
||||
|
@@ -2770,7 +2770,12 @@ static Enum *findEnum(const QList<LookupItem> &results, const LookupContext &ctx
|
||||
return e;
|
||||
if (const NamedType *namedType = type->asNamedType()) {
|
||||
if (ClassOrNamespace *con = ctxt.lookupType(namedType->name(), result.scope())) {
|
||||
const QList<Enum *> enums = con->unscopedEnums();
|
||||
QList<Enum *> enums = con->unscopedEnums();
|
||||
const QList<Symbol *> symbols = con->symbols();
|
||||
for (Symbol * const s : symbols) {
|
||||
if (const auto e = s->asEnum())
|
||||
enums << e;
|
||||
}
|
||||
const Name *referenceName = namedType->name();
|
||||
if (const QualifiedNameId *qualifiedName = referenceName->asQualifiedNameId())
|
||||
referenceName = qualifiedName->name();
|
||||
@@ -6457,6 +6462,7 @@ QString definitionSignature(const CppQuickFixInterface *assist,
|
||||
oo.showReturnTypes = true;
|
||||
oo.showArgumentNames = true;
|
||||
oo.showEnclosingTemplate = true;
|
||||
oo.showTemplateParameters = true;
|
||||
const Name *name = func->name();
|
||||
if (name && nameIncludesOperatorName(name)) {
|
||||
CoreDeclaratorAST *coreDeclarator = functionDefinitionAST->declarator->core_declarator;
|
||||
|
@@ -298,7 +298,8 @@ void CompilerOptionsBuilder::enableExceptions()
|
||||
|
||||
void CompilerOptionsBuilder::insertWrappedQtHeaders()
|
||||
{
|
||||
insertWrappedHeaders(wrappedQtHeadersIncludePath());
|
||||
if (m_useTweakedHeaderPaths == UseTweakedHeaderPaths::Yes)
|
||||
insertWrappedHeaders(wrappedQtHeadersIncludePath());
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::insertWrappedMingwHeaders()
|
||||
|
@@ -33,7 +33,7 @@ namespace CppTools {
|
||||
|
||||
enum class UsePrecompiledHeaders : char { Yes, No };
|
||||
enum class UseSystemHeader : char { Yes, No };
|
||||
enum class UseTweakedHeaderPaths : char { Yes, No };
|
||||
enum class UseTweakedHeaderPaths : char { Yes, Tools, No };
|
||||
enum class UseToolchainMacros : char { Yes, No };
|
||||
enum class UseLanguageDefines : char { Yes, No };
|
||||
enum class UseBuildSystemWarnings : char { Yes, No };
|
||||
|
@@ -8,6 +8,7 @@ Project {
|
||||
|
||||
QtcPlugin {
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "Qt.testlib"; condition: project.withAutotests }
|
||||
Depends { name: "CPlusPlus" }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
@@ -216,6 +217,15 @@ Project {
|
||||
"usages.h",
|
||||
]
|
||||
|
||||
Group {
|
||||
name: "TestCase"
|
||||
condition: qtc.testsEnabled || project.withAutotests
|
||||
files: [
|
||||
"cpptoolstestcase.cpp",
|
||||
"cpptoolstestcase.h",
|
||||
]
|
||||
}
|
||||
|
||||
Group {
|
||||
name: "Tests"
|
||||
condition: qtc.testsEnabled
|
||||
@@ -230,8 +240,6 @@ Project {
|
||||
"cppsourceprocessertesthelper.cpp",
|
||||
"cppsourceprocessertesthelper.h",
|
||||
"cppsourceprocessor_test.cpp",
|
||||
"cpptoolstestcase.cpp",
|
||||
"cpptoolstestcase.h",
|
||||
"modelmanagertesthelper.cpp",
|
||||
"modelmanagertesthelper.h",
|
||||
"symbolsearcher_test.cpp",
|
||||
|
@@ -164,6 +164,11 @@ void BranchView::refresh(const QString &repository, bool force)
|
||||
m_addButton->setToolTip(tr("Add Branch..."));
|
||||
m_branchView->setEnabled(true);
|
||||
}
|
||||
|
||||
// Do not refresh the model when the view is hidden
|
||||
if (!isVisible())
|
||||
return;
|
||||
|
||||
QString errorMessage;
|
||||
if (!m_model->refresh(m_repository, &errorMessage))
|
||||
VcsBase::VcsOutputWindow::appendError(errorMessage);
|
||||
@@ -174,6 +179,11 @@ void BranchView::refreshCurrentBranch()
|
||||
m_model->refreshCurrentBranch();
|
||||
}
|
||||
|
||||
void BranchView::showEvent(QShowEvent *)
|
||||
{
|
||||
refreshCurrentRepository();
|
||||
}
|
||||
|
||||
QToolButton *BranchView::addButton() const
|
||||
{
|
||||
return m_addButton;
|
||||
|
@@ -65,6 +65,9 @@ public:
|
||||
QAction *m_includeOldEntriesAction = nullptr;
|
||||
QAction *m_includeTagsAction = nullptr;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *) override;
|
||||
|
||||
private:
|
||||
void refreshCurrentRepository();
|
||||
void resizeColumns();
|
||||
|
@@ -1169,7 +1169,7 @@ void Client::handleDiagnostics(const PublishDiagnosticsParams ¶ms)
|
||||
const DocumentUri &uri = params.uri();
|
||||
|
||||
const QList<Diagnostic> &diagnostics = params.diagnostics();
|
||||
m_diagnosticManager.setDiagnostics(uri, params.diagnostics());
|
||||
m_diagnosticManager.setDiagnostics(uri, diagnostics);
|
||||
if (LanguageClientManager::clientForUri(uri) == this) {
|
||||
m_diagnosticManager.showDiagnostics(uri);
|
||||
requestCodeActions(uri, diagnostics);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
@@ -380,8 +381,10 @@ void SectionedProducts::onImageDownloadFinished(QNetworkReply *reply)
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
const QByteArray data = reply->readAll();
|
||||
QPixmap pixmap;
|
||||
if (pixmap.loadFromData(data)) {
|
||||
const QString url = reply->request().url().toString();
|
||||
const QUrl imageUrl = reply->request().url();
|
||||
const QString imageFormat = QFileInfo(imageUrl.fileName()).suffix();
|
||||
if (pixmap.loadFromData(data, imageFormat.toLatin1())) {
|
||||
const QString url = imageUrl.toString();
|
||||
QPixmapCache::insert(url, pixmap.scaled(ProductListModel::defaultImageSize,
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
for (ProductListModel *model : m_productModels.values())
|
||||
|
@@ -183,6 +183,11 @@ add_qtc_plugin(ProjectExplorer
|
||||
xcodebuildparser.cpp xcodebuildparser.h
|
||||
)
|
||||
|
||||
extend_qtc_plugin(ProjectExplorer
|
||||
CONDITION PROJECT_USER_FILE_EXTENSION
|
||||
DEFINES "PROJECT_USER_FILE_EXTENSION=${PROJECT_USER_FILE_EXTENSION}"
|
||||
)
|
||||
|
||||
if (TARGET libclang)
|
||||
set(CLANG_BINDIR "$<TARGET_FILE_DIR:libclang>")
|
||||
endif()
|
||||
|
@@ -661,8 +661,38 @@ void ProjectWindow::activateProjectPanel(Utils::Id panelId)
|
||||
d->activateProjectPanel(panelId);
|
||||
}
|
||||
|
||||
void ProjectWindow::hideEvent(QHideEvent *event)
|
||||
{
|
||||
savePersistentSettings();
|
||||
FancyMainWindow::hideEvent(event);
|
||||
}
|
||||
|
||||
void ProjectWindow::showEvent(QShowEvent *event)
|
||||
{
|
||||
loadPersistentSettings();
|
||||
FancyMainWindow::showEvent(event);
|
||||
}
|
||||
|
||||
ProjectWindow::~ProjectWindow() = default;
|
||||
|
||||
const char PROJECT_WINDOW_KEY[] = "ProjectExplorer.ProjectWindow";
|
||||
|
||||
void ProjectWindow::savePersistentSettings() const
|
||||
{
|
||||
QSettings * const settings = ICore::settings();
|
||||
settings->beginGroup(PROJECT_WINDOW_KEY);
|
||||
saveSettings(settings);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void ProjectWindow::loadPersistentSettings()
|
||||
{
|
||||
QSettings * const settings = ICore::settings();
|
||||
settings->beginGroup(PROJECT_WINDOW_KEY);
|
||||
restoreSettings(settings);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
QSize SelectorDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QSize s = QStyledItemDelegate::sizeHint(option, index);
|
||||
|
@@ -64,6 +64,12 @@ public:
|
||||
void activateProjectPanel(Utils::Id panelId);
|
||||
|
||||
private:
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
void savePersistentSettings() const;
|
||||
void loadPersistentSettings();
|
||||
|
||||
const std::unique_ptr<ProjectWindowPrivate> d;
|
||||
};
|
||||
|
||||
|
@@ -614,7 +614,8 @@ void QMakeStep::userArgumentsChanged()
|
||||
{
|
||||
if (m_ignoreChange)
|
||||
return;
|
||||
qmakeAdditonalArgumentsLineEdit->setText(m_userArgs);
|
||||
if (qmakeAdditonalArgumentsLineEdit)
|
||||
qmakeAdditonalArgumentsLineEdit->setText(m_userArgs);
|
||||
updateAbiWidgets();
|
||||
updateEffectiveQMakeCall();
|
||||
}
|
||||
@@ -723,6 +724,9 @@ bool QMakeStep::isAndroidKit() const
|
||||
|
||||
void QMakeStep::updateAbiWidgets()
|
||||
{
|
||||
if (!abisLabel)
|
||||
return;
|
||||
|
||||
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(target()->kit());
|
||||
if (!qtVersion)
|
||||
return;
|
||||
@@ -762,7 +766,8 @@ void QMakeStep::updateAbiWidgets()
|
||||
|
||||
void QMakeStep::updateEffectiveQMakeCall()
|
||||
{
|
||||
qmakeArgumentsEdit->setPlainText(effectiveQMakeCall());
|
||||
if (qmakeArgumentsEdit)
|
||||
qmakeArgumentsEdit->setPlainText(effectiveQMakeCall());
|
||||
}
|
||||
|
||||
void QMakeStep::recompileMessageBoxFinished(int button)
|
||||
|
@@ -42,7 +42,7 @@ add_qtc_plugin(QmlDesigner
|
||||
|
||||
add_qtc_plugin(assetexporterplugin
|
||||
CONDITION TARGET QmlDesigner
|
||||
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml
|
||||
DEPENDS Core ProjectExplorer QmlDesigner Utils Qt5::Qml Qt5::QuickPrivate
|
||||
PUBLIC_INCLUDES assetexporterplugin
|
||||
SOURCES
|
||||
assetexporterplugin/assetexportdialog.h assetexporterplugin/assetexportdialog.cpp assetexporterplugin/assetexportdialog.ui
|
||||
|
@@ -1,4 +1,5 @@
|
||||
QT *= qml quick core widgets
|
||||
QT += quick-private
|
||||
|
||||
VPATH += $$PWD
|
||||
|
||||
|
@@ -10,6 +10,12 @@ QtcProduct {
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "QmlDesigner" }
|
||||
Depends { name: "Utils" }
|
||||
Depends {
|
||||
name: "Qt"
|
||||
submodules: [
|
||||
"quick-private"
|
||||
]
|
||||
}
|
||||
|
||||
cpp.includePaths: base.concat([
|
||||
"./",
|
||||
|
@@ -28,7 +28,11 @@
|
||||
|
||||
#include <QColor>
|
||||
#include <QFontInfo>
|
||||
#include <QFontMetricsF>
|
||||
#include <QHash>
|
||||
#include <QtMath>
|
||||
|
||||
#include <private/qquicktext_p.h>
|
||||
|
||||
namespace {
|
||||
const QHash<QString, QString> AlignMapping{
|
||||
@@ -86,6 +90,14 @@ QJsonObject TextNodeParser::json(Component &component) const
|
||||
|
||||
textDetails.insert(IsMultilineTag, propertyValue("wrapMode").toString().compare("NoWrap") != 0);
|
||||
|
||||
// Calculate line height in pixels
|
||||
QFontMetricsF fm(font);
|
||||
auto lineHeightMode = propertyValue("lineHeightMode").value<QQuickText::LineHeightMode>();
|
||||
double lineHeight = propertyValue("lineHeight").toDouble();
|
||||
qreal lineHeightPx = (lineHeightMode == QQuickText::FixedHeight) ?
|
||||
lineHeight : qCeil(fm.height()) * lineHeight;
|
||||
textDetails.insert(LineHeightTag, lineHeightPx);
|
||||
|
||||
QJsonObject metadata = jsonObject.value(MetadataTag).toObject();
|
||||
metadata.insert(TextDetailsTag, textDetails);
|
||||
jsonObject.insert(MetadataTag, metadata);
|
||||
|
@@ -34,7 +34,7 @@ namespace ComponentCoreConstants {
|
||||
const char rootCategory[] = "";
|
||||
|
||||
const char selectionCategory[] = "Selection";
|
||||
const char stackCategory[] = "Stack (z)";
|
||||
const char arrangeCategory[] = "Arrange";
|
||||
const char qmlPreviewCategory[] = "QmlPreview";
|
||||
const char editCategory[] = "Edit";
|
||||
const char anchorsCategory[] = "Anchors";
|
||||
@@ -52,6 +52,7 @@ const char toBackCommandId[] = "ToBack";
|
||||
const char raiseCommandId[] = "Raise";
|
||||
const char lowerCommandId[] = "Lower";
|
||||
const char resetZCommandId[] = "ResetZ";
|
||||
const char reverseCommandId[] = "Reverse";
|
||||
const char resetSizeCommandId[] = "ResetSize";
|
||||
const char resetPositionCommandId[] = "ResetPosition";
|
||||
const char visiblityCommandId[] = "ToggleVisiblity";
|
||||
@@ -90,7 +91,7 @@ const char fitSelectionToScreenCommandId[] = "FitSelectionToScreen";
|
||||
const char selectionCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Selection");
|
||||
const char flowConnectionCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Connect");
|
||||
const char selectEffectDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Select Effect");
|
||||
const char stackCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Stack (z)");
|
||||
const char arrangeCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Arrange");
|
||||
const char editCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Edit");
|
||||
const char anchorsCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Anchors");
|
||||
const char positionCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Position");
|
||||
@@ -105,11 +106,11 @@ const char copySelectionDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMen
|
||||
const char pasteSelectionDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Paste");
|
||||
const char deleteSelectionDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Delete Selection");
|
||||
|
||||
const char toFrontDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "To Front");
|
||||
const char toBackDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "To Back");
|
||||
const char toFrontDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Bring to Front");
|
||||
const char toBackDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Send to Back");
|
||||
|
||||
const char raiseDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Raise");
|
||||
const char lowerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Lower");
|
||||
const char raiseDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Bring Forward");
|
||||
const char lowerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Send Backward");
|
||||
|
||||
const char undoDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Undo");
|
||||
const char redoDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Redo");
|
||||
@@ -129,6 +130,8 @@ const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set
|
||||
|
||||
const char resetZDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Reset z Property");
|
||||
|
||||
const char reverseDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Reverse");
|
||||
|
||||
const char anchorsFillDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Fill");
|
||||
const char anchorsResetDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Reset");
|
||||
|
||||
|
@@ -594,6 +594,11 @@ bool selectionHasSameParentAndInBaseState(const SelectionContext &context)
|
||||
return selectionHasSameParent(context) && inBaseState(context);
|
||||
}
|
||||
|
||||
bool multiSelectionAndHasSameParent(const SelectionContext &context)
|
||||
{
|
||||
return multiSelection(context) && selectionHasSameParent(context);
|
||||
}
|
||||
|
||||
bool isNotInLayout(const SelectionContext &context)
|
||||
{
|
||||
if (selectionNotEmpty(context)) {
|
||||
@@ -914,8 +919,8 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
prioritySelectionCategory));
|
||||
|
||||
addDesignerAction(new ActionGroup(
|
||||
stackCategoryDisplayName,
|
||||
stackCategory,
|
||||
arrangeCategoryDisplayName,
|
||||
arrangeCategory,
|
||||
priorityStackCategory,
|
||||
&selectionNotEmpty));
|
||||
|
||||
@@ -923,28 +928,19 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
toFrontCommandId,
|
||||
toFrontDisplayName,
|
||||
{},
|
||||
stackCategory,
|
||||
arrangeCategory,
|
||||
QKeySequence(),
|
||||
200,
|
||||
&toFront,
|
||||
&singleSelection));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
toBackCommandId,
|
||||
toBackDisplayName,
|
||||
{},
|
||||
stackCategory,
|
||||
raiseCommandId,
|
||||
raiseDisplayName,
|
||||
Utils::Icon({{":/qmldesigner/icon/designeractions/images/raise.png", Utils::Theme::IconsBaseColor}}).icon(),
|
||||
arrangeCategory,
|
||||
QKeySequence(),
|
||||
180,
|
||||
&toBack,
|
||||
&singleSelection));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
raiseCommandId, raiseDisplayName,
|
||||
Utils::Icon({{":/qmldesigner/icon/designeractions/images/raise.png", Utils::Theme::IconsBaseColor}}).icon(),
|
||||
stackCategory,
|
||||
QKeySequence(),
|
||||
160,
|
||||
&raise,
|
||||
&raiseAvailable));
|
||||
|
||||
@@ -952,23 +948,31 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
lowerCommandId,
|
||||
lowerDisplayName,
|
||||
Utils::Icon({{":/qmldesigner/icon/designeractions/images/lower.png", Utils::Theme::IconsBaseColor}}).icon(),
|
||||
stackCategory,
|
||||
arrangeCategory,
|
||||
QKeySequence(),
|
||||
140,
|
||||
160,
|
||||
&lower,
|
||||
&lowerAvailable));
|
||||
|
||||
addDesignerAction(new SeperatorDesignerAction(stackCategory, 120));
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
toBackCommandId,
|
||||
toBackDisplayName,
|
||||
{},
|
||||
arrangeCategory,
|
||||
QKeySequence(),
|
||||
140,
|
||||
&toBack,
|
||||
&singleSelection));
|
||||
|
||||
addDesignerAction(new ModelNodeContextMenuAction(
|
||||
resetZCommandId,
|
||||
resetZDisplayName,
|
||||
reverseCommandId,
|
||||
reverseDisplayName,
|
||||
{},
|
||||
stackCategory,
|
||||
arrangeCategory,
|
||||
QKeySequence(),
|
||||
100,
|
||||
&resetZ,
|
||||
&selectionNotEmptyAndHasZProperty));
|
||||
&reverse,
|
||||
&multiSelectionAndHasSameParent));
|
||||
|
||||
addDesignerAction(new ActionGroup(editCategoryDisplayName, editCategory, priorityEditCategory, &selectionNotEmpty));
|
||||
|
||||
@@ -979,7 +983,9 @@ void DesignerActionManager::createDefaultDesignerActions()
|
||||
resetPositionDisplayName,
|
||||
Utils::Icon({{":/utils/images/pan.png", Utils::Theme::IconsBaseColor},
|
||||
{":/utils/images/iconoverlay_reset.png", Utils::Theme::IconsStopToolBarColor}}).icon(),
|
||||
resetPositionTooltip, editCategory, QKeySequence("Ctrl+d"),
|
||||
resetPositionTooltip,
|
||||
editCategory,
|
||||
QKeySequence("Ctrl+d"),
|
||||
200,
|
||||
&resetPosition,
|
||||
&selectionNotEmptyAndHasXorYProperty));
|
||||
|
@@ -206,9 +206,9 @@ void toBack(const SelectionContext &selectionState)
|
||||
}
|
||||
}
|
||||
|
||||
enum OderAction {RaiseItem, LowerItem};
|
||||
enum OrderAction {RaiseItem, LowerItem};
|
||||
|
||||
void changeOrder(const SelectionContext &selectionState, OderAction orderAction)
|
||||
void changeOrder(const SelectionContext &selectionState, OrderAction orderAction)
|
||||
{
|
||||
if (!selectionState.view())
|
||||
return;
|
||||
@@ -221,13 +221,12 @@ void changeOrder(const SelectionContext &selectionState, OderAction orderAction)
|
||||
if (!modelNode.parentProperty().isNodeListProperty())
|
||||
return;
|
||||
|
||||
selectionState.view()->executeInTransaction("DesignerActionManager|raise",[orderAction, selectionState, modelNode](){
|
||||
selectionState.view()->executeInTransaction("DesignerActionManager|changeOrder", [orderAction, selectionState, modelNode]() {
|
||||
ModelNode modelNode = selectionState.currentSingleSelectedNode();
|
||||
NodeListProperty parentProperty = modelNode.parentProperty().toNodeListProperty();
|
||||
const int index = parentProperty.indexOf(modelNode);
|
||||
|
||||
if (orderAction == RaiseItem) {
|
||||
|
||||
if (index < parentProperty.count() - 1)
|
||||
parentProperty.slide(index, index + 1);
|
||||
} else if (orderAction == LowerItem) {
|
||||
@@ -244,7 +243,6 @@ void raise(const SelectionContext &selectionState)
|
||||
|
||||
void lower(const SelectionContext &selectionState)
|
||||
{
|
||||
|
||||
changeOrder(selectionState, LowerItem);
|
||||
}
|
||||
|
||||
@@ -344,8 +342,8 @@ void resetZ(const SelectionContext &selectionState)
|
||||
if (!selectionState.view())
|
||||
return;
|
||||
|
||||
selectionState.view()->executeInTransaction("DesignerActionManager|resetZ",[selectionState](){
|
||||
foreach (ModelNode node, selectionState.selectedModelNodes()) {
|
||||
selectionState.view()->executeInTransaction("DesignerActionManager|resetZ", [selectionState](){
|
||||
for (ModelNode node : selectionState.selectedModelNodes()) {
|
||||
QmlItemNode itemNode(node);
|
||||
if (itemNode.isValid())
|
||||
itemNode.removeProperty("z");
|
||||
@@ -353,6 +351,16 @@ void resetZ(const SelectionContext &selectionState)
|
||||
});
|
||||
}
|
||||
|
||||
void reverse(const SelectionContext &selectionState)
|
||||
{
|
||||
if (!selectionState.view())
|
||||
return;
|
||||
|
||||
selectionState.view()->executeInTransaction("DesignerActionManager|reverse", [selectionState](){
|
||||
NodeListProperty::reverseModelNodes(selectionState.selectedModelNodes());
|
||||
});
|
||||
}
|
||||
|
||||
static inline void backupPropertyAndRemove(const ModelNode &node, const PropertyName &propertyName)
|
||||
{
|
||||
if (node.hasVariantProperty(propertyName)) {
|
||||
@@ -366,7 +374,6 @@ static inline void backupPropertyAndRemove(const ModelNode &node, const Property
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline void restoreProperty(const ModelNode &node, const PropertyName &propertyName)
|
||||
{
|
||||
if (node.hasAuxiliaryData(auxDataString + propertyName))
|
||||
|
@@ -52,6 +52,7 @@ void resetPosition(const SelectionContext &selectionState);
|
||||
void goIntoComponentOperation(const SelectionContext &selectionState);
|
||||
void setId(const SelectionContext &selectionState);
|
||||
void resetZ(const SelectionContext &selectionState);
|
||||
void reverse(const SelectionContext &selectionState);
|
||||
void anchorsFill(const SelectionContext &selectionState);
|
||||
void anchorsReset(const SelectionContext &selectionState);
|
||||
void layoutRowPositioner(const SelectionContext &selectionState);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace DesignTools {
|
||||
namespace QmlDesigner {
|
||||
|
||||
AnimationCurve::AnimationCurve()
|
||||
: m_fromData(false)
|
||||
@@ -395,4 +395,4 @@ void AnimationCurve::analyze()
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace DesignTools.
|
||||
} // End namespace QmlDesigner.
|
||||
|