summaryrefslogtreecommitdiff
path: root/share/qtcreator/cplusplus
Commit message (Collapse)AuthorAgeFilesLines
* Replace GPL-3.0 with GPL-3.0-onlyKai Köhne2023-01-106-6/+6
| | | | | | | | | | | | | 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>
* Use SPDX license identifiersLucie Gérard2022-08-266-144/+12
| | | | | | | | | 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>
* Make share/qtcreator/cplusplus/examples compilableAlessandro Portale2022-02-044-23/+23
| | | | | | | | | Builds now, but does not link (which is fine). And unrelated, unintentional warnings were removed. Change-Id: I6ece33933bc20e6e36fb3859de7c2b774b0e67d5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Fix Q_PROPERTY warningMitch Curtis2021-06-141-1/+1
| | | | | | | | Explicitly cast to bool since that seems to be the intention. Fixes: QTBUG-90607 Change-Id: Ic7debcc6af4415af6288aa1739bd602dbca0e251 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* C++: Add source file to test icon supportChristian Kandeler2021-02-083-1/+92
| | | | | | Task-number: QTCREATORBUG-21867 Change-Id: Ie167608257bb8b7d268a05f1935d77659a075dc1 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* Clang: Fix error when including float.h with mingwChristian Kandeler2020-07-091-0/+34
| | | | | | | | | | | Prevent mingw from trying to #include_next a private header from a path we cannot add to our list of includes. Fixes: QTCREATORBUG-24251 Task-number: QTCREATORBUG-24027 Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45 Reviewed-by: Marco Bubke <marco.bubke@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* C++: Fix highlighting Q_PROPERTY with template typesChristian Kandeler2020-07-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | We override the Q_PROPERTY macro in our own header. This appears to have two effects: 1) The macro arguments are properly highlighted. 2) There is no completion from libclang for Q_PROPERTY, meaning our own helpful snippet is the only completion candidate. I don't understand the reason for either of these; they seem to be more or less random effects of parsing peculiarities. As it turns out, our macro redefinition breaks if the type of the property is based on a template class, leading to false errors in the code model. Removing our macro redefinition fixes the code model, but also removes the aforementioned effects. Turning the macro into a variadic macro fixes the code model and keeps effect 1), but not effect 2). Therefore, we also update the snippet to provide an extra string that makes it clear this it's a helpful snippt, rather than just a normal completion. Fixes: QTCREATORBUG-24243 Change-Id: I4044d5e633af3ebdba36032d5efd3333b5a36214 Reviewed-by: David Schulz <david.schulz@qt.io>
* Clang: Add cmake project for tidy/clazy demo codeNikolai Kosjar2019-07-261-0/+22
| | | | | | | | | ...as it's easier to generate a compile_commands.json with it as with qmake. Change-Id: I415b4d1d3d6d1d55c4d086c6dbbbca532c2c8669 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Fix tidy demo fileNikolai Kosjar2018-11-261-2/+0
| | | | | | | Revert unintended addition. Change-Id: I8ee78ee6e59f7fdc29d62df3e720c5c2dd706ada Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Move the majority of completion items sorting to ClangBackendIvan Donchevskii2018-10-021-0/+2
| | | | | | | | | | | | | | With this change ClangCodeModel only needs to sort completions by prefix. Also some other optimization have become possible and are implemented here: 1. Getting completions after '{' for constructor overloads by replacing it with '(' inside usaved file. 2. Checking for all overloads requires only previous item check because all Class completions are already sorted to go before all CXXConstructor completions. Since they are not mixed no extra search is required. Change-Id: Ie0187ad96a20857a63c1d71ddec74606b803f572 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Support old-style SIGNAL/SLOT macroIvan Donchevskii2018-05-031-0/+3
| | | | | | | | Color types and enable Ctrl+click for the functions and types inside SIGNAL/SLOT macros. Change-Id: Ic1c0b7372fe9a73c5607b1973d75a6656c75ef0e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Clang: Clean up qobjectdefs.hNikolai Kosjar2018-04-111-3/+1
| | | | | | | | * Remove unneeded #include that might lead to false diagnostics * Fix typo Change-Id: I38a3bbe07dbcb33f004c7b7a2a4ca4a90fb77350 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Fix parse errors in clazy/tidy demo projectNikolai Kosjar2018-04-042-6/+11
| | | | | | | ...otherwise not all intended diagnostics can be demonstrated. Change-Id: I2f69862cc6c8a2e58059d9075ad6fd7c7e72b4a5 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Clang: Make Q_PROPERTY replacement simplerIvan Donchevskii2018-02-231-8/+2
| | | | | | | | | | | The infrastructure around Q_PROPERTY extraction allows to make it static assert and still find it's parent. This way makes it easier for Clang to parse and does not provide unexisting functions for class. Change-Id: I1c40550c72d214c2448169094a46c6f793132f23 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Fix parsing for files which include qobjectdefs.hIvan Donchevskii2018-02-201-3/+3
| | | | | | | | For some reason did not work properly with include guards before #include_next. Change-Id: I4a314c0e4ff29487904e2daa64362c3e2a3e1859 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Provide example with clazy warningsIvan Donchevskii2018-02-202-1/+139
| | | | | Change-Id: I23cb81d0ffe0d23428ce85ba22d85e1d6c8c1216 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Provide example with a lot of tidy warningsIvan Donchevskii2018-02-203-0/+321
| | | | | Change-Id: I6d6d2559bb8e2b6c972e88c3af9ce06968e7c959 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Properly handle Q_PROPERTY in TokenInfoIvan Donchevskii2018-02-201-0/+17
| | | | | | | | | Transform Q_PROPERTY into unique AST node. Mark different parts with types and search for parent in FullTokenInfos. Change-Id: Iaa1ec0c73d34773edf5605d3682bd6a290d195de Reviewed-by: Marco Bubke <marco.bubke@qt.io>
* Clang: Fix tagging of slots with CONFIG+=no_keywordsNikolai Kosjar2017-01-031-1/+1
| | | | | | | | | For the CONFIG+=no_keywords case, Q_SLOTS expanded to the undefined "slots". Task-number: QTCREATORBUG-17371 Change-Id: I7891e4b0595647aa02c97c9f80d61f3f5459a61a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update all files in share folder Change-Id: I8a82c3eb2eb614d4339dd4c4e690f54b5f29d813 Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
* Clang: Free us from specific Qt versionsNikolai Kosjar2015-07-271-35/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | More precisely, free us from specific Q_MOC_RUN/QT_NO_META_MACROS code paths in QtCore/qobjectdefs.h. In order to track signals and slots we provided custom definitions of e.g. "Q_SIGNAL" by including qt5-qobjectdefs-injected.h with "-include". We also had to ensure that those macros were not overwritten by Qt's qobjectdefs.h, which we did by defining QT_NO_META_MACROS. However, this came with a cost: we needed to replicate all the other macro definitions in the Q_MOC_RUN/QT_NO_META_MACROS code path, e.g. Q_INTERFACES. This bound us to specific versions of qobjectdefs.h and occasionally we had to adapt (see change 4eafa2e02be4e659f8bb5f6ab020844174e82f47). The new approach wraps Qt's qobjectdefs.h with the help of "include_next". In the wrapper header, we only redefine what is necessary. The "include_next" directive is originally a GNU extension. Clang seems to support it unconditionally, as [1] implicitly states. [1] http://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros Change-Id: Ic1a263f94b178349cb32bfdbb074ad5e6e0761ee Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Clang: Handle Q_ENUM() and Q_FLAG() in qt5-qobjectdefs-injected.hNikolai Kosjar2015-06-241-0/+2
| | | | | | | | | Q_ENUM() and Q_FLAG() were added in Qt 5.5.0. This fixes among others red/wiggly underlines of these macro's uses. Change-Id: I059ebcc32cc271f4960b11e722e23c314c5ceac7 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* Clang: Respect QT_NO_*KEYWORDS in qt5-qobjectdefs-injected.hNikolai Kosjar2015-06-241-6/+14
| | | | | Change-Id: I299db813c13f273a40e447c5fdde8ff8757480ba Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* License updateEike Ziller2014-10-091-7/+8
| | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-091-1/+1
| | | | | Change-Id: I6e25ba25aa2898b5382dae7f3751deebb6072efa Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* Add experimental clang code-model plug-in.Erik Verbruggen2013-12-201-0/+60
Previously known as the wip/clang branch. Contributors (in alphabetical order): - Christian Kamm <christian.d.kamm@nokia.com> - Erik Verbruggen <erik.verbruggen@digia.com> - Leandro Melo <leandro.melo@nokia.com> - Peter Kuemmel <syntheticpp@gmx.net> - Sergey Shambir <sergey.shambir.auto@gmail.com> Change-Id: I4c3ff600a19b6732641c1d5ef28236bf2cc17737 Reviewed-by: hjk <hjk121@nokiamail.com>