aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimportdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Utils: Introduce a convenience function creatorColor()hjk13 days1-1/+1
| | | | | | | ... forwarding to creatorTheme()->color(...) Change-Id: Iefaa043495127b3e500ed225584481d3ec0f8c1f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QmlDesigner: Improve 3D import dialog logicMiikka Heikkinen2024-05-241-30/+48
| | | | | | | | | | | | Got rid of the separate accept button. Now the import button turns into accept button after preview is shown, as long as user hasn't changed any options. Import preview is also generated automatically using default options. Fixes: QDS-12822 Change-Id: I5f1080f855cf1ba09e917cef7741534c0fb16d8c Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: Allow rotation of 3D import previewMiikka Heikkinen2024-05-231-5/+29
| | | | | | | | | | | | 3D import preview can now be rotated using left mouse button and dragging the preview image. This causes camera to orbit around the previewed model, similar to rotation to 3D edit view orbit camera. Close/Cancel button logic was also improved. Fixes: QDS-12795 Change-Id: I0c7d1ad28f8fe779b9bedc4bf76be704078d91a6 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* Show 3D import previewMiikka Heikkinen2024-05-211-16/+195
| | | | | | | | | | Show preview of 3D import in item library import dialog when importing a single 3D asset. Fixes: QDS-11111 Change-Id: I13135be1e931cbee034ca8a89654c0827b937bdf Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
* QmlDesigner: Prevent QDS crash during asset import in debug modeShrief Gabr2024-04-161-2/+4
| | | | | | Task-number: QDS-12436 Change-Id: I5ecac614faff58a314ec2886730e4d69f717885b Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* QmlDesigner: Change asset import pathMiikka Heikkinen2024-04-111-38/+7
| | | | | | | | | | | | | | | | The only import path should be project root, so change things that are generated under asset_imports to be generated in new folder GeneratedComponents under project root. GeneratedComponents is prefixed to the type names of generated items as well. If project already contains asset_imports folder, then old location is used. Fixes: QDS-12430 Change-Id: I7a419fe1c5411e3d39bf3c1e659df0043c60ba33 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: More test for NodeMetaInfoMarco Bubke2023-07-121-8/+9
| | | | | | Task-number: QDS-10055 Change-Id: I23a9d7ea87dff9f3e07f5beeb734cea7d01d2e94 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Make import button default in 3d asset import dialogMiikka Heikkinen2023-06-221-1/+1
| | | | | | Fixes: QDS-10120 Change-Id: I65c7ec53ef7b8e74e7851aee301e5a95e25115b9 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* Merge remote-tracking branch 'origin/qds/dev'Tim Jenssen2023-03-301-6/+59
|\ | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/filepath.cpp src/plugins/qmldesigner/qmldesignerexternaldependencies.cpp src/plugins/qmlprojectmanager/cmakegen/generatecmakelists.cpp tests/unit/unittest/CMakeLists.txt Change-Id: I017a6075db41a5233487ac855ffe23de2b2bb0ee
| * Merge remote-tracking branch 'origin/10.0' into qds/devTim Jenßen2023-03-261-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | bigger conflicts resolved at: src/plugins/qmldesigner/CMakeLists.txt src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
| * | QmlDesigner: Force QDS compatibility mode 3D import optionMiikka Heikkinen2023-03-071-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDS requires 3D imports to use QDS compatibility mode to work correctly, so we force designStudioWorkarounds option on in all imports we do and hide the option from UI so user can't toggle it off. Since designStudioWorkarounds supercedes expandValueComponents option, we also hide that as setting it has no effect. Fixes: QDS-9219 Change-Id: Id40a45338ea630228f59b111703eba661ebd357b Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
| * | QmlDesigner: Fix condition chains in 3D import optionsMiikka Heikkinen2023-02-071-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an import option conditionally depends on another option that depends on a third option, toggling the third option needs to change the enabled state of the first option controls as well as the second option controls. For example, consider this set of options (actual case with options for generating mesh levels of detail in Qt 6.5): optA optB, enabled when optA is true optC, enabled when optB is true optD, enabled when optB is true If optA is false, optC and optD controls need to be disabled even if optB is true, because of the chained conditions. Fixes: QDS-9055 Change-Id: I10aeb7596cf9c8a9053c7d08ec9ebb7a46db2cd2 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* | | ProjectExplorer: Move some not-fully-session related bitshjk2023-03-011-2/+4
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | ... out of SessionManager. The idea is to later move SessionManager into the Core plugin, which both is sensible conceptually and also prerequisite to merge the Bookmark plugin into TextEditor plugin. Currently, only the interface is split, as the load/save implemetations are non-mechanical to disentangle. Change-Id: I31631db3094ea192825a2ccaa6add6188662940b Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Remove GPL-3.0+ from license identifiersKai Köhne2023-01-061-1/+1
|/ | | | | | | | | | | | | | | Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0, this applies only to a hypothetical newer version of GPL, that doesn't exist yet. If such a version emerges, we can still decide to relicense... While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only Change was done by running find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \; Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* qmldesigner: cleanup connectTim Jenssen2022-11-151-3/+1
| | | | | Change-Id: Id19c49d7ca7d9f19acf971ae005c868e50aec44d Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-071-6/+6
| | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. Task-number: QTBUG-99313 Change-Id: I88edd91395849574436299b8badda21bb93bea39 Reviewed-by: hjk <hjk@qt.io>
* QmlDesigner: Use new validation approach in item libraryMarco Bubke2022-09-221-1/+1
| | | | | | | | Many validation tests can now be skipped. Task-number: QDS-7454 Change-Id: I84d5330d2666968eec757f70eceb73b45ce72383 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Remove static keyword for for internal linkingMarco Bubke2022-09-221-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | From cppreference: internal linkage The name can be referred to from all scopes in the current translation unit. Any of the following names declared at namespace scope have internal linkage: * variables, variable templates (since C++14), functions, or function templates declared static; * non-volatile non-template (since C++14) non-inline (since C++17) non- exported (since C++20) const-qualified variables (including constexpr) (since C++11) that aren't declared extern and aren't previously declared to have external linkage; * data members of anonymous unions. Change-Id: Ibbd7c3925ead59879039d4b266ebfda548c68744 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Use SPDX license identifiersLucie Gérard2022-08-261-24/+2
| | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Core: Remove #include <QMainWindow> from icore.hhjk2022-07-221-1/+1
| | | | | | | | | | Adapt users; also use dialogParent() instead of mainWindow() were appropriate. Change-Id: Ib60b118f05c986a70657446c5b2937074243bb5c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Drop Qt5: Qml lib / QmlDesigner: Get rid of QOverloadJarek Kobus2022-07-201-9/+8
| | | | | | | | Add a context object into some lambdas. Change-Id: I16ee7a0c061483e4d90c9e015852c41a4f3cde90 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlDesigner: Tweak 3D asset import dialog layoutMiikka Heikkinen2022-06-231-2/+2
| | | | | | | | | | On some font scalings, spinboxes were too tight, especially when there was just one row of options showing, so increased the row height and tweaked layout margins a bit. Fixes: QDS-7186 Change-Id: I0650ab976d96f27fc9cf606c4faa6fa2d7c5e8f4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Fix compile with Qt5Christian Stenger2022-04-081-4/+4
| | | | | | | Amends ca5efe78806. Forgotten in later patchsets of 1fd9b13101e. Change-Id: I07827d66d4d4dfe039c04c3724edff354ada9c49 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* QmlDesigner: Fix build with Qt5Miikka Heikkinen2022-04-081-3/+6
| | | | | | | Amends ca5efe78806. Change-Id: Idea65116baca345c2dff0777b6dbe285bfc4bbe4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* QmlDesigner: Hide advanced 3D model import optionsMiikka Heikkinen2022-04-081-73/+207
| | | | | | | | | | Only simple options are shown by default. Fixes: QDS-6574 Change-Id: Idb642d80ca8867dce95d3db4509d2ee454aa2be1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* QmlDesigner: Auto close 3D import dialog on successMiikka Heikkinen2022-04-051-1/+7
| | | | | | | | Fixes: QDS-6573 Change-Id: I790a88a683e1cf4ca846148a4cde01b07b2a1844 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: Fix path when importing a 3D model inside a componentMahmoud Badri2022-02-231-5/+3
| | | | | | | | Fixes: QDS-6319 Change-Id: Ia9dbdf9a2d32eaf996cca2ba84e89ca8111dab1c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Distiguish between cancel and fail when importing assetsMahmoud Badri2021-10-191-1/+4
| | | | | | | | When asset importing fails we show a warning, but not when the user cancels the importing. Change-Id: I950d3b43c0f7c78a5abfb31a1974d2a9cd193522 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Asset Import: Use double quotes for emphasis in UI textLeena Miettinen2021-03-221-4/+4
| | | | | Change-Id: Id9bdde4bcd1c0372f1d1e8ebc5accb75cda36af4 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix build with Qt 6Eike Ziller2021-02-261-1/+1
| | | | | | Change-Id: I67ffc389d7579ac98755ec99614ce9b3e4e07df5 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Update selected imported nodeMiikka Heikkinen2021-02-251-21/+159
| | | | | | | | | | | | | 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 <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Add missing "const" and "&" in range-basd for loopsAlessandro Portale2021-02-181-2/+2
| | | | | Change-Id: I93821f97fb1d8c3154bc03b8f54c504a6f712269 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: Use qAsConst with non-const Qt containers in range-loopsAlessandro Portale2021-02-181-1/+1
| | | | | Change-Id: I7fb1c012b4e6b0608c5888d58c7752b194baf78b Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: Allow uppercase file suffixes in asset importMiikka Heikkinen2021-02-051-1/+1
| | | | | | Fixes: QDS-3720 Change-Id: I2b4af981bed943e53847bb3480ced185e157b5e7 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* QmlDesigner: Move 3D asset import to puppetMiikka Heikkinen2021-02-051-17/+27
| | | | | | | | | | Moved 3D asset import to puppet to ensure import always uses the correct version of the QtQuick3D. Fixes: QDS-3154 Change-Id: I630a833e7231383b87bf8b7214d3545d12de15ab Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* Use static version of QFileInfo::exists()Jarek Kobus2020-11-161-1/+1
| | | | | | | | Docs say it's faster than creating QFileInfo object and calling exists(). Change-Id: I0c10216bf72ab11ebf97b66a113d85ac0768d918 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: performance-for-range-copyAlessandro Portale2020-06-141-1/+1
| | | | | | | | | | Avoid copying the loop variable on each iteration if a const reference would suffice. For QPointers<>, this change only adds a const. Change-Id: I5abe7d793cd46859a9a4f9304ec1bd41f899d72c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix importing asset when open doc is in project subfolderMiikka Heikkinen2020-04-231-10/+19
| | | | | | Change-Id: I9853dd9c6b919d2061e77bee12bfc6345848c846 Fixes: QDS-1823 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Ignore asset file suffix case when importing 3D assetsMiikka Heikkinen2019-10-231-1/+1
| | | | | | Change-Id: Ic742f5c6bec82718d99d472a26271cf500594e63 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Fix widget order in import dialog so spinboxes can receive mouse focusMiikka Heikkinen2019-10-231-5/+5
| | | | | | | | | | | The label needs to be created before the spinbox or the label will block the spinbox mouse events, as the tail end of the labels overlaps the non-checkbox control column to avoid unnecessary cutoff of the labels that do not have any non-checkbox controls. Change-Id: If7a7fd671b0dbb3f4c1ab5570217455e4978765e Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
* Implement support for UIA/UIP importingMiikka Heikkinen2019-10-151-287/+375
| | | | | | | | | | | Each different type of import file gets its own options tab in import dialog. Item library icon for each imported component is generated at import time depending on component root element type. Change-Id: I95824b43d251d02d8e032b6a3e45a18d1d509b80 Fixes: QDS-1152 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Minor tweak to UI based on UX commentsMiikka Heikkinen2019-10-091-1/+1
| | | | | | Change-Id: I6c39fb920bcd1220460950c2c9ae81c405929086 Fixes: QDS-1160 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* QmlDesigner: Fine tune import options dialogMiikka Heikkinen2019-10-091-45/+113
| | | | | | | | | | | | | | | Check boxes moved to before labels. Groups separated by separator line instead of indentation. If another non-boolean item has single boolean item as condition, and the boolean item is not a condition to any other item, the items are combined to single line. If this results in a single item group, the group is omitted. Grid utilizes available space better rather than be fixed size. Change-Id: I70845c6352f26f3fc4c4bfa86e46a32e5b099b9b Fixes: QDS-1117 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Fix build with GCC 5.3Eike Ziller2019-10-041-3/+3
| | | | | | | | It doesn't like overriding the same variable name within a ranged for loop. Change-Id: Ie326d6535d1556ffc809a7551e131740858d7dc2 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* Add import options to asset import dialogMiikka Heikkinen2019-10-041-12/+258
| | | | | | | | | Available import options are queried from the importer and displayed on the import dialog. Change-Id: Id47dde29f41a1c91042623ebbd1156c77434e3a3 Fixes: QDS-1101 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Create imported 3D assets initially in temporary directoryMiikka Heikkinen2019-10-011-2/+11
| | | | | | | | | | | | | Once all assets are created in the temporary diractory, cancel is disabled and all assets are copied to the final location. Canceling no longer immediately closes the dialog, so you can see what happened in the log. Change-Id: I8c2d261091b0963e0b34a71bc9171e1757da68df Fixes: QDS-1083 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Support importing 3D assets into Quick3D componentsMiikka Heikkinen2019-09-271-0/+229
Added import dialog for importing 3D assets. Generated Quick3D components are placed into a hardcoded path under an existing import directory, preferring an import path that ends with "asset_imports" folder. Import statements for imported assets are not automatically added to the current document. Instead, flow tags are generated for the available imports. If QtQuick3D import is missing, a flow tag for that is also generated. Item library entries for imported assets are created and grouped in their own group. Task-number: QDS-1051 Task-number: QDS-1053 Change-Id: I89cef9c0dc8b5a71a5cf25a6a184cef49c1090dc Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>