-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 18.0.0
-
None
-
-
81de42a1c (18.0)
The refactoring function "Move Class to a Dedicated Set of Source Files" from right click context menu on class declaration may move the definition "class Q_CORE_EXPORT QObject {...}" from qobject.h in the tool chain to the newly created source file leaving behind an unusable tool chain.
If QtCreator has no write permission on qobject.h it will spawn a dialog window to ask for these permissions.
Inheriting from a QObject derived class seems necessary. See the attached example with Readme
If you run this on a toolchain where the user running QtCreator has no write permissions on the toolchain: * open QtCreatorProject/QtCreatorBugMinimalExample/QtCreatorBugMinimalExample.pro in QtCreator * open the file class.hpp * right click on the class name "classB" in the class declaration * select "refactor" * select "Move class to a dedicated set of source files" * confirm the **first** following dialog * you will now see a dialog prompting you to give write permissions on qobject.h - ABORT THIS! * now look at the newly created source file and find definitions for Qobject
This has been encountered with with QtCreator 18.0.0 from from qt-online-installer and the accompanying tool chain.
IMHO QtCreator should never write to headers in the tool chain. I even think write access outside project directory and build directory is suspicious. QtCreator already generates a notification if a header file from outside the project directory is opened in the editor (and rightfully so).
| For Gerrit Dashboard: QTCREATORBUG-33752 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 690956,2 | CppEditor: Ignore macro-expanded symbols | 18.0 | qt-creator/qt-creator | Status: MERGED | +2 | +1 |