forked from linuxdeepin/deepin-unioncode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [templates] add template of Qt console
Log: as title
- Loading branch information
1 parent
a40bcb7
commit caffa28
Showing
4 changed files
with
124 additions
and
1 deletion.
There are no files selected for viewing
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,12 @@ | ||
cmake_minimum_required(VERSION 3.0.0) | ||
|
||
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
set(CMAKE_AUTOMOC ON) | ||
|
||
find_package(Qt5Core) | ||
|
||
add_executable(${PROJECT_NAME} main.cpp) | ||
|
||
target_link_libraries(${PROJECT_NAME} Qt5::Core) |
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,11 @@ | ||
#include <QtCore/QCoreApplication> | ||
#include <QDebug> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QCoreApplication a(argc, argv); | ||
|
||
qInfo() << "hello world"; | ||
|
||
return a.exec(); | ||
} |
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,92 @@ | ||
{ | ||
"version": 1, | ||
"type":"project", | ||
"wizardType":"QTCtype", | ||
"supportedProjectTypes": [ "CMakeProjectManager.CMakeProject", "Qbs.QbsProject", "Qt4ProjectManager.Qt4Project" ], | ||
"id": "E.QtCore", | ||
"category": "F.Application", | ||
"trDescription": "Creates a project containing a single main.cpp file with a stub implementation.\n\nPreselects a desktop Qt for building the application if available.", | ||
"trDisplayName": "Qt Console Application", | ||
"trDisplayCategory": "Application", | ||
"icon": "../../global/consoleapplication.png", | ||
"featuresRequired": [ "QtSupport.Wizards.FeatureQt" ], | ||
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}", | ||
|
||
"options": | ||
[ | ||
{ "key": "ProjectFile", "value": "%{JS: '%{BuildSystem}' === 'qmake' ? '%{ProFile}' : ('%{BuildSystem}' === 'cmake' ? '%{CMakeFile}' : '%{QbsFile}')}" }, | ||
{ "key": "ProFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'pro')}" }, | ||
{ "key": "QbsFile", "value": "%{JS: Util.fileName('%{ProjectDirectory}/%{ProjectName}', 'qbs')}" }, | ||
{ "key": "CMakeFile", "value": "%{ProjectDirectory}/CMakeLists.txt" }, | ||
{ "key": "CppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" } | ||
], | ||
|
||
"pages": | ||
[ | ||
{ | ||
"trDisplayName": "Project Location", | ||
"trShortTitle": "Location", | ||
"typeId": "Project", | ||
"data": { "trDescription": "This wizard creates a simple Qt-based console application." } | ||
}, | ||
{ | ||
"trDisplayName": "Define Build System", | ||
"trShortTitle": "Build System", | ||
"typeId": "Fields", | ||
"enabled": "%{JS: ! %{IsSubproject}}", | ||
"data": | ||
[ | ||
{ | ||
"name": "BuildSystem", | ||
"trDisplayName": "Build system:", | ||
"type": "ComboBox", | ||
"data": | ||
{ | ||
"index": 0, | ||
"items": | ||
[ | ||
{ | ||
"trKey": "CMake", | ||
"value": "cmake", | ||
"condition": "%{JS: [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"trDisplayName": "Kit Selection", | ||
"trShortTitle": "Kits", | ||
"typeId": "Kits", | ||
"enabled": "%{JS: ! %{IsSubproject}}", | ||
"data": { "projectFilePath": "%{ProjectFile}" } | ||
}, | ||
{ | ||
"trDisplayName": "Project Management", | ||
"trShortTitle": "Summary", | ||
"typeId": "Summary" | ||
} | ||
], | ||
"generators": | ||
[ | ||
{ | ||
"typeId": "File", | ||
"data": | ||
[ | ||
{ | ||
"source": "CMakeLists.txt", | ||
"openAsProject": true, | ||
"replaceKeys": ["%{ProjectName}"], | ||
"condition": "%{JS: '%{BuildSystem}' === 'cmake'}" | ||
}, | ||
|
||
{ | ||
"source": "main.cpp", | ||
"target": "%{CppFileName}", | ||
"openInEditor": true | ||
} | ||
] | ||
} | ||
] | ||
} |
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