Files
qt-creator/share/qtcreator/templates/wizards/classes/cpp/file.h
Tobias Hunger 9e72dc343c Wizards: C++11-ify code generated by JSON wizards
Task-number: QTCREATORBUG-16983
Change-Id: I1f936f25f4e9756239e04d677cec92316e3dc75b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-10-28 11:07:23 +00:00

57 lines
2.0 KiB
C++

%{Cpp:LicenseTemplate}\
#ifndef %{GUARD}
#define %{GUARD}
%{JS: QtSupport.qtIncludes([ ( '%{IncludeQObject}' ) ? 'QtCore/%{IncludeQObject}' : '',
( '%{IncludeQWidget}' ) ? 'QtGui/%{IncludeQWidget}' : '',
( '%{IncludeQMainWindow}' ) ? 'QtGui/%{IncludeQMainWindow}' : '',
( '%{IncludeQDeclarativeItem}' ) ? 'QtDeclarative/%{IncludeQDeclarativeItem}' : '',
( '%{IncludeQSharedData}' ) ? 'QtCore/QSharedDataPointer' : '' ],
[ ( '%{IncludeQObject}' ) ? 'QtCore/%{IncludeQObject}' : '',
( '%{IncludeQWidget}' ) ? 'QtWidgets/%{IncludeQWidget}' : '',
( '%{IncludeQMainWindow}' ) ? 'QtWidgets/%{IncludeQMainWindow}' : '',
( '%{IncludeQDeclarativeItem}' ) ? 'QtQuick1/%{IncludeQDeclarativeItem}' : '',
( '%{IncludeQQuickItem}' ) ? 'QtDeclarative/%{IncludeQQuickItem}' : '',
( '%{IncludeQSharedData}' ) ? 'QtCore/QSharedDataPointer' : '' ])}\
%{JS: Cpp.openNamespaces('%{Class}')}
@if '%{IncludeQSharedData}'
class %{CN}Data;
@endif
@if '%{Base}'
class %{CN} : public %{Base}
@else
class %{CN}
@endif
{
@if %{isQObject}
Q_OBJECT
@endif
public:
@if '%{Base}' === 'QObject'
explicit %{CN}(QObject *parent = nullptr);
@elsif '%{Base}' === 'QWidget' || '%{Base}' === 'QMainWindow'
explicit %{CN}(QWidget *parent = nullptr);
@else
%{CN}();
@endif
@if '%{IncludeQSharedData}'
%{CN}(const %{CN} &);
%{CN} &operator=(const %{CN} &);
~%{CN}();
@endif
@if %{isQObject}
signals:
public slots:
@endif
@if '%{IncludeQSharedData}'
private:
QSharedDataPointer<%{CN}Data> data;
@endif
};
%{JS: Cpp.closeNamespaces('%{Class}')}
#endif // %{GUARD}\