diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 4682c97bd51..fc19929367c 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -3,7 +3,7 @@ name: CMake Build Matrix on: [push, pull_request] env: - QT_VERSION: 5.15.1 + QT_VERSION: 5.15.2 CLANG_VERSION: 110 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.18.3 @@ -132,7 +132,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading: ${qt_base_url}/Updates.xml\") - file(DOWNLOAD \"${qt_base_url}/Updates.xml\" ./Updates.xml TIMEOUT 60) + file(DOWNLOAD \"${qt_base_url}/Updates.xml\" ./Updates.xml) ") file(SIZE ./Updates.xml fileSize) if (fileSize GREATER 0) @@ -154,7 +154,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading ${url}\") - file(DOWNLOAD \"${url}\" ./${archive} TIMEOUT 60) + file(DOWNLOAD \"${url}\" ./${archive}) ") file(SIZE ./${archive} fileSize) if (fileSize GREATER 0) @@ -234,7 +234,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading ${openssl_base_url}/Updates.xml}\") - file(DOWNLOAD \"${openssl_base_url}/Updates.xml\" ./Updates.xml TIMEOUT 60) + file(DOWNLOAD \"${openssl_base_url}/Updates.xml\" ./Updates.xml) ") file(SIZE ./Updates.xml fileSize) if (fileSize GREATER 0) @@ -258,7 +258,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading ${url}\") - file(DOWNLOAD \"${url}\" ./openssl.7z TIMEOUT 60) + file(DOWNLOAD \"${url}\" ./openssl.7z) ") file(SIZE ./openssl.7z fileSize) if (fileSize GREATER 0) @@ -295,7 +295,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading ${libclang_url}\") - file(DOWNLOAD \"${libclang_url}\" ./libclang.7z TIMEOUT 240) + file(DOWNLOAD \"${libclang_url}\" ./libclang.7z) ") file(SIZE ./libclang.7z fileSize) if (fileSize GREATER 0) @@ -332,7 +332,7 @@ jobs: foreach(qt_mirror $ENV{QT_MIRRORS}) cmake_language(EVAL CODE " message(\"Downloading ${elfutils_url}\") - file(DOWNLOAD \"${elfutils_url}\" ./elfutils.7z TIMEOUT 60) + file(DOWNLOAD \"${elfutils_url}\" ./elfutils.7z) ") file(SIZE ./elfutils.7z fileSize) if (fileSize GREATER 0) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 45ff4d0696e..95c753e254f 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -270,24 +270,6 @@ function(add_qtc_library name) qtc_enable_separate_debug_info(${name} "${IDE_LIBRARY_PATH}") - if (library_type STREQUAL "SHARED") - set(target_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) - if (WIN32) - set(target_suffix ${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}) - set(target_prefix "") - elseif(APPLE) - set(target_suffix .${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}) - else() - set(target_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}.${PROJECT_VERSION_MAJOR}) - endif() - set(lib_dir "${IDE_LIBRARY_PATH}") - if (WIN32) - set(lib_dir "${_DESTINATION}") - endif() - update_cached_list(__QTC_INSTALLED_LIBRARIES - "${lib_dir}/${target_prefix}${name}${target_suffix}") - endif() - if (NAMELINK_OPTION) install(TARGETS ${name} LIBRARY @@ -544,16 +526,6 @@ function(add_qtc_plugin target_name) FILE ${CMAKE_BINARY_DIR}/cmake/${export}Targets.cmake ) endif() - get_target_property(target_suffix ${target_name} SUFFIX) - get_target_property(target_prefix ${target_name} PREFIX) - if (target_suffix STREQUAL "target_suffix-NOTFOUND") - set(target_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX}) - endif() - if (target_prefix STREQUAL "target_prefix-NOTFOUND") - set(target_prefix ${CMAKE_SHARED_LIBRARY_PREFIX}) - endif() - update_cached_list(__QTC_INSTALLED_PLUGINS - "${plugin_dir}/${target_prefix}${target_name}${target_suffix}") endif() endfunction() @@ -754,9 +726,6 @@ function(add_qtc_executable name) endif() qtc_enable_separate_debug_info(${name} "${_DESTINATION}") - - update_cached_list(__QTC_INSTALLED_EXECUTABLES - "${_DESTINATION}/${name}${CMAKE_EXECUTABLE_SUFFIX}") endif() endfunction() diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index a15e19f0d7c..103fa6045a5 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -88,11 +88,8 @@ else() endif () set(__QTC_PLUGINS "" CACHE INTERNAL "*** Internal ***") -set(__QTC_INSTALLED_PLUGINS "" CACHE INTERNAL "*** Internal ***") set(__QTC_LIBRARIES "" CACHE INTERNAL "*** Internal ***") -set(__QTC_INSTALLED_LIBRARIES "" CACHE INTERNAL "*** Internal ***") set(__QTC_EXECUTABLES "" CACHE INTERNAL "*** Internal ***") -set(__QTC_INSTALLED_EXECUTABLES "" CACHE INTERNAL "*** Internal ***") set(__QTC_TESTS "" CACHE INTERNAL "*** Internal ***") function(append_extra_translations target_name) diff --git a/doc/qtcreator/images/icons/canvas-color.png b/doc/qtcreator/images/icons/canvas-color.png new file mode 100644 index 00000000000..edbc90cd2eb Binary files /dev/null and b/doc/qtcreator/images/icons/canvas-color.png differ diff --git a/doc/qtcreator/images/icons/zoomAll.png b/doc/qtcreator/images/icons/zoomAll.png new file mode 100644 index 00000000000..006012384dd Binary files /dev/null and b/doc/qtcreator/images/icons/zoomAll.png differ diff --git a/doc/qtcreator/images/icons/zoomIn.png b/doc/qtcreator/images/icons/zoomIn.png new file mode 100644 index 00000000000..8ffdf73f52a Binary files /dev/null and b/doc/qtcreator/images/icons/zoomIn.png differ diff --git a/doc/qtcreator/images/icons/zoomOut.png b/doc/qtcreator/images/icons/zoomOut.png new file mode 100644 index 00000000000..6d351071869 Binary files /dev/null and b/doc/qtcreator/images/icons/zoomOut.png differ diff --git a/doc/qtcreator/images/icons/zoomSelection.png b/doc/qtcreator/images/icons/zoomSelection.png new file mode 100644 index 00000000000..06cf260833d Binary files /dev/null and b/doc/qtcreator/images/icons/zoomSelection.png differ diff --git a/doc/qtcreator/images/qmldesigner-canvas-color.png b/doc/qtcreator/images/qmldesigner-canvas-color.png new file mode 100644 index 00000000000..af6ce612240 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-canvas-color.png differ diff --git a/doc/qtcreator/images/qmldesigner-zooming.gif b/doc/qtcreator/images/qmldesigner-zooming.gif new file mode 100644 index 00000000000..d8d5beb6b3a Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-zooming.gif differ diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 66be3ccef4c..2610210524e 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -1230,7 +1230,7 @@ \li \c{bitsize(self)} - Returns the size of an object of this type in bits. - \li \c{(alignment(self)} - Returns the required alignment for objects of + \li \c{alignment(self)} - Returns the required alignment for objects of this type in bytes. \li \c{deference(self)} - Returns the dereferences type for pointer @@ -1319,8 +1319,8 @@ \li \c{pointer(self)} - Returns an interpretation of this value as a pointer in the current address space. - \li \c{members(self)} - Returns a list of \c{Dumper.Value} objects - representing the base objects and data members of this value. + \li \c{members(self, includeBases)} - Returns a list of \c{Dumper.Value} + objects representing the base objects and data members of this value. \li \c{dereference(self)} - For values describing pointers, returns the dereferenced value, and \c None otherwise. diff --git a/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc index c7efa1ef8ef..951479b9d01 100644 --- a/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -76,6 +76,35 @@ \uicontrol Properties view. There, you can also enter the value of the \uicontrol Rotation property in degrees. + \section1 Zooming + + You can use the zoom buttons on the toolbar to zoom into and out of + \uicontrol {Form Editor} or select the zoom level as a percentage + from a list. More buttons are availabe for zooming to fit all content + in the view or zooming to fit the currently selected components. + + \image qmldesigner-zooming.gif "Zooming in Form Editor" + + The following table lists the zoom buttons: + + \table + \header + \li Icon + \li Tooltip + \row + \li \inlineimage icons/zoomIn.png + \li Zoom in + \row + \li \inlineimage icons/zoomOut.png + \li Zoom out + \row + \li \inlineimage icons/zoomAll.png + \li Zoom to fit all content + \row + \li \inlineimage icons/zoomSelection.png + \li Zoom to fit the current selection + \endtable + \section1 Snapping to Parent and Sibling Items When you are working on a design, you can use snapping to align @@ -136,6 +165,17 @@ \uicontrol {Qt Quick} > \uicontrol {Qt Quick Designer} and specify the canvas width and height in the \uicontrol Canvas group. + \section1 Setting Canvas Color + + If you set the background of the root item of your component transparent, + the canvas color can make it difficult to see the component you are working + on. To make components more visible, you can select the canvas color in + the \inlineimage icons/canvas-color.png + list. By default, the color is transparent. Setting the canvas color does + not affect the background color of your UI or components in any way. + + \image qmldesigner-canvas-color.png "Transparent canvas color for a transparent component" + \section1 Refreshing the Form Editor Contents When you open QML files in the Design mode, the items in the file are drawn diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp index b9ba3860a35..39bbe73f93a 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5capturepreviewnodeinstanceserver.cpp @@ -62,7 +62,7 @@ CapturedDataCommand::StateData collectStateData(ServerNodeInstance rootNodeInsta CapturedDataCommand::NodeData nodeData; nodeData.nodeId = instance.instanceId(); - nodeData.contentRect = instance.contentItemBoundingRect(); + nodeData.contentRect = instance.boundingRect(); nodeData.sceneTransform = instance.sceneTransform(); auto textProperty = instance.property("text"); if (!textProperty.isNull() && instance.holdsGraphical()) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 483231f905a..f8223319650 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -39,6 +39,16 @@ file(WRITE ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake " \# add module path for special FindQt5.cmake that considers Qt6 too list(APPEND CMAKE_MODULE_PATH \${CMAKE_CURRENT_LIST_DIR}) +\# force plugins to same path naming conventions as Qt Creator +\# otherwise plugins will not be found +if(UNIX AND NOT APPLE) + include(GNUInstallDirs) + set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}) + set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) + set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBEXECDIR}) + set(CMAKE_INSTALL_DATAROOTDIR ${CMAKE_INSTALL_DATAROOTDIR}) +endif() + include(CMakeFindDependencyMacro) find_dependency(Qt5 ${IDE_QT_VERSION_MIN} COMPONENTS Concurrent Core Gui Widgets Core5Compat Network PrintSupport Qml Quick QuickWidgets Sql REQUIRED diff --git a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp index 98f50831747..3902119e8cd 100644 --- a/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp +++ b/src/plugins/clangcodemodel/clangcompletionassistprocessor.cpp @@ -139,15 +139,17 @@ QList ClangCompletionAssistProcessor::toAssistPro considerOnlySignals = CppTools::CppModelManager::instance() ->positionRequiresSignal(m_interface->filePath().toString(), m_content, m_position); } - for (const CodeCompletion &codeCompletion : completions) { - if (considerOnlySignals && codeCompletion.completionKind - != CodeCompletion::SignalCompletionKind) { - continue; - } if (codeCompletion.text.isEmpty()) continue; // It's an OverloadCandidate which has text but no typedText. + if (considerOnlySignals + && codeCompletion.completionKind != CodeCompletion::ClassCompletionKind + && codeCompletion.completionKind != CodeCompletion::NamespaceCompletionKind + && codeCompletion.completionKind != CodeCompletion::SignalCompletionKind) { + continue; + } + // Don't offer symbols that are not accessible here. if (codeCompletion.availability == CodeCompletion::NotAvailable || codeCompletion.availability == CodeCompletion::NotAccessible) { diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index e32e22d8e1f..c77dbfc08e2 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -765,27 +765,29 @@ void ClangCodeCompletionTest::testSignalCompletion_data() QTest::addColumn("customContents"); QTest::addColumn("hits"); + // libclang mis-reports CXCursor_ClassDecl instead of CXCursor_Constructor, so the lists + // below include the class name. QTest::addRow("positive: connect() on QObject class") << QByteArray("int main() { QObject::connect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: connect() on QObject object") << QByteArray("int main() { QObject o; o.connect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: connect() on QObject pointer") << QByteArray("int main() { QObject *o; o->connect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: connect() on QObject rvalue") << QByteArray("int main() { QObject().connect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: connect() on QObject pointer rvalue") << QByteArray("int main() { (new QObject)->connect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: disconnect() on QObject") << QByteArray("int main() { QObject::disconnect(dummy, QObject::") - << QByteArrayList{"aSignal", "anotherSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "QObject"}; QTest::addRow("positive: connect() in member function of derived class") << QByteArray("void DerivedFromQObject::alsoNotASignal() { connect(this, DerivedFromQObject::") - << QByteArrayList{"aSignal", "anotherSignal", "myOwnSignal"}; + << QByteArrayList{"aSignal", "anotherSignal", "myOwnSignal", "QObject", "DerivedFromQObject"}; const QByteArrayList allQObjectFunctions{"aSignal", "anotherSignal", "notASignal", "connect", "disconnect", "QObject", "~QObject", "operator="}; diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 7adebba6c32..664e332cef7 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -743,23 +743,13 @@ void Client::handleCodeActionResponse(const CodeActionRequest::Response &respons void Client::executeCommand(const Command &command) { - using CommandOptions = LanguageServerProtocol::ServerCapabilities::ExecuteCommandOptions; const QString method(ExecuteCommandRequest::methodName); - if (Utils::optional registered = m_dynamicCapabilities.isRegistered(method)) { - if (!registered.value()) - return; - const CommandOptions option(m_dynamicCapabilities.option(method).toObject()); - if (option.isValid(nullptr) && !option.commands().isEmpty() && !option.commands().contains(command.command())) - return; - } else if (Utils::optional option = m_serverCapabilities.executeCommandProvider()) { - if (option->isValid(nullptr) && !option->commands().isEmpty() && !option->commands().contains(command.command())) - return; - } else { - return; - } - - const ExecuteCommandRequest request((ExecuteCommandParams(command))); - sendContent(request); + bool serverSupportsExecuteCommand = m_serverCapabilities.executeCommandProvider().has_value(); + serverSupportsExecuteCommand = m_dynamicCapabilities + .isRegistered(ExecuteCommandRequest::methodName) + .value_or(serverSupportsExecuteCommand); + if (serverSupportsExecuteCommand) + sendContent(ExecuteCommandRequest(ExecuteCommandParams(command))); } static const FormattingOptions formattingOptions(const TextEditor::TabSettings &settings) diff --git a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp index 79058932713..e2104d7ba9b 100644 --- a/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp +++ b/src/plugins/qmlprojectmanager/qmlmultilanguageaspect.cpp @@ -47,7 +47,7 @@ static Utils::FilePath getMultilanguageDatabaseFilePath(ProjectExplorer::Target { if (target) { auto filePath = target->project()->projectDirectory().pathAppended( - "multilanguage-experimental-v2.db"); + "multilanguage-experimental-v3.db"); if (filePath.exists()) return filePath; }