-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73b8a5d
commit a17039e
Showing
6 changed files
with
70 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 |
---|---|---|
|
@@ -30,3 +30,6 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# macOS | ||
.DS_Store |
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,23 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(qtstarter) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
# Qt | ||
# Set this to your Qt installation | ||
set(CMAKE_PREFIX_PATH ~/sourcecode/sdk/QtLatest/5.9.2/clang_64) | ||
set(RESOURCE_FOLDER res) | ||
set(RESOURCE_FILES ${RESOURCE_FOLDER}/resources.qrc) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
find_package(Qt5Core REQUIRED) | ||
find_package(Qt5Quick REQUIRED) | ||
|
||
set(SOURCE_FILES main.cpp) | ||
|
||
add_executable(qtstarter ${SOURCE_FILES} ${RESOURCE_FILES}) | ||
|
||
target_link_libraries(qtstarter Qt5::Core Qt5::Quick) |
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 |
---|---|---|
@@ -1,2 +1,14 @@ | ||
# qtstarter | ||
C++/Qt5 CLion starter project with cmake build system | ||
C++/Qt5 CLion starter project with cmake build system and QtQuick support. | ||
|
||
## Usage | ||
Just clone or download the release and edit the CMakeList.txt to your needs. Especially the `CMAKE_PREFIX_PATH` variable. Set it to your Qt clang_64 path. | ||
|
||
## Test | ||
Tested with the following environment: | ||
|
||
- macOS Sierra 10.12.6 | ||
- CLion 2017.2.3 | ||
- Qt 5.9.2 clang_64 | ||
- CMake 3.10.0-rc1 | ||
|
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,15 @@ | ||
#include <QtCore> | ||
#include <QGuiApplication> | ||
#include <QtQuick/QQuickView> | ||
|
||
int main(int argc, char *argv[]) { | ||
|
||
QGuiApplication app(argc, argv); | ||
|
||
// Set qml file | ||
QQuickView viewer; | ||
viewer.setSource(QUrl("qrc:/views/main.qml")); | ||
viewer.show(); | ||
|
||
return app.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,6 @@ | ||
<!DOCTYPE RCC> | ||
<RCC version="1.0"> | ||
<qresource prefix="/"> | ||
<file>views/main.qml</file> | ||
</qresource> | ||
</RCC> |
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,10 @@ | ||
import QtQuick 2.0 | ||
|
||
Rectangle { | ||
width: 360 | ||
height: 360 | ||
Text { | ||
text: qsTr("Hello World") | ||
anchors.centerIn: parent | ||
} | ||
} |