diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-04-29 17:16:43 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-04-30 10:47:44 +0000 |
commit | a296b84dc46215ba333ddcd44cd45663d9b139b8 (patch) | |
tree | d7701e77784c1e07f0eff6c4db59c7b4d6fab7a6 /share/qtcreator/templates | |
parent | 24ec0b7708f44fe412532451d0a271c36cf27a00 (diff) |
Wizards: Fix include statements
The header file must be referenced relative to the location of the
source file.
Task-number: QTCREATORBUG-15599
Change-Id: Ib7d4aa5a62a94541cbe32cd340a8a1e7d6ef35e5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'share/qtcreator/templates')
6 files changed, 6 insertions, 6 deletions
diff --git a/share/qtcreator/templates/wizards/classes/cpp/file.cpp b/share/qtcreator/templates/wizards/classes/cpp/file.cpp index d102ecf4a1..6bf6885858 100644 --- a/share/qtcreator/templates/wizards/classes/cpp/file.cpp +++ b/share/qtcreator/templates/wizards/classes/cpp/file.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')} @if '%{IncludeQSharedData}' class %{CN}Data : public QSharedData diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp index a8cdf3164a..4a438f48e4 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/itemmodel.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ %{CN}::%{CN}(QObject *parent) diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp index 5d25d88609..b6c9c4b430 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/listmodel.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ %{CN}::%{CN}(QObject *parent) diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index 80bedf5899..cda910e6f7 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ %{CN}::%{CN}(QObject *parent) diff --git a/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp b/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp index 23bf7797da..dcdacae6d3 100644 --- a/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp +++ b/share/qtcreator/templates/wizards/projects/cpplibrary/lib.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" %{JS: Cpp.openNamespaces('%{Class}')}\ @if ! %{IsQtPlugin} diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/widget.cpp b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/widget.cpp index ee0d05a5ab..356e2444f6 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/widget.cpp +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/widget.cpp @@ -1,5 +1,5 @@ %{Cpp:LicenseTemplate}\ -#include "%{HdrFileName}" +#include "%{JS: Util.relativeFilePath('%{Path}/%{HdrFileName}', '%{Path}' + '/' + Util.path('%{SrcFileName}'))}" @if %{GenerateForm} #include "%{UiHdrFileName}" @endif |