aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/modelinglib
Commit message (Collapse)AuthorAgeFilesLines
* Use QString::size() instead QString::length()hjk2025-11-135-51/+51
| | | | | | | Minor gain in debug builds and when stepping. Change-Id: I2540d309661e4babfd7331b068c17657ded2a098 Reviewed-by: David Schulz <david.schulz@qt.io>
* Modelinglib: Increase object bounding boxJochen Becher2025-10-151-1/+1
| | | | | Change-Id: I817b17259f3057ccbf9ba65f34e1977ddc5680fc Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Use QStringList instead of QList<QString>Alessandro Portale2025-10-0230-83/+83
| | | | | Change-Id: I56fabbfe32ab579ef5e9f7c8cc5fde220b99769a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Avoid calling throwing functionsEike Ziller2025-09-011-1/+1
| | | | | | | | | | | | Result is a std::expected, so Result::value() throws. We don't use or handle exceptions and always explicitly check before accessing, so this is not useful, and static analyzers complain. Use the non-checking and non-throwing operator* and operator-> instead. Change-Id: I03cc9a97fa9f04da557837c2a5076828dcb7d0e0 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Return size_t from qHash overloadshjk2025-08-204-6/+6
| | | | | | | | | | | | The 'auto' trick was only needed for the Qt 5 -> Qt 6 transition, and it's unlikely that we will need it again. There's still quite some variety in implementation patterns, especially when it comes to Qt namespace and seed handling. Change-Id: I4eaadccc0f3172be793007652f35b1755cf3600e Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ModelingLib: Avoid [=] captureJarek Kobus2025-07-212-6/+6
| | | | | Change-Id: Ifb6129d05bb3c5be8e0572ea90222e6aec6a057d Reviewed-by: hjk <hjk@qt.io>
* Utils: Return QString from FilePath::relativePathFromDir()hjk2025-07-156-12/+12
| | | | | | | | | | | | | | | | | | FilePathification went a bit too far there: The result here can only be used in connection to another "anchor" path, and almost all users immediately converted it to a string, one way or the other. So paddle back, and adjust callers. For the few places that wanted to use the native separators in the result, provide FilePath::relativeNativePathFromDir() as the OS cannot be determined from the string alone. Api: Utils::FilePath::relativePathFromDir() returns now QString instead of Utils::FilePath Change-Id: Ide9683989930f960fa19f8e778036abde6801e89 Reviewed-by: David Schulz <david.schulz@qt.io>
* Remove some spaces and line breaks from translatable stringsEike Ziller2025-05-141-1/+1
| | | | | | | ... and add them in code where necessary instead. Change-Id: I2e6a2a0318bad055766f3d6c92ae0ffe08cb138a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix warning for ';'Marco Bubke2025-04-152-2/+2
| | | | | | | | The macro already contain a ';'. Removing the argument or [[maybe_unused]] would maybe even a better approach. Change-Id: I31750d10a4f252c667e7c0e5e13bf1085dbe11a2 Reviewed-by: hjk <hjk@qt.io>
* qbs build: Fix deprecation warningsChristian Kandeler2025-02-041-2/+2
| | | | | | | Also update qmltypes file. Change-Id: Iadd7c7e55ae3fd38302eb2a1c09e19a281b94cb3 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Utils: Rename FilePath::toString() into toUrlishString()hjk2025-01-101-1/+1
| | | | | | | | | | | | | | | | toString() is almost always the wrong conversion, but unfortunately too easy to find and often even working at least for local setup. This here raises the bar as the non-availability of the "obvious" toString() hopefully helps people to think about the semantics of the needed conversion and choose the right toXXX() function. The chosen new name is intentional ugly to reduce the likelihood that this (still almost always wrong) function is used out of convenience. Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ModelingLib: Fix deprecation warningAlessandro Portale2024-09-111-1/+1
| | | | | | | "warning: ‘int QMouseEvent::x() const’ is deprecated: Use position()" Change-Id: Icb61991c68d7a596ed01a6b7a5c592348055a774 Reviewed-by: hjk <hjk@qt.io>
* qbs build: Do not use relative paths in Export itemsv14.0.0-rc1Christian Kandeler2024-07-081-2/+2
| | | | | | | | Those will be interpreted relative to the importing product in the future. Change-Id: I57f6159053acf1e0334d3289de1f93545e2e871b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Fix some random deprecation warninghjk2024-06-062-5/+5
| | | | | | | | | | if QT_DEPRECATED_SINCE(6, 0) QT_DEPRECATED_VERSION_X_6_0("Use position().toPoint()") inline QPoint pos() const { return position().toPoint(); } ... Change-Id: If885b26c8e5f4d68ca1c5c7e4ffc495b0701b210 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Modeling: Fix some Qt 6.6 deprecation warningshjk2024-06-051-8/+4
| | | | | | Change-Id: I850bff960601595d3273f3a8dedd3f7e6830e9ba Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: hjk <hjk@qt.io>
* Utils: Make contents margins handling less specialhjk2024-06-041-3/+3
| | | | | Change-Id: I985419bbb213aba899c83efb49b376e0f3338bd5 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* ModelEditor: More use of Utils::FilePathJochen Becher2024-05-1716-57/+91
| | | | | Change-Id: Ib1030959ae5eea763d3b93684b68ae6ae927839b Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* ModelEditor: Use Utils::FilePathJochen Becher2024-05-1016-84/+109
| | | | | | | | | More replacements of QString with Utils::FilePath and removal of QFileInfo and QDir will follow. Change-Id: Iceec1c009c562bd9a05f9ab1d1a9f83ad48a4467 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* ModelEditor: Inline addrelatedelementsdialog.uiAlessandro Portale2024-05-025-218/+69
| | | | | | | | Change-Id: I53f9ec87030c4ac41ff34f61a54dd10a866b8c33 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jochen Becher <jochen_becher@gmx.de>
* ModelEditor: Inline modeltreefilter.uiAlessandro Portale2024-05-025-348/+102
| | | | | | | Change-Id: I03925b708ac1741f6342023b455b0280a8bce584 Reviewed-by: Jochen Becher <jochen_becher@gmx.de> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* ModelEditor: Improve panningJochen Becher2024-04-222-1/+45
| | | | | | Change-Id: Iacb3e2bb9006d306852f18b50bbec322abb5acdf Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ModelEditor: Improve selection and layout of elementsAlessandro Portale2024-04-1813-49/+124
| | | | | | Change-Id: I199e2c4402519479cb098ae2c6665cd7f0ea12a1 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Merge remote-tracking branch 'origin/13.0'Eike Ziller2024-04-171-1/+3
|\ | | | | | | Change-Id: I0892d8e54930bb5a65dc51117b8ca7d70ce300a3
| * ModelEditor: Fix crash when selecting an elementDavid Faure2024-04-151-1/+3
| | | | | | | | | | | | | | | | | | Same fix as in commit 22f41fb751cd5b1b136e0c7fa15d8e3163bc912e but in a different method. Fixes: QTCREATORBUG-30413 Change-Id: I69790707005edc26c7d3e943d86db132184298e9 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
* | ModelEditor: Add model tree filterJochen Becher2024-04-1711-0/+850
| | | | | | | | | | | | | | | | | | A new button in the top bar opens a filter for the model tree which allows quick search for model elements Change-Id: Ibfe229890cb79e64fdbbe62f74681add102b5ccf Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | ModelEditor: Fix linked files supportJochen Becher2024-04-171-0/+6
| | | | | | | | | | | | | | | | Adding missed integration of one change for linked files. Change-Id: Ie3c98ef8ab013c67fe8d1b12ae9ac5d7f4556161 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | ModelEditor: Add dialog for adding related elementsJochen Becher2024-04-168-10/+678
| | | | | | | | | | | | Change-Id: Iae832885278472bb42a588fc97967ae5ffad6b71 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* | ModelEditor: Support linked files and custom imagesJochen Becher2024-04-1629-343/+552
| | | | | | | | | | | | Change-Id: I1a5f8b19a4890e0bcbd5a2cf70fdee2cadf62a98 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* | Add more visual attributes for relationsJochen Becher2024-04-1030-82/+725
|/ | | | | | Change-Id: I56af6a367c144e22c8113f69a2938080ddb2e750 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ModelEditor: Fix crash when selecting itemsMarcus Tillmanns2024-03-071-1/+3
| | | | | | Fixes: QTCREATORBUG-30413 Change-Id: Ie637e20d6308da2e1afcf3ff710f29c6a1695d58 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* ModelingLib: Avoid using keys()Jarek Kobus2024-01-111-6/+4
| | | | | | | | | | | Instead, iterate directly over the container. Notably, sorting the result of keys() didn't play any significant role in this contexts. Change-Id: Iba82f3d503143ff0036509d0bf08c87747aeb40c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* ModelingLib: Hide areStackingRoles() in cppJarek Kobus2024-01-112-33/+28
| | | | | | | | Make it static. Change-Id: I05786425ade0d942b0e83349dc959a5dce72813e Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Clean up some lambdashjk2023-12-123-5/+4
| | | | | Change-Id: Id947c0935b1aa4579e1c64d3e510db41103fbe27 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Random warning cleanuphjk2023-12-081-9/+7
| | | | | | | Clang16 in C++20 mode. Change-Id: I87801e362a3ba6e38cfebd319a7aee2ed4e45568 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Various Plugins: Simplify return QList statementsJarek Kobus2023-08-022-2/+2
| | | | | | | Change-Id: I36633128e061d0544e4752a65804b460371283f7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Remove a few unnecessary Q_OBJECThjk2023-07-1411-34/+16
| | | | | | Change-Id: I4c84f264045797c70ec3022e3705f63341a1e7d9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Translations: Change translation context prefix from "::" to "QtC::"Alessandro Portale2023-02-101-1/+1
| | | | | | | lupdate would be confused by translation contexts starting with :: Change-Id: Ie95e73436fd3cafc80a8e89f908efadc747e644c Reviewed-by: hjk <hjk@qt.io>
* ModelingLib: Tr::tr()Alessandro Portale2023-02-1016-166/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Following orphaned contexts are merged into ::qmt qmt::ClassItem qmt::DiagramController qmt::DiagramSceneController qmt::DocumentController qmt::Exception qmt::FileCreationException qmt::FileNotFoundException qmt::FileReadError qmt::FileWriteError qmt::IllegalXmlFile qmt::ModelController qmt::ModelTreeView qmt::NullPointerException qmt::ObjectItem qmt::ProjectController qmt::PropertiesView::MView qmt::TreeModel qmt::UnknownFileVersion qmt::V Change-Id: Iaf98c2bfc654452d44f6bed155be6ddfe7556b19 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Translations: Prefix translation contexts for libraries with "::"Alessandro Portale2023-01-261-1/+1
| | | | | Change-Id: I0631ad6fdc9f341a162d879e54ff09fbdb74398e Reviewed-by: hjk <hjk@qt.io>
* Replace GPL-3.0 with GPL-3.0-onlyKai Köhne2023-01-10312-312/+312
| | | | | | | | | | | | | GPL-3.0 is deprecated by SPDX. Change done by find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \; Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939 Reviewed-by: Lucie Gerard <lucie.gerard@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* 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>
* CMake build: Use version-less Qt targetsEike Ziller2023-01-051-1/+1
| | | | | | | | | Since we do not support Qt < 5.15 anymore, and as a first step for getting rid of our special FindQt5.cmake. Change-Id: Icc5dbaf9b0a3a622b1f609ff114b9decb6d2856c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* modelinglib: Remove foreach usage part 2Artem Sokolovskii2023-01-0317-78/+94
| | | | | Change-Id: Ia898cc019a0534a97d20a3dc48e69c6617773766 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* modelinglib: Remove foreach usage part 1Artem Sokolovskii2022-12-2217-43/+49
| | | | | | | Change-Id: Ib185d0dbe7df2e5452502278d9a2c3151cf9812e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
* Use M_PI for 3.14Jarek Kobus2022-11-252-2/+2
| | | | | | | Change-Id: I19078a791afa1c74cd34e59b033525e029755d7e Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* ModelingLib: Replace foreach with range-based for loopsJarek Kobus2022-11-249-101/+124
| | | | | | Change-Id: I3e51c9477b6995ec06b119fb4518a53aa1d71ec9 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Utils: Add sorted() functionChristian Kandeler2022-10-251-2/+1
| | | | | | | | | For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-072-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>
* ModelingLib: Limit the usage of qMakePairJarek Kobus2022-09-306-149/+147
| | | | | Change-Id: Ic89f2a9598faadbda964f71dbe84bfd5400aec4f Reviewed-by: hjk <hjk@qt.io>
* Remove outdated version checksRobert Löhning2022-09-121-4/+0
| | | | | | Change-Id: I972a7fe0842a0310ba5df1233a4f417627dad87c Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>