-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move editor tools into editors folder (#4324)
Move editor tools into editors folder and add test QtCreator template
- Loading branch information
Showing
5 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions
41
editors/QtCreator/templates/wizards/qgis/qgis_test/file.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
% {Cpp: LicenseTemplate}\ | ||
#include "qgstest.h" | ||
#include <QObject> | ||
#include <qgsapplication.h> | ||
|
||
class % {CN}: public QObject | ||
{ | ||
|
||
Q_OBJECT | ||
|
||
private slots: | ||
void initTestCase(); // will be called before the first testfunction is executed. | ||
void cleanupTestCase() {} // will be called after the last testfunction was executed. | ||
void init() {} // will be called before each testfunction is executed. | ||
void cleanup() {} // will be called after every testfunction. | ||
|
||
// Add your test methods here | ||
}; | ||
|
||
void % {CN}::initTestCase() | ||
{ | ||
|
||
} | ||
|
||
void % {CN}::cleanupTestCase() | ||
{ | ||
|
||
} | ||
|
||
void % {CN}::init() | ||
{ | ||
|
||
} | ||
|
||
void % {CN}::cleanup() | ||
{ | ||
|
||
} | ||
|
||
QGSTEST_MAIN( % {CN} ) | ||
#include "%{JS: Cpp.classToFileName('%{Class}', '.moc')}" |
86 changes: 86 additions & 0 deletions
86
editors/QtCreator/templates/wizards/qgis/qgis_test/wizard.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"version": 1, | ||
"supportedProjectTypes": [ ], | ||
"id": "B.QGISTest", | ||
"category": "O.QGIS", | ||
"trDescription": "Creates a C++ QGIS Test", | ||
"trDisplayName": "QGIS C++ Test", | ||
"trDisplayCategory": "QGIS", | ||
"icon": "../qgis_icon.svg", | ||
"enabled": "%{JS: [ %{Plugins} ].indexOf('CppEditor') >= 0}", | ||
"platformIndependent" : true, | ||
|
||
"options": | ||
[ | ||
{ "key": "TargetPath", "value": "Test%{Path}" }, | ||
{ "key": "SrcPath", "value": "%{Path}/%{SrcFileName}" }, | ||
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" } | ||
], | ||
|
||
"pages": | ||
[ | ||
{ | ||
"trDisplayName": "Define Tests", | ||
"trShortTitle": "Details", | ||
"typeId": "Fields", | ||
"data" : | ||
[ | ||
{ | ||
"name": "Class", | ||
"trDisplayName": "Class name:", | ||
"mandatory": true, | ||
"type": "LineEdit", | ||
"data": { "validator": "(?:(?:[a-zA-Z_][a-zA-Z_0-9]*::)*[a-zA-Z_][a-zA-Z_0-9]*|)" } | ||
}, | ||
{ | ||
"name": "Sp1", | ||
"type": "Spacer", | ||
"data": { "factor": 2 } | ||
}, | ||
{ | ||
"name": "SrcFileName", | ||
"type": "LineEdit", | ||
"trDisplayName": "Source file:", | ||
"mandatory": true, | ||
"data": { "trText": "%{JS: Cpp.classToFileName('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++src')}')}" } | ||
}, | ||
{ | ||
"name": "Path", | ||
"type": "PathChooser", | ||
"trDisplayName": "Path:", | ||
"mandatory": true, | ||
"data": | ||
{ | ||
"kind": "existingDirectory", | ||
"basePath": "%{CurrentProject:Path}\\tests\\src\\", | ||
"path": "%{CurrentProject:Path}\\tests\\src\\" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"trDisplayName": "Project Management", | ||
"trShortTitle": "Summary", | ||
"typeId": "Summary" | ||
} | ||
], | ||
|
||
"generators": | ||
[ | ||
{ | ||
"typeId": "File", | ||
"data": | ||
[ | ||
{ | ||
"source": "file.cpp", | ||
"target": "%{SrcPath}", | ||
"openInEditor": true, | ||
"options": [ | ||
{ "key": "Cpp:License:FileName", "value": "%{SrcFileName}" }, | ||
{ "key": "Cpp:License:ClassName", "value": "%{CN}" } | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |