From fc5af03862d117b68a3fb99db083c47b9dd17ff6 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 24 Feb 2021 19:50:39 +0100 Subject: [PATCH 01/20] Bump version to 4.14.2 Change-Id: I792587c71eadf0b2602d73e7fa4be324cc2766cf Reviewed-by: Eike Ziller --- cmake/QtCreatorIDEBranding.cmake | 4 ++-- qbs/modules/qtc/qtc.qbs | 4 ++-- qtcreator_ide_branding.pri | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index a431bb7343d..b9c7f5d4919 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "4.14.1") # The IDE version. +set(IDE_VERSION "4.14.2") # The IDE version. set(IDE_VERSION_COMPAT "4.14.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "4.14.1") # The IDE display version. +set(IDE_VERSION_DISPLAY "4.14.2") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 3c67ce83e51..c64025f67b4 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -4,10 +4,10 @@ import qbs.FileInfo import "qtc.js" as HelperFunctions Module { - property string qtcreator_display_version: '4.14.1' + property string qtcreator_display_version: '4.14.2' property string ide_version_major: '4' property string ide_version_minor: '14' - property string ide_version_release: '1' + property string ide_version_release: '2' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index f9fbc83a83b..614b2c15721 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,6 +1,6 @@ -QTCREATOR_VERSION = 4.14.1 +QTCREATOR_VERSION = 4.14.2 QTCREATOR_COMPAT_VERSION = 4.14.0 -QTCREATOR_DISPLAY_VERSION = 4.14.1 +QTCREATOR_DISPLAY_VERSION = 4.14.2 QTCREATOR_COPYRIGHT_YEAR = 2020 IDE_DISPLAY_NAME = Qt Creator From de04f29198a602491b4195c778ce6a7f98dacf4c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 24 Feb 2021 16:16:19 +0100 Subject: [PATCH 02/20] Squish: Wait for the docs update progress bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I73e80119a7e5a8d09397138d1301154af597f907 Reviewed-by: Robert Löhning --- tests/system/shared/qtcreator.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index 76dbd7071d6..9ecec40a207 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -66,10 +66,12 @@ def startQC(additionalParameters=None, withPreparedSettingsPath=True, closeLinkT appWithOptions.extend(('-platform', 'windows:dialogs=none')) test.log("Starting now: %s" % ' '.join(appWithOptions)) appContext = startApplication(' '.join(appWithOptions)) - if closeLinkToQt: - clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) - if cancelTour: - clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) + if closeLinkToQt or cancelTour: + progressBarWait(3000) # wait for the "Updating documentation" progress bar + if closeLinkToQt: + clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) + if cancelTour: + clickButton(waitForObject(":*Qt Creator.Do Not Show Again_QToolButton")) return appContext; def startedWithoutPluginError(): From f51387fb8eac774c08597bd200d704802f578104 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 23 Feb 2021 15:18:14 +0100 Subject: [PATCH 03/20] Doc: Describe new context menu commands in Type Hierarchy view Users can navigate in the type hierarchy and move to the class definition in the editor. Task-number: QTCREATORBUG-25162 Change-Id: I608538b24a3d6db25a0ed83d743a42e2d133dae4 Reviewed-by: Jarek Kobus --- .../images/qtcreator-type-hierarchy-view.png | Bin 0 -> 3508 bytes doc/qtcreator/src/howto/creator-views.qdoc | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-type-hierarchy-view.png diff --git a/doc/qtcreator/images/qtcreator-type-hierarchy-view.png b/doc/qtcreator/images/qtcreator-type-hierarchy-view.png new file mode 100644 index 0000000000000000000000000000000000000000..d8ad0649588f9c3d419b5d1106803d41ed498a00 GIT binary patch literal 3508 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 f2;5rn%l^0)=Uy=|Ffe$!`njxgN@xNAmQd56 literal 0 HcmV?d00001 diff --git a/doc/qtcreator/src/howto/creator-views.qdoc b/doc/qtcreator/src/howto/creator-views.qdoc index fcbab35d6b2..b74b22b5764 100644 --- a/doc/qtcreator/src/howto/creator-views.qdoc +++ b/doc/qtcreator/src/howto/creator-views.qdoc @@ -327,8 +327,19 @@ \section1 Viewing Type Hierarchy - To view the base classes of a class, right-click the class and select - \uicontrol {Open Type Hierarchy} or press \key {Ctrl+Shift+T}. + To view the base classes and derived classes of a class, right-click the + class in the code editor and select \uicontrol {Open Type Hierarchy} or + press \key {Ctrl+Shift+T}. + + \image qtcreator-type-hierarchy-view.png "Type Hierarchy view" + + To navigate in the type hierarchy, double-click a class or select it, + and then select \uicontrol {Open Type Hierarchy} in the context menu. + The previous class is highlighted in the view. + + The definition of the selected class is opened in the code editor. You + can also select \uicontrol {Open in Editor} in the context menu to open + it. \section1 Viewing Include Hierarchy From 69087a2c4bba58e473c79b4d90c41c6af3c68f43 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 23 Feb 2021 13:02:31 +0200 Subject: [PATCH 04/20] QmlDesigner: Update selected imported node Add context menu item for updating selected 3D node. If selected node is a component created by import, that import is updated. Otherwise if the open document itself is an imported component, update that import. In the latter case, preselect the source file relevant for the selected node. Fixes: QDS-3738 Change-Id: Id678288893f1700648d084ba92df40844d2af0b5 Reviewed-by: Mahmoud Badri Reviewed-by: Thomas Hartmann --- .../componentcore/componentcore_constants.h | 2 + .../componentcore/designeractionmanager.cpp | 11 ++ .../modelnodecontextmenu_helper.cpp | 16 ++ .../modelnodecontextmenu_helper.h | 1 + .../componentcore/modelnodeoperations.cpp | 9 + .../componentcore/modelnodeoperations.h | 1 + .../itemlibraryassetimportdialog.cpp | 178 ++++++++++++++++-- .../itemlibraryassetimportdialog.h | 13 +- .../itemlibrary/itemlibraryassetimporter.cpp | 37 +++- .../itemlibrary/itemlibraryassetimporter.h | 9 +- .../itemlibrary/itemlibraryview.cpp | 14 +- .../components/itemlibrary/itemlibraryview.h | 2 + .../qmldesigner/qmldesignerconstants.h | 3 + 13 files changed, 262 insertions(+), 34 deletions(-) diff --git a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h index ea8bb99f1a1..9477212bb7d 100644 --- a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h +++ b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h @@ -90,6 +90,7 @@ const char fitSelectionToScreenCommandId[] = "FitSelectionToScreen"; const char editAnnotationCommandId[] = "EditAnnotation"; const char openSignalDialogCommandId[] = "OpenSignalDialog"; +const char update3DAssetCommandId[] = "Update3DAsset"; const char selectionCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Selection"); const char flowConnectionCategoryDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Connect"); @@ -131,6 +132,7 @@ const char moveToComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextM const char editAnnotationDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Edit Annotation"); const char openSignalDialogDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Open Signal Dialog"); +const char update3DAssetDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Update 3D Asset"); const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set Id"); diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 02596eaf1f0..cccc108bbb5 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -1412,6 +1412,17 @@ void DesignerActionManager::createDefaultDesignerActions() 66, &openSignalDialog, &singleSelectionAndHasSlotTrigger)); + + addDesignerAction(new ModelNodeContextMenuAction( + update3DAssetCommandId, + update3DAssetDisplayName, + {}, + rootCategory, + QKeySequence(), + priorityGenericToolBar, + &updateImported3DAsset, + &selectionIsImported3DAsset, + &selectionIsImported3DAsset)); } void DesignerActionManager::createDefaultAddResourceHandler() diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp index 195ce608d4c..b7a68890b82 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.cpp @@ -31,6 +31,7 @@ #include #include #include +#include namespace QmlDesigner { @@ -99,6 +100,21 @@ bool selectionIsComponent(const SelectionContext &selectionState) && selectionState.currentSingleSelectedNode().isComponent(); } +bool selectionIsImported3DAsset(const SelectionContext &selectionState) +{ + ModelNode node = selectionState.currentSingleSelectedNode(); + if (selectionState.view() && node.isValid() && node.hasMetaInfo()) { + QString fileName = node.metaInfo().componentFileName(); // absolute path + if (fileName.isEmpty()) { + // Node is not a file component, so we have to check if the current doc itself is + fileName = node.model()->fileUrl().toLocalFile(); + } + if (fileName.contains(Constants::QUICK_3D_ASSETS_FOLDER)) + return true; + } + return false; +} + } //SelectionStateFunctors } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h index 37696245849..dc36da3dc6e 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodecontextmenu_helper.h @@ -109,6 +109,7 @@ bool selectionHasSameParent(const SelectionContext &selectionState); bool selectionIsComponent(const SelectionContext &selectionState); bool singleSelectionItemIsAnchored(const SelectionContext &selectionState); bool singleSelectionItemIsNotAnchored(const SelectionContext &selectionState); +bool selectionIsImported3DAsset(const SelectionContext &selectionState); } // namespace SelectionStateFunctors diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index c13080c8f1f..ebcae41091e 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -1581,6 +1581,15 @@ void openSignalDialog(const SelectionContext &selectionContext) SignalList::showWidget(selectionContext.currentSingleSelectedNode()); } +void updateImported3DAsset(const SelectionContext &selectionContext) +{ + if (selectionContext.view()) { + selectionContext.view()->emitCustomNotification( + "UpdateImported3DAsset", {selectionContext.currentSingleSelectedNode()}); + + } +} + } // namespace ModelNodeOperations } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h index 575e62f010a..0e302a3c65a 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h @@ -89,6 +89,7 @@ void removeGroup(const SelectionContext &selectionContext); void editAnnotation(const SelectionContext &selectionContext); void openSignalDialog(const SelectionContext &selectionContext); +void updateImported3DAsset(const SelectionContext &selectionContext); // ModelNodePreviewImageOperations QVariant previewImageDataForGenericNode(const ModelNode &modelNode); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp index 0b0c7fef103..1192fb0fef0 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp @@ -28,26 +28,33 @@ #include "qmldesignerplugin.h" #include "qmldesignerconstants.h" #include "model.h" +#include "nodemetainfo.h" +#include "variantproperty.h" #include "utils/outputformatter.h" #include "theme.h" #include #include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace QmlDesigner { @@ -70,14 +77,15 @@ static const int rowHeight = 26; } -ItemLibraryAssetImportDialog::ItemLibraryAssetImportDialog(const QStringList &importFiles, - const QString &defaulTargetDirectory, - const QVariantMap &supportedExts, - const QVariantMap &supportedOpts, - QWidget *parent) : - QDialog(parent) +ItemLibraryAssetImportDialog::ItemLibraryAssetImportDialog( + const QStringList &importFiles, const QString &defaulTargetDirectory, + const QVariantMap &supportedExts, const QVariantMap &supportedOpts, + const QJsonObject &defaultOpts, const QSet &preselectedFilesForOverwrite, + QWidget *parent) + : QDialog(parent) , ui(new Ui::ItemLibraryAssetImportDialog) , m_importer(this) + , m_preselectedFilesForOverwrite(preselectedFilesForOverwrite) { setModal(true); ui->setupUi(this); @@ -172,6 +180,16 @@ ItemLibraryAssetImportDialog::ItemLibraryAssetImportDialog(const QStringList &im while (optIt != supportedOpts.constEnd()) { QJsonObject options = QJsonObject::fromVariantMap(qvariant_cast(optIt.value())); m_importOptions << options.value("options").toObject(); + auto it = defaultOpts.constBegin(); + while (it != defaultOpts.constEnd()) { + if (m_importOptions.last().contains(it.key())) { + QJsonObject optObj = m_importOptions.last()[it.key()].toObject(); + QJsonValue value(it.value()["value"]); + optObj.insert("value", value); + m_importOptions.last().insert(it.key(), optObj); + } + ++it; + } groups << options.value("groups").toObject(); const auto &exts = optIt.key().split(':'); for (const auto &ext : exts) @@ -252,6 +270,125 @@ ItemLibraryAssetImportDialog::~ItemLibraryAssetImportDialog() delete ui; } +void ItemLibraryAssetImportDialog::updateImport(const ModelNode &updateNode, + const QVariantMap &supportedExts, + const QVariantMap &supportedOpts) +{ + QString errorMsg; + const ModelNode &node = updateNode; + if (node.isValid() && node.hasMetaInfo()) { + QString compFileName = node.metaInfo().componentFileName(); // absolute path + bool preselectNodeSource = false; + if (compFileName.isEmpty()) { + // Node is not a file component, so we have to check if the current doc itself is + compFileName = node.model()->fileUrl().toLocalFile(); + preselectNodeSource = true; + } + QFileInfo compFileInfo{compFileName}; + + // Find to top asset folder + const QString assetFolder = QLatin1String(Constants::QUICK_3D_ASSETS_FOLDER).mid(1); + const QStringList parts = compFileName.split('/'); + int i = parts.size() - 1; + int previousSize = 0; + for (; i >= 0; --i) { + if (parts[i] == assetFolder) + break; + previousSize = parts[i].size(); + } + if (i >= 0) { + const QString assetPath = compFileName.left(compFileName.lastIndexOf(assetFolder) + + assetFolder.size() + previousSize + 1); + const QDir assetDir(assetPath); + + // Find import options and the original source scene + const QString jsonFileName = assetDir.absoluteFilePath( + Constants::QUICK_3D_ASSET_IMPORT_DATA_NAME); + QFile jsonFile{jsonFileName}; + if (jsonFile.open(QIODevice::ReadOnly)) { + QJsonParseError jsonError; + const QByteArray fileData = jsonFile.readAll(); + auto jsonDocument = QJsonDocument::fromJson(fileData, &jsonError); + jsonFile.close(); + if (jsonError.error == QJsonParseError::NoError) { + QJsonObject jsonObj = jsonDocument.object(); + const QJsonObject options = jsonObj.value( + Constants::QUICK_3D_ASSET_IMPORT_DATA_OPTIONS_KEY).toObject(); + QString sourcePath = jsonObj.value( + Constants::QUICK_3D_ASSET_IMPORT_DATA_SOURCE_KEY).toString(); + if (options.isEmpty() || sourcePath.isEmpty()) { + errorMsg = QCoreApplication::translate( + "ModelNodeOperations", + "Asset import data file '%1' is invalid.").arg(jsonFileName); + } else { + QFileInfo sourceInfo{sourcePath}; + if (!sourceInfo.exists()) { + // Unable to find original scene source, launch file dialog to locate it + QString initialPath; + ProjectExplorer::Project *currentProject + = ProjectExplorer::SessionManager::projectForFile( + Utils::FilePath::fromString(compFileName)); + if (currentProject) + initialPath = currentProject->projectDirectory().toString(); + else + initialPath = compFileInfo.absolutePath(); + QStringList selectedFiles = QFileDialog::getOpenFileNames( + Core::ICore::dialogParent(), + tr("Locate 3D Asset '%1'").arg(sourceInfo.fileName()), + initialPath, sourceInfo.fileName()); + if (!selectedFiles.isEmpty() + && QFileInfo{selectedFiles[0]}.fileName() == sourceInfo.fileName()) { + sourcePath = selectedFiles[0]; + sourceInfo.setFile(sourcePath); + } + } + if (sourceInfo.exists()) { + // In case of a selected node inside an imported component, preselect + // any file pointed to by a "source" property of the node. + QSet preselectedFiles; + if (preselectNodeSource && updateNode.hasProperty("source")) { + QString source = updateNode.variantProperty("source").value().toString(); + if (QFileInfo{source}.isRelative()) + source = QDir{compFileInfo.absolutePath()}.absoluteFilePath(source); + preselectedFiles.insert(source); + } + auto importDlg = new ItemLibraryAssetImportDialog( + {sourceInfo.absoluteFilePath()}, + node.model()->fileUrl().toLocalFile(), + supportedExts, supportedOpts, options, + preselectedFiles, Core::ICore::mainWindow()); + importDlg->show(); + + } else { + errorMsg = QCoreApplication::translate( + "ModelNodeOperations", "Unable to locate source scene '%1'.") + .arg(sourceInfo.fileName()); + } + } + } else { + errorMsg = jsonError.errorString(); + } + } else { + errorMsg = QCoreApplication::translate("ModelNodeOperations", + "Opening asset import data file '%1' failed.") + .arg(jsonFileName); + } + } else { + errorMsg = QCoreApplication::translate("ModelNodeOperations", + "Unable to resolve asset import path."); + } + } + + if (!errorMsg.isEmpty()) { + QMessageBox::warning( + qobject_cast(Core::ICore::dialogParent()), + QCoreApplication::translate("ModelNodeOperations", "Import Update Failed"), + QCoreApplication::translate("ModelNodeOperations", + "Failed to update import.\nError:\n%1").arg(errorMsg), + QMessageBox::Close); + } +} + void ItemLibraryAssetImportDialog::createTab(const QString &tabLabel, int optionsIndex, const QJsonObject &groups) { @@ -610,7 +747,8 @@ void ItemLibraryAssetImportDialog::onImport() if (!m_quick3DFiles.isEmpty()) { m_importer.importQuick3D(m_quick3DFiles, m_quick3DImportPath, - m_importOptions, m_extToImportOptionsMap); + m_importOptions, m_extToImportOptionsMap, + m_preselectedFilesForOverwrite); } } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.h index 3d4069986ec..ded5d75703a 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.h @@ -25,9 +25,11 @@ #pragma once #include "itemlibraryassetimporter.h" +#include "modelnode.h" -#include -#include +#include +#include +#include namespace Utils { class OutputFormatter; @@ -49,9 +51,15 @@ public: const QString &defaulTargetDirectory, const QVariantMap &supportedExts, const QVariantMap &supportedOpts, + const QJsonObject &defaultOpts, + const QSet &preselectedFilesForOverwrite, QWidget *parent = nullptr); ~ItemLibraryAssetImportDialog(); + static void updateImport(const ModelNode &updateNode, + const QVariantMap &supportedExts, + const QVariantMap &supportedOpts); + protected: void resizeEvent(QResizeEvent *event) override; @@ -82,5 +90,6 @@ private: QHash m_extToImportOptionsMap; int m_optionsHeight = 0; int m_optionsRows = 0; + QSet m_preselectedFilesForOverwrite; }; } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp index 69924f20080..220dff8508a 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include namespace @@ -64,7 +65,8 @@ ItemLibraryAssetImporter::~ItemLibraryAssetImporter() { void ItemLibraryAssetImporter::importQuick3D(const QStringList &inputFiles, const QString &importPath, const QVector &options, - const QHash &extToImportOptionsMap) + const QHash &extToImportOptionsMap, + const QSet &preselectedFilesForOverwrite) { if (m_isImporting) cancelImport(); @@ -79,7 +81,7 @@ void ItemLibraryAssetImporter::importQuick3D(const QStringList &inputFiles, m_importPath = importPath; - parseFiles(inputFiles, options, extToImportOptionsMap); + parseFiles(inputFiles, options, extToImportOptionsMap, preselectedFilesForOverwrite); if (!isCancelled()) { const auto parseData = m_parseData; @@ -203,7 +205,8 @@ void ItemLibraryAssetImporter::reset() void ItemLibraryAssetImporter::parseFiles(const QStringList &filePaths, const QVector &options, - const QHash &extToImportOptionsMap) + const QHash &extToImportOptionsMap, + const QSet &preselectedFilesForOverwrite) { if (isCancelled()) return; @@ -219,7 +222,7 @@ void ItemLibraryAssetImporter::parseFiles(const QStringList &filePaths, int index = extToImportOptionsMap.value(QFileInfo(file).suffix()); ParseData pd; pd.options = options[index]; - if (preParseQuick3DAsset(file, pd)) { + if (preParseQuick3DAsset(file, pd, preselectedFilesForOverwrite)) { pd.importId = ++m_importIdCounter; m_parseData.insert(pd.importId, pd); } @@ -227,7 +230,8 @@ void ItemLibraryAssetImporter::parseFiles(const QStringList &filePaths, } } -bool ItemLibraryAssetImporter::preParseQuick3DAsset(const QString &file, ParseData &pd) +bool ItemLibraryAssetImporter::preParseQuick3DAsset(const QString &file, ParseData &pd, + const QSet &preselectedFilesForOverwrite) { pd.targetDir = QDir(m_importPath); pd.outDir = QDir(m_tempDir->path()); @@ -264,7 +268,9 @@ bool ItemLibraryAssetImporter::preParseQuick3DAsset(const QString &file, ParseDa pd.assetName = assetDirs[0]; pd.targetDirPath = pd.targetDir.filePath(pd.assetName); } - OverwriteResult result = confirmAssetOverwrite(pd.assetName); + OverwriteResult result = preselectedFilesForOverwrite.isEmpty() + ? confirmAssetOverwrite(pd.assetName) + : OverwriteResult::Update; if (result == OverwriteResult::Skip) { addWarning(tr("Skipped import of existing asset: \"%1\"").arg(pd.assetName)); return false; @@ -282,8 +288,11 @@ bool ItemLibraryAssetImporter::preParseQuick3DAsset(const QString &file, ParseDa alwaysOverwrite.insert(iconIt.fileInfo().absoluteFilePath()); } alwaysOverwrite.insert(sourceSceneTargetFilePath(pd)); + alwaysOverwrite.insert(pd.targetDirPath + '/' + Constants::QUICK_3D_ASSET_IMPORT_DATA_NAME); - Internal::AssetImportUpdateDialog dlg {pd.targetDirPath, {}, alwaysOverwrite, + Internal::AssetImportUpdateDialog dlg {pd.targetDirPath, + preselectedFilesForOverwrite, + alwaysOverwrite, qobject_cast(parent())}; int exitVal = dlg.exec(); @@ -421,6 +430,18 @@ void ItemLibraryAssetImporter::postParseQuick3DAsset(const ParseData &pd) } } + // Generate import metadata file + const QString sourcePath = pd.sourceInfo.absoluteFilePath(); + QString importDataFileName = outDir.absoluteFilePath(Constants::QUICK_3D_ASSET_IMPORT_DATA_NAME); + QSaveFile importDataFile(importDataFileName); + if (importDataFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + QJsonObject optObj; + optObj.insert(Constants::QUICK_3D_ASSET_IMPORT_DATA_OPTIONS_KEY, pd.options); + optObj.insert(Constants::QUICK_3D_ASSET_IMPORT_DATA_SOURCE_KEY, sourcePath); + importDataFile.write(QJsonDocument{optObj}.toJson()); + importDataFile.commit(); + } + // Gather all generated files QDirIterator dirIt(outDir.path(), QDir::Files, QDirIterator::Subdirectories); while (dirIt.hasNext()) { @@ -429,7 +450,7 @@ void ItemLibraryAssetImporter::postParseQuick3DAsset(const ParseData &pd) } // Copy the original asset into a subdirectory - assetFiles.insert(pd.sourceInfo.absoluteFilePath(), sourceSceneTargetFilePath(pd)); + assetFiles.insert(sourcePath, sourceSceneTargetFilePath(pd)); m_importFiles.insert(assetFiles); } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.h index 56bd8ec8f29..9abc315fbe0 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.h @@ -54,7 +54,8 @@ public: void importQuick3D(const QStringList &inputFiles, const QString &importPath, const QVector &options, - const QHash &extToImportOptionsMap); + const QHash &extToImportOptionsMap, + const QSet &preselectedFilesForOverwrite); bool isImporting() const; void cancelImport(); @@ -91,8 +92,10 @@ private: void notifyFinished(); void reset(); void parseFiles(const QStringList &filePaths, const QVector &options, - const QHash &extToImportOptionsMap); - bool preParseQuick3DAsset(const QString &file, ParseData &pd); + const QHash &extToImportOptionsMap, + const QSet &preselectedFilesForOverwrite); + bool preParseQuick3DAsset(const QString &file, ParseData &pd, + const QSet &preselectedFilesForOverwrite); void postParseQuick3DAsset(const ParseData &pd); void copyImportedFiles(); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp index dde17dbad32..151e6c5a596 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp @@ -48,6 +48,7 @@ #include #include #include +#include namespace QmlDesigner { @@ -240,7 +241,7 @@ void ItemLibraryView::updateImport3DSupport(const QVariantMap &supportMap) auto handle3DModel = [this](const QStringList &fileNames, const QString &defaultDir) -> bool { auto importDlg = new ItemLibraryAssetImportDialog(fileNames, defaultDir, m_importableExtensions3DMap, - m_importOptions3DMap, + m_importOptions3DMap, {}, {}, Core::ICore::mainWindow()); importDlg->show(); return true; @@ -263,4 +264,15 @@ void ItemLibraryView::updateImport3DSupport(const QVariantMap &supportMap) m_importOptions3DMap = qvariant_cast(supportMap.value("options")); } +void ItemLibraryView::customNotification(const AbstractView *view, const QString &identifier, + const QList &nodeList, const QList &data) +{ + if (identifier == "UpdateImported3DAsset" && nodeList.size() > 0) { + ItemLibraryAssetImportDialog::updateImport(nodeList[0], m_importableExtensions3DMap, + m_importOptions3DMap); + } else { + AbstractView::customNotification(view, identifier, nodeList, data); + } +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h index 5668b8fbc61..c9d7841bbd7 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.h @@ -55,6 +55,8 @@ public: void usedImportsChanged(const QList &usedImports) override; void documentMessagesChanged(const QList &errors, const QList &warnings) override; void updateImport3DSupport(const QVariantMap &supportMap) override; + void customNotification(const AbstractView *view, const QString &identifier, + const QList &nodeList, const QList &data) override; void setResourcePath(const QString &resourcePath); diff --git a/src/plugins/qmldesigner/qmldesignerconstants.h b/src/plugins/qmldesigner/qmldesignerconstants.h index 84985b991f7..937cfc8005f 100644 --- a/src/plugins/qmldesigner/qmldesignerconstants.h +++ b/src/plugins/qmldesigner/qmldesignerconstants.h @@ -69,6 +69,9 @@ const char QML_DESIGNER_SUBFOLDER[] = "/designer/"; const char QUICK_3D_ASSETS_FOLDER[] = "/Quick3DAssets"; const char QUICK_3D_ASSET_LIBRARY_ICON_SUFFIX[] = "_libicon"; const char QUICK_3D_ASSET_ICON_DIR[] = "_icons"; +const char QUICK_3D_ASSET_IMPORT_DATA_NAME[] = "_importdata.json"; +const char QUICK_3D_ASSET_IMPORT_DATA_OPTIONS_KEY[] = "import_options"; +const char QUICK_3D_ASSET_IMPORT_DATA_SOURCE_KEY[] = "source_scene"; const char DEFAULT_ASSET_IMPORT_FOLDER[] = "/asset_imports"; // Menus From 35245a7fcf6063e259f4cdfec5266cf7ad480394 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 24 Feb 2021 18:42:42 +0200 Subject: [PATCH 05/20] Debugger: Show Threads dock by default Change-Id: I11480919b4bccab2f5472d4683a3ee81068cac71 Reviewed-by: Christian Stenger Reviewed-by: hjk --- src/plugins/debugger/debuggerengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 2c2b80dce1e..656b4d9c0dc 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -853,7 +853,7 @@ void DebuggerEnginePrivate::setupViews() m_perspective->addWindow(m_stackWindow, Perspective::SplitVertical, nullptr); m_perspective->addWindow(m_breakWindow, Perspective::SplitHorizontal, m_stackWindow); - m_perspective->addWindow(m_threadsWindow, Perspective::AddToTab, m_breakWindow,false); + m_perspective->addWindow(m_threadsWindow, Perspective::AddToTab, m_breakWindow); m_perspective->addWindow(m_modulesWindow, Perspective::AddToTab, m_threadsWindow, false); m_perspective->addWindow(m_sourceFilesWindow, Perspective::AddToTab, m_modulesWindow, false); m_perspective->addWindow(m_localsAndInspectorWindow, Perspective::AddToTab, nullptr, true, Qt::RightDockWidgetArea); From 1027b94fcbfe1308772c28531563b7d3c76886cd Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 16 Feb 2021 08:46:52 +0100 Subject: [PATCH 06/20] Fix some compiler warnings about unused variables Change-Id: I9a9450eab68f53b08722adb9a5d33c4f318b2129 Reviewed-by: Christian Stenger --- src/plugins/coreplugin/systemsettings.cpp | 8 ++++---- src/plugins/fakevim/fakevimplugin.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp index 8852fb183e0..59fc5e9a6f2 100644 --- a/src/plugins/coreplugin/systemsettings.cpp +++ b/src/plugins/coreplugin/systemsettings.cpp @@ -51,14 +51,14 @@ using namespace Utils; -static const char crashReportingEnabledKey[] = "CrashReportingEnabled"; -static const char showCrashButtonKey[] = "ShowCrashButton"; - namespace Core { namespace Internal { -// TODO: move to somewhere in Utils #ifdef ENABLE_CRASHPAD +const char crashReportingEnabledKey[] = "CrashReportingEnabled"; +const char showCrashButtonKey[] = "ShowCrashButton"; + +// TODO: move to somewhere in Utils static QString formatSize(qint64 size) { QStringList units {QObject::tr("Bytes"), QObject::tr("KB"), QObject::tr("MB"), diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index c14927769a8..72f19334e4e 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -1558,7 +1558,7 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor) return; // Duplicated editors are not signalled by the EditorManager. Track them nevertheless. - connect(editor, &IEditor::editorDuplicated, this, [this, editor](IEditor *duplicate) { + connect(editor, &IEditor::editorDuplicated, this, [this](IEditor *duplicate) { editorOpened(duplicate); connect(duplicate, &QObject::destroyed, this, [this, duplicate] { m_editorToHandler.remove(duplicate); From a995a4633fe3162d8756e50134e7ec2c53afc763 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 25 Feb 2021 14:09:42 +0100 Subject: [PATCH 07/20] CPlusPlus: Do not mis-classify bitfield declarations as initializations Fixes: QTCREATORBUG-25390 Change-Id: I1976b7db2996f5a09db73adbd127aac9ab92d57d Reviewed-by: Christian Stenger --- src/libs/cplusplus/FindUsages.cpp | 3 ++- tests/auto/cplusplus/findusages/tst_findusages.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index f495f36e59d..b0835b7c0ae 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -229,7 +229,8 @@ public: } if (const auto declarator = (*it)->asDeclarator()) { if (containsToken(declarator->core_declarator)) { - if (declarator->initializer && (!declarator->postfix_declarator_list + if (declarator->initializer && declarator->equal_token + && (!declarator->postfix_declarator_list || !declarator->postfix_declarator_list->value || !declarator->postfix_declarator_list->value->asFunctionDeclarator())) { return Usage::Type::Initialization; diff --git a/tests/auto/cplusplus/findusages/tst_findusages.cpp b/tests/auto/cplusplus/findusages/tst_findusages.cpp index 8ac1f633d7d..c1ce7780e88 100644 --- a/tests/auto/cplusplus/findusages/tst_findusages.cpp +++ b/tests/auto/cplusplus/findusages/tst_findusages.cpp @@ -2021,7 +2021,7 @@ void tst_FindUsages::writableRefs() struct S { S() : value2(value) {} static int value; - int value2; + int value2 : 2; static void *p; static const void *p2; struct Nested { From 91241d86de7aefb46a31b3bc45155a493fe09665 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Thu, 25 Feb 2021 13:51:24 +0100 Subject: [PATCH 08/20] QmlDesigner: Fix property editor value setter Fix property editor value setValueWithEmit and setExpressionWithEmit by resetting the other. Task-number: QDS-3800 Change-Id: I7729c0b9fbac7eacce665d00d79a69e8ee7a5f90 Reviewed-by: Thomas Hartmann --- .../components/propertyeditor/propertyeditorvalue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp index 890629e4fd5..ec78ed97afd 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp @@ -144,6 +144,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value) setValue(newValue); m_isBound = false; + m_expression.clear(); emit valueChanged(nameAsQString(), value); emit valueChangedQml(); emit isBoundChanged(); @@ -182,6 +183,7 @@ void PropertyEditorValue::setExpressionWithEmit(const QString &expression) { if ( m_expression != expression) { setExpression(expression); + m_value.clear(); emit expressionChanged(nameAsQString()); } } From dce690ab73b0ec2c406c2280a860aaa05e2ea7b1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 25 Feb 2021 13:29:24 +0100 Subject: [PATCH 09/20] Fix build with Qt 6 Change-Id: I67ffc389d7579ac98755ec99614ce9b3e4e07df5 Reviewed-by: Mahmoud Badri Reviewed-by: Thomas Hartmann --- src/libs/sqlite/utf8string.h | 7 +++++++ .../itemlibrary/itemlibraryassetimportdialog.cpp | 2 +- .../itemlibrary/itemlibraryassetimporter.cpp | 14 ++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/libs/sqlite/utf8string.h b/src/libs/sqlite/utf8string.h index 6e8e469595f..0c6a1fb3341 100644 --- a/src/libs/sqlite/utf8string.h +++ b/src/libs/sqlite/utf8string.h @@ -268,6 +268,13 @@ public: return second == first; } + friend bool operator!=(const Utf8String &first, const char *second) + { + return first.byteArray != second; + } + + friend bool operator!=(const char *first, const Utf8String &second) { return second != first; } + friend bool operator==(const Utf8String &first, const QString &second) { return first.byteArray == second.toUtf8(); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp index 1192fb0fef0..5d6054c7b76 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp @@ -184,7 +184,7 @@ ItemLibraryAssetImportDialog::ItemLibraryAssetImportDialog( while (it != defaultOpts.constEnd()) { if (m_importOptions.last().contains(it.key())) { QJsonObject optObj = m_importOptions.last()[it.key()].toObject(); - QJsonValue value(it.value()["value"]); + QJsonValue value(it.value().toObject()["value"]); optObj.insert("value", value); m_importOptions.last().insert(it.key(), optObj); } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp index 220dff8508a..b78dcb6eece 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp @@ -33,17 +33,19 @@ #include "rewritertransaction.h" #include "rewritingexception.h" +#include + +#include #include #include -#include #include -#include -#include -#include -#include #include #include +#include +#include #include +#include +#include namespace { @@ -300,7 +302,7 @@ bool ItemLibraryAssetImporter::preParseQuick3DAsset(const QString &file, ParseDa if (exitVal == QDialog::Accepted) overwriteFiles = dlg.selectedFiles(); if (!overwriteFiles.isEmpty()) { - overwriteFiles.append(QStringList::fromSet(alwaysOverwrite)); + overwriteFiles.append(Utils::toList(alwaysOverwrite)); m_overwrittenImports.insert(pd.targetDirPath, overwriteFiles); } else { addWarning(tr("No files selected for overwrite, skipping import: \"%1\"").arg(pd.assetName)); From 0de044d4794aff533a77f7dfe23815f9e2f4388d Mon Sep 17 00:00:00 2001 From: Heiko Becker Date: Thu, 25 Feb 2021 23:38:52 +0100 Subject: [PATCH 10/20] Use GNUInstallDirs to install desktop and appstream files c81baf1a9cc938a283f6c52c8fd10bab84183391 introduced the usage of GNUInstallDirs for Linux. Use it to install desktop files and appstream metadata, too. Change-Id: I13a363e5383e1150fd9b8d7e33d55ac53bee63ff Reviewed-by: Eike Ziller --- share/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index eb3c779b400..b1e61d596ef 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -6,6 +6,6 @@ if (NOT APPLE AND NOT WIN32) applications metainfo DESTINATION - share + ${CMAKE_INSTALL_DATAROOTDIR} ) endif() From d41bc944cce5350674a34f80ec61cc20e3adeea4 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 25 Feb 2021 15:29:40 +0200 Subject: [PATCH 11/20] Help: Fix crash with previous/next document in help mode "Previous/next Open Document in History" crashed in help mode when only a single page is open. Disable the actions in this case, and add a guard that prevents setting the current page to an invalid index. Fixes: QDS-3743 Change-Id: I569292d8c348269dd12d2ebb089c03173cbd4bc2 Reviewed-by: Eike Ziller --- src/plugins/help/helpwidget.cpp | 5 ++++- src/plugins/help/openpagesswitcher.cpp | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/help/helpwidget.cpp b/src/plugins/help/helpwidget.cpp index 65c468ac386..30a62b3381f 100644 --- a/src/plugins/help/helpwidget.cpp +++ b/src/plugins/help/helpwidget.cpp @@ -934,7 +934,10 @@ void HelpWidget::updateCloseButton() { if (supportsPages()) { const bool closeOnReturn = LocalHelpManager::returnOnClose() && m_style == ModeWidget; - m_closeAction->setEnabled(closeOnReturn || m_viewerStack->count() > 1); + const bool hasMultiplePages = m_viewerStack->count() > 1; + m_closeAction->setEnabled(closeOnReturn || hasMultiplePages); + m_gotoPrevious->setEnabled(hasMultiplePages); + m_gotoNext->setEnabled(hasMultiplePages); } } diff --git a/src/plugins/help/openpagesswitcher.cpp b/src/plugins/help/openpagesswitcher.cpp index 20117828a71..5991efd0dda 100644 --- a/src/plugins/help/openpagesswitcher.cpp +++ b/src/plugins/help/openpagesswitcher.cpp @@ -81,7 +81,9 @@ void OpenPagesSwitcher::gotoPreviousPage() void OpenPagesSwitcher::selectAndHide() { setVisible(false); - emit setCurrentPage(m_openPagesWidget->currentIndex()); + QModelIndex index = m_openPagesWidget->currentIndex(); + if (index.isValid()) + emit setCurrentPage(index); } void OpenPagesSwitcher::selectCurrentPage(int index) From 93ec7862f2e49acd3d62636e5f09315d85a6ca84 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 24 Feb 2021 13:20:35 +0100 Subject: [PATCH 12/20] Wizards: Remove duplicate entries from translation combo box We only care about language and country, but there are locales where these are the same. Since they map to the same output for our purposes, we randomly choose one of them. Change-Id: I0591607d1dfa6ea27cd9405cf895d0f8865df804 Reviewed-by: Christian Stenger --- src/plugins/qtsupport/translationwizardpage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/qtsupport/translationwizardpage.cpp b/src/plugins/qtsupport/translationwizardpage.cpp index 4dc80def5ba..f4c9008ed36 100644 --- a/src/plugins/qtsupport/translationwizardpage.cpp +++ b/src/plugins/qtsupport/translationwizardpage.cpp @@ -41,6 +41,8 @@ #include #include +#include + using namespace Core; using namespace ProjectExplorer; using namespace Utils; @@ -107,6 +109,8 @@ TranslationWizardPage::TranslationWizardPage(const QString &enabledExpr) }); sort(localeStrings, [](const LocalePair &l1, const LocalePair &l2) { return l1.first < l2.first; }); + localeStrings.erase(std::unique(localeStrings.begin(), localeStrings.end()), + localeStrings.end()); for (const LocalePair &lp : qAsConst(localeStrings)) m_languageComboBox.addItem(lp.first, lp.second); formLayout->addRow(tr("Language:"), &m_languageComboBox); From faa21ef37865a7e209992e4b1cd358022e47cff1 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Thu, 25 Feb 2021 15:21:01 +0100 Subject: [PATCH 13/20] CMakeProjectManager: Allow copying of CMake variables In the context menu of the CMake variables there is now a "Copy" entry that will copy to clipboard the -D:= or -U values. Task-number: QTCREATORBUG-22482 Fixes: QTCREATORBUG-24781 Change-Id: Iaa70e64fd0593398732ccb8d9036571b308b5f12 Reviewed-by: Eike Ziller --- .../cmakebuildconfiguration.cpp | 19 ++++++++++++ src/plugins/cmakeprojectmanager/configmodel.h | 29 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index e29d54dba97..d4d2f0d2675 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -68,8 +68,10 @@ #include #include +#include #include #include +#include #include #include #include @@ -707,6 +709,23 @@ bool CMakeBuildSettingsWidget::eventFilter(QObject *target, QEvent *event) if ((action = createForceAction(ConfigModel::DataItem::STRING, idx))) menu->addAction(action); + auto copy = new QAction(tr("Copy"), this); + menu->addAction(copy); + connect(copy, &QAction::triggered, this, [this] { + const QModelIndexList selectedIndexes = m_configView->selectionModel()->selectedIndexes(); + + const QModelIndexList validIndexes = Utils::filtered(selectedIndexes, [](const QModelIndex &index) { + return index.isValid() && index.flags().testFlag(Qt::ItemIsSelectable); + }); + + const QStringList variableList = Utils::transform(validIndexes, [this](const QModelIndex &index) { + return ConfigModel::dataItemFromIndex(index) + .toCMakeConfigItem().toArgument(m_buildConfiguration->macroExpander()); + }); + + QApplication::clipboard()->setText(variableList.join('\n'), QClipboard::Clipboard); + }); + menu->move(e->globalPos()); menu->show(); diff --git a/src/plugins/cmakeprojectmanager/configmodel.h b/src/plugins/cmakeprojectmanager/configmodel.h index 74b12c7d742..70f0fa3960a 100644 --- a/src/plugins/cmakeprojectmanager/configmodel.h +++ b/src/plugins/cmakeprojectmanager/configmodel.h @@ -83,6 +83,35 @@ public: } } + CMakeConfigItem toCMakeConfigItem() const { + CMakeConfigItem cmi; + cmi.key = key.toUtf8(); + cmi.value = value.toUtf8(); + switch (type) { + case DataItem::BOOLEAN: + cmi.type = CMakeConfigItem::BOOL; + break; + case DataItem::FILE: + cmi.type = CMakeConfigItem::FILEPATH; + break; + case DataItem::DIRECTORY: + cmi.type = CMakeConfigItem::PATH; + break; + case DataItem::STRING: + cmi.type = CMakeConfigItem::STRING; + break; + case DataItem::UNKNOWN: + cmi.type = CMakeConfigItem::INTERNAL; + break; + } + cmi.isUnset = isUnset; + cmi.isAdvanced = isAdvanced; + cmi.values = values; + cmi.documentation = description.toUtf8(); + + return cmi; + } + enum Type { BOOLEAN, FILE, DIRECTORY, STRING, UNKNOWN}; QString key; From 1ed3d242de5104b528207bf631f4a91a6dc2fa26 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 26 Feb 2021 01:25:49 +0100 Subject: [PATCH 14/20] ProjectExplorer: Refresh fileoverlay_product.png Provide it with the semi-transparent white outline that other overlays have. Good for dark themes. Also, let's keep the original version controlled in our icons SVG. Task-number: QTCREATORBUG-25395 Change-Id: I439ce4c25ed6d6e758dc4ac078e65977b16aafe5 Reviewed-by: Christian Kandeler --- .../images/fileoverlay_product.png | Bin 1152 -> 257 bytes .../images/fileoverlay_product@2x.png | Bin 1453 -> 510 bytes src/tools/icons/qtcreatoricons.svg | 22 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/plugins/projectexplorer/images/fileoverlay_product.png b/src/plugins/projectexplorer/images/fileoverlay_product.png index 42fcf5f44c2604bb0fe6b06dc6eb1bb9eb1b3275..b5f3c7066660aadab7660915bdd48b8faea0e5c1 100644 GIT binary patch delta 240 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 + + + + + Date: Fri, 26 Feb 2021 15:54:57 +0100 Subject: [PATCH 15/20] Core: Fix accidental re-ordering of search results Amends d3deefc3a4. Fixes: QTCREATORBUG-25396 Change-Id: I6ca9c9cf20dcdfc7fbb4dbd5e8bf473880267736 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/searchresultwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index 0d1d49524e3..af87935623f 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -814,7 +814,7 @@ void SearchResult::setAdditionalReplaceWidget(QWidget *widget) */ void SearchResult::addResult(const SearchResultItem &item) { - m_widget->addResults({item}, AddSorted); + m_widget->addResults({item}, AddOrdered); } /*! From 4ebe717a7db6432b209a4a2307c0fd5a98782e1e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 25 Feb 2021 16:47:49 +0100 Subject: [PATCH 16/20] Output panes: Fix auto-scrolling issue The idea is that the user turns auto-scrolling off by manually moving the scrollbar up and turns it back on again by moving it all the way down. However, at least on my machine I am no longer able to do the latter -- the scrollbar position is always at least one below the maximum. I don't know when, why or how that changed, nor do I know whether it's about Qt, the window system or something else. Either way, we have to account for it. Change-Id: I83aab758d72735d4db45d228eca8bbc7a8eebd93 Reviewed-by: Christian Stenger --- src/plugins/coreplugin/outputwindow.cpp | 9 +++------ src/plugins/coreplugin/outputwindow.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index fb3df944361..2aeb9399bfc 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -155,6 +155,8 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget connect(verticalScrollBar(), &QAbstractSlider::sliderMoved, this, &OutputWindow::updateAutoScroll); + connect(verticalScrollBar(), &QAbstractSlider::sliderReleased, + this, &OutputWindow::updateAutoScroll); undoAction->setEnabled(false); redoAction->setEnabled(false); @@ -449,7 +451,7 @@ void OutputWindow::handleOutputChunk(const QString &output, OutputFormat format) void OutputWindow::updateAutoScroll() { - d->scrollToBottom = isScrollbarAtBottom(); + d->scrollToBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum() - 1; } void OutputWindow::setMaxCharCount(int count) @@ -473,11 +475,6 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format) d->queueTimer.start(); } -bool OutputWindow::isScrollbarAtBottom() const -{ - return verticalScrollBar()->value() == verticalScrollBar()->maximum(); -} - QMimeData *OutputWindow::createMimeDataFromSelection() const { const auto mimeData = new QMimeData; diff --git a/src/plugins/coreplugin/outputwindow.h b/src/plugins/coreplugin/outputwindow.h index de951ded952..70b216b08c5 100644 --- a/src/plugins/coreplugin/outputwindow.h +++ b/src/plugins/coreplugin/outputwindow.h @@ -91,7 +91,6 @@ public slots: void setWordWrapEnabled(bool wrap); protected: - bool isScrollbarAtBottom() const; virtual void handleLink(const QPoint &pos); private: From 61a0b2b2b35e4b1a5dbf42484e8fc4f98e9fe0f6 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 26 Feb 2021 10:50:03 +0100 Subject: [PATCH 17/20] Add some basic contact information in a new Help->Contact dialog Change-Id: I5a01c3d3c9fd467ed7b48869b66617adf2b11fed Reviewed-by: Leena Miettinen Reviewed-by: Eike Ziller --- src/plugins/coreplugin/mainwindow.cpp | 35 +++++++++++++++++++++++++++ src/plugins/coreplugin/mainwindow.h | 1 + 2 files changed, 36 insertions(+) diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index cac88d51be9..9f7b9274e70 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -796,6 +796,14 @@ void MainWindow::registerDefaultActions() // mhelp->addAction(cmd, Constants::G_HELP_ABOUT); // tmpaction->setEnabled(true); // connect(tmpaction, &QAction::triggered, qApp, &QApplication::aboutQt); + + // Contact + tmpaction = new QAction(tr("Contact..."), this); + cmd = ActionManager::registerAction(tmpaction, "QtCreator.Contact"); + mhelp->addAction(cmd, Constants::G_HELP_ABOUT); + tmpaction->setEnabled(true); + connect(tmpaction, &QAction::triggered, this, &MainWindow::contact); + // About sep if (!HostOsInfo::isMacHost()) { // doesn't have the "About" actions in the Help menu tmpaction = new QAction(this); @@ -1237,6 +1245,33 @@ void MainWindow::aboutPlugins() dialog.exec(); } +void MainWindow::contact() +{ + QMessageBox dlg(QMessageBox::Information, tr("Contact"), + tr("

Qt Creator developers can be reached at the Qt Creator mailing list:

" + "%1" + "

or the #qt-creator channel on FreeNode IRC:

" + "%2" + "

Our bug tracker is located at %3.

" + "

Please use %4 for bigger chunks of text.

") + .arg("

    " + "" + "mailto:qt-creator@qt-project.org" + "

") + .arg("

    " + "" + "irc://freenode.org/qt-creator" + "

") + .arg("" + "https://bugreports.qt.io" + "") + .arg("" + "https://pastebin.com" + ""), + QMessageBox::Ok, this); + dlg.exec(); +} + QPrinter *MainWindow::printer() const { if (!m_printer) diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index d9105ba93b3..746dd93fc42 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -129,6 +129,7 @@ private: static void setFocusToEditor(); void aboutQtCreator(); void aboutPlugins(); + void contact(); void updateFocusWidget(QWidget *old, QWidget *now); NavigationWidget *navigationWidget(Side side) const; void setSidebarVisible(bool visible, Side side); From 44ce8db8d6300d5e871f0dbe60a367af46d7d7df Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 26 Feb 2021 18:29:16 +0100 Subject: [PATCH 18/20] QmlDesigner: Add more annoations titles Change-Id: Iec5198426979f2540beda08ccaa064f042897f3b Reviewed-by: Thomas Hartmann --- .../components/annotationeditor/annotationcommenttab.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp index 8aa58a13968..b8323bb80d2 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.cpp @@ -70,7 +70,11 @@ AnnotationCommentTab::AnnotationCommentTab(QWidget *parent) "project type", "project version", "Screen Description", - "Section"}}); + "Section", + "normalcolor", + "focuscolor", + "selectedcolor", + "pressedcolor"}}); connect(ui->titleEdit, &QComboBox::currentTextChanged, this, &AnnotationCommentTab::commentTitleChanged); From a0f12f5b98ffc6cb3ef2d2a5ff98fd8386ae50da Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 26 Feb 2021 17:00:18 +0100 Subject: [PATCH 19/20] CMake build: Add version number to external plugin dlls Fixes: QTCREATORBUG-24590 Change-Id: I01996e25af0b8ab7056c5d2012cd7951c3757ae5 Reviewed-by: Cristian Adam --- cmake/QtCreatorAPI.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 1cb69ebdc28..c417d3ab9eb 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -219,10 +219,11 @@ function(add_qtc_library name) endif() qtc_output_binary_dir(_output_binary_dir) + string(REGEX MATCH "^[0-9]*" IDE_VERSION_MAJOR ${IDE_VERSION}) set_target_properties(${name} PROPERTIES SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}" VERSION "${IDE_VERSION}" - SOVERSION "${PROJECT_VERSION_MAJOR}" + SOVERSION "${IDE_VERSION_MAJOR}" MACHO_CURRENT_VERSION ${IDE_VERSION} MACHO_COMPATIBILITY_VERSION ${IDE_VERSION_COMPAT} CXX_EXTENSIONS OFF @@ -240,7 +241,7 @@ function(add_qtc_library name) if (WIN32 AND library_type STREQUAL "SHARED" AND NOT _arg_UNVERSIONED) # Match qmake naming scheme e.g. Library4.dll set_target_properties(${name} PROPERTIES - SUFFIX "${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" + SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" PREFIX "" ) endif() @@ -491,8 +492,9 @@ function(add_qtc_plugin target_name) if (WIN32) # Match qmake naming scheme e.g. Plugin4.dll + string(REGEX MATCH "^[0-9]*" IDE_VERSION_MAJOR ${IDE_VERSION}) set_target_properties(${target_name} PROPERTIES - SUFFIX "${PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" + SUFFIX "${IDE_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" PREFIX "" ) endif() From 9fbd1c26b052396a7c97c7100919f466365e50ce Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 26 Feb 2021 17:31:00 +0100 Subject: [PATCH 20/20] CMakeProjectManager: Use the "gear" as project root item icon overlay Replace and remove the pixel accumulation called "projectexplorer.png". Fixes: QTCREATORBUG-25397 Change-Id: Idbf5e634bbe98d6eb9cc2cbaafd7f631cac18a83 Reviewed-by: Cristian Adam Reviewed-by: Eike Ziller --- .../cmakeprojectmanager/cmakeprojectnodes.cpp | 5 ++++- .../projectexplorer/images/projectexplorer.png | Bin 782 -> 0 bytes src/plugins/projectexplorer/projectexplorer.qrc | 1 - src/tools/iconlister/iconlister.cpp | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 src/plugins/projectexplorer/images/projectexplorer.png diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index 4fa34cba606..002a2b82623 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -71,7 +72,9 @@ CMakeProjectNode::CMakeProjectNode(const Utils::FilePath &directory) : ProjectExplorer::ProjectNode(directory) { setPriority(Node::DefaultProjectPriority + 1000); - setIcon(QIcon(":/projectexplorer/images/projectexplorer.png")); // TODO: Use proper icon! + static const QIcon productIcon = Core::FileIconProvider::directoryIcon( + ProjectExplorer::Constants::FILEOVERLAY_PRODUCT); + setIcon(productIcon); setListInProject(false); } diff --git a/src/plugins/projectexplorer/images/projectexplorer.png b/src/plugins/projectexplorer/images/projectexplorer.png deleted file mode 100644 index a84f2536f3335802937e340157b4b892f8cdb33d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 782 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7SkfJR9T^y|-MHc(VZ^|| zAX(xXQ4*Y=R#Ki=l*-_klAn~S;F+74o*I;zm{M7IGS!BGfoXxKi(^Q|ttG*}9wC7u z|K80u&%gI)>E~1XJ+(Pbw|Kg);W(3%xbwn-CJjS@E~n@%D_UGiF1l@Q)x8tSy)snc z#W90hEv8-OW<@>7n9?yAPFIQ>3 z;2Zn9#*N$tJe}*;_Z_Y7|0cL6>~{U0$%5y2^b&u>2RD^I>YniHN=mgcS3KTd zBRAtZi{6PYrVI2Trp@O*vCzhM-p2X6Z!IhFyXW^%uAhC? zs(*)FjMgNYf3WpB`jdY}H{<;TzH>9EA;-FP%dPb#s?ex|36mOV>(OTnz1>Ce=a)ZugM*T%RKVlHEG?@Ih&Fc;dAHV zja@por|E|#=$>zopr0FQcSX8-^I diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index 32fb160cf63..76a913e8df1 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -8,7 +8,6 @@ images/mode_project@2x.png images/mode_project_mask.png images/mode_project_mask@2x.png - images/projectexplorer.png images/buildhammerhandle.png images/buildhammerhandle@2x.png images/buildhammerhead.png diff --git a/src/tools/iconlister/iconlister.cpp b/src/tools/iconlister/iconlister.cpp index b650652c1bc..e8b9d3eb18d 100644 --- a/src/tools/iconlister/iconlister.cpp +++ b/src/tools/iconlister/iconlister.cpp @@ -334,8 +334,6 @@ void IconLister::addProjectExplorerIcons() {QIcon(":/projectexplorer/images/category_buildrun.png"), "category_buildrun.png", prefix, ""}, - {QIcon(":/projectexplorer/images/projectexplorer.png"), "projectexplorer.png", prefix, - ""}, {QIcon(":/projectexplorer/images/session.png"), "session.png", prefix, ""}, {QIcon(":/projectexplorer/images/BuildSettings.png"), "BuildSettings.png", prefix,