├── .gitignore ├── Cpp-qml-integration.pro ├── LICENSE.txt ├── README.md ├── android ├── AndroidManifest.xml ├── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ └── values │ └── strings.xml ├── assets └── felgo-logo.png ├── ios ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x-1.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x-1.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x-1.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ ├── Icon-App-83.5x83.5@2x.png │ │ └── ItunesArtwork@2x.png │ ├── Contents.json │ └── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── Default1125x2436.png │ │ ├── Default1242x2208.png │ │ ├── Default1536x2048.png │ │ ├── Default2048x1536.png │ │ ├── Default2208x1242.png │ │ ├── Default2436x1125.png │ │ ├── Default640x1136.png │ │ ├── Default640x960.png │ │ ├── Default750x1334.png │ │ └── Default768x1024.png └── Project-Info.plist ├── macx └── app_icon.icns ├── main.cpp ├── myglobalobject.cpp ├── myglobalobject.h ├── myqmltype.cpp ├── myqmltype.h ├── qml ├── Main.qml └── config.json ├── resources.qrc └── win ├── app_icon.ico └── app_icon.rc /.gitignore: -------------------------------------------------------------------------------- 1 | ### Qt ### 2 | 3 | # Qt-es 4 | 5 | /.qmake.cache 6 | /.qmake.stash 7 | *.pro.user 8 | *.pro.user.* 9 | *.moc 10 | moc_*.cpp 11 | qrc_*.cpp 12 | ui_*.h 13 | Makefile* 14 | *-build-* 15 | 16 | # QtCreator 17 | 18 | *.autosave 19 | 20 | /vendor/google-play-services_lib/bin 21 | /vendor/google-play-services_lib/gen 22 | -------------------------------------------------------------------------------- /Cpp-qml-integration.pro: -------------------------------------------------------------------------------- 1 | # allows to add DEPLOYMENTFOLDERS and links to the Felgo library and QtCreator auto-completion 2 | CONFIG += felgo 3 | 4 | # uncomment this line to add the Live Client Module and use live reloading with your custom C++ code 5 | #CONFIG += felgo-live 6 | 7 | qmlFolder.source = qml 8 | DEPLOYMENTFOLDERS += qmlFolder # comment for publishing 9 | 10 | assetsFolder.source = assets 11 | DEPLOYMENTFOLDERS += assetsFolder 12 | 13 | # Add more folders to ship with the application here 14 | 15 | RESOURCES += # resources.qrc # uncomment for publishing 16 | 17 | # NOTE: for PUBLISHING, perform the following steps: 18 | # 1. comment the DEPLOYMENTFOLDERS += qmlFolder line above, to avoid shipping your qml files with the application (instead they get compiled to the app binary) 19 | # 2. uncomment the resources.qrc file inclusion and add any qml subfolders to the .qrc file; this compiles your qml files and js files to the app binary and protects your source code 20 | # 3. change the setMainQmlFile() call in main.cpp to the one starting with "qrc:/" - this loads the qml files from the resources 21 | # for more details see the "Deployment Guides" in the Felgo Documentation 22 | 23 | # during development, use the qmlFolder deployment because you then get shorter compilation times (the qml files do not need to be compiled to the binary but are just copied) 24 | # also, for quickest deployment on Desktop disable the "Shadow Build" option in Projects/Builds - you can then select "Run Without Deployment" from the Build menu in Qt Creator if you only changed QML files; this speeds up application start, because your app is not copied & re-compiled but just re-interpreted 25 | 26 | 27 | # The .cpp file which was generated for your project. Feel free to hack it. 28 | 29 | 30 | HEADERS += \ 31 | myglobalobject.h \ 32 | myqmltype.h 33 | 34 | SOURCES += main.cpp \ 35 | myglobalobject.cpp \ 36 | myqmltype.cpp 37 | 38 | android { 39 | ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android 40 | OTHER_FILES += android/AndroidManifest.xml android/build.gradle 41 | } 42 | 43 | ios { 44 | QMAKE_INFO_PLIST = ios/Project-Info.plist 45 | OTHER_FILES += $$QMAKE_INFO_PLIST 46 | 47 | } 48 | 49 | # set application icons for win and macx 50 | win32 { 51 | RC_FILE += win/app_icon.rc 52 | } 53 | macx { 54 | ICON = macx/app_icon.icns 55 | } 56 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2018 V-Play GmbH 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | Permission is NOT granted to merge, publish, distribute, sublicense and/or 11 | sell the provided image, audio and video files of this software. 12 | 13 | You may not redistribute the source code under the name of Felgo or any 14 | other V-Play related trademarks. 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![ScreenShot](http://felgo.com/support/felgo-logo.png) 2 | 3 | # FelgoCppQML Example 4 | Application Development with QML is simple and powerful. But Qt C++ offers many features, is faster and less error-prone. This post shows you how to create apps that take advantage of both languages. 5 | 6 | ![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+) THIS EXAMPLE HAS BEEN MOVED ![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+)![#f03c15](https://via.placeholder.com/15/f03c15/000000?text=+) 7 | ----------- 8 | This example has been moved, please refer to: https://github.com/FelgoSDK/Demos-Examples/tree/master/appdemos/cpp-qml-integration 9 | 10 | Where to get help 11 | ----------------- 12 | If you need any help feel free to ask in the Felgo Forums https://felgo.com/developers/forums/ or have a look at our online documentation https://felgo.com/doc/. 13 | 14 | Contribution guidelines 15 | ----------------------- 16 | Currently there are no features open, but if you like to contribute use the code standards coming with the Felgo SDK. 17 | 18 | Contributor list 19 | ---------------- 20 | Felgo Team 21 | 22 | Credits 23 | ------- 24 | V-Play GmbH 25 | 26 | Contact us 27 | ---------- 28 | - Forum: https://felgo.com/developers/forums/ 29 | - Twitter: https://www.twitter.com/FelgoSDK/ 30 | - Facebook: https://www.facebook.com/FelgoSDK/ 31 | - E-Mail: support@felgo.com 32 | 33 | License 34 | ------- 35 | The app sourcecode is released under the MIT license. 36 | 37 | Permission is NOT granted to merge, publish, distribute, sublicense and/or 38 | sell the provided image, audio and video files of this software. 39 | 40 | If You have any questions about those Agreements, please write to support@felgo.com 41 | or visit https://felgo.com/. 42 | -------------------------------------------------------------------------------- /android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | 55 | 56 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:2.3.3' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | maven { url 'https://maven.google.com' } 14 | jcenter() 15 | maven { url 'https://sdk.v-play.net/maven/' } 16 | } 17 | } 18 | 19 | apply plugin: 'com.android.application' 20 | 21 | dependencies { 22 | compile fileTree(dir: 'libs', include: ['*.jar']) 23 | } 24 | 25 | android { 26 | /******************************************************* 27 | * The following variables: 28 | * - androidBuildToolsVersion, 29 | * - androidCompileSdkVersion 30 | * - qt5AndroidDir - holds the path to qt android files 31 | * needed to build any Qt application 32 | * on Android. 33 | * 34 | * are defined in gradle.properties file. This file is 35 | * updated by QtCreator and androiddeployqt tools. 36 | * Changing them manually might break the compilation! 37 | *******************************************************/ 38 | 39 | compileSdkVersion androidCompileSdkVersion.toInteger() 40 | buildToolsVersion androidBuildToolsVersion 41 | 42 | defaultConfig.applicationId = 'com.yourcompany.wizardEVP.FelgoCppQML' 43 | 44 | sourceSets { 45 | main { 46 | manifest.srcFile 'AndroidManifest.xml' 47 | java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] 48 | aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] 49 | res.srcDirs = [qt5AndroidDir + '/res', 'res'] 50 | resources.srcDirs = ['src'] 51 | renderscript.srcDirs = ['src'] 52 | assets.srcDirs = ['assets'] 53 | jniLibs.srcDirs = ['libs'] 54 | } 55 | } 56 | 57 | lintOptions { 58 | abortOnError false 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/android/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FelgoCppQML 4 | 5 | -------------------------------------------------------------------------------- /assets/felgo-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/assets/felgo-logo.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-App-20x20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-29x29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@2x-1.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-40x40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-76x76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-83.5x83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "ItunesArtwork@2x.png", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | }, 116 | "properties" : { 117 | "pre-rendered" : true 118 | } 119 | } -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "extent" : "full-screen", 5 | "idiom" : "iphone", 6 | "subtype" : "2436h", 7 | "filename" : "Default1125x2436.png", 8 | "minimum-system-version" : "11.0", 9 | "orientation" : "portrait", 10 | "scale" : "3x" 11 | }, 12 | { 13 | "extent" : "full-screen", 14 | "idiom" : "iphone", 15 | "subtype" : "2436h", 16 | "filename" : "Default2436x1125.png", 17 | "minimum-system-version" : "11.0", 18 | "orientation" : "landscape", 19 | "scale" : "3x" 20 | }, 21 | { 22 | "extent" : "full-screen", 23 | "idiom" : "iphone", 24 | "subtype" : "736h", 25 | "filename" : "Default1242x2208.png", 26 | "minimum-system-version" : "8.0", 27 | "orientation" : "portrait", 28 | "scale" : "3x" 29 | }, 30 | { 31 | "extent" : "full-screen", 32 | "idiom" : "iphone", 33 | "subtype" : "736h", 34 | "filename" : "Default2208x1242.png", 35 | "minimum-system-version" : "8.0", 36 | "orientation" : "landscape", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "extent" : "full-screen", 41 | "idiom" : "iphone", 42 | "subtype" : "667h", 43 | "filename" : "Default750x1334.png", 44 | "minimum-system-version" : "8.0", 45 | "orientation" : "portrait", 46 | "scale" : "2x" 47 | }, 48 | { 49 | "orientation" : "portrait", 50 | "idiom" : "iphone", 51 | "filename" : "Default640x960.png", 52 | "extent" : "full-screen", 53 | "minimum-system-version" : "7.0", 54 | "scale" : "2x" 55 | }, 56 | { 57 | "extent" : "full-screen", 58 | "idiom" : "iphone", 59 | "subtype" : "retina4", 60 | "filename" : "Default640x1136.png", 61 | "minimum-system-version" : "7.0", 62 | "orientation" : "portrait", 63 | "scale" : "2x" 64 | }, 65 | { 66 | "orientation" : "portrait", 67 | "idiom" : "ipad", 68 | "filename" : "Default768x1024.png", 69 | "extent" : "full-screen", 70 | "minimum-system-version" : "7.0", 71 | "scale" : "1x" 72 | }, 73 | { 74 | "orientation" : "portrait", 75 | "idiom" : "ipad", 76 | "filename" : "Default1536x2048.png", 77 | "extent" : "full-screen", 78 | "minimum-system-version" : "7.0", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "orientation" : "landscape", 83 | "idiom" : "ipad", 84 | "filename" : "Default2048x1536.png", 85 | "extent" : "full-screen", 86 | "minimum-system-version" : "7.0", 87 | "scale" : "2x" 88 | } 89 | ], 90 | "info" : { 91 | "version" : 1, 92 | "author" : "xcode" 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default1125x2436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default1125x2436.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default1242x2208.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default1242x2208.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default1536x2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default1536x2048.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default2048x1536.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default2048x1536.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default2208x1242.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default2208x1242.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default2436x1125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default2436x1125.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default640x1136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default640x1136.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default640x960.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default640x960.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default750x1334.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default750x1334.png -------------------------------------------------------------------------------- /ios/Assets.xcassets/LaunchImage.launchimage/Default768x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/ios/Assets.xcassets/LaunchImage.launchimage/Default768x1024.png -------------------------------------------------------------------------------- /ios/Project-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDisplayName 6 | FelgoCppQML 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.wizardEVP.FelgoCppQML 11 | CFBundleName 12 | ${PRODUCT_NAME} 13 | CFBundlePackageType 14 | APPL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | UIStatusBarHidden 22 | 23 | LSRequiresIPhoneOS 24 | 25 | UIViewControllerBasedStatusBarAppearance 26 | 27 | CFBundleAllowMixedLocalizations 28 | 29 | UIRequiresFullScreen 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | 40 | NSPhotoLibraryUsageDescription 41 | App would like to access the library. 42 | NSCameraUsageDescription 43 | App would like to access the camera. 44 | 45 | 46 | -------------------------------------------------------------------------------- /macx/app_icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/macx/app_icon.icns -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | // include qml context, required to add a context property 7 | #include 8 | 9 | // include custom classes 10 | #include "myglobalobject.h" 11 | #include "myqmltype.h" 12 | 13 | // uncomment this line to add the Live Client Module and use live reloading with your custom C++ code 14 | //#include 15 | 16 | int main(int argc, char *argv[]) 17 | { 18 | 19 | QApplication app(argc, argv); 20 | 21 | FelgoApplication felgo; 22 | 23 | // QQmlApplicationEngine is the preferred way to start qml projects since Qt 5.2 24 | // if you have older projects using Qt App wizards from previous QtCreator versions than 3.1, please change them to QQmlApplicationEngine 25 | QQmlApplicationEngine engine; 26 | felgo.initialize(&engine); 27 | 28 | // use this during development 29 | // for PUBLISHING, use the entry point below 30 | felgo.setMainQmlFileName(QStringLiteral("qml/Main.qml")); 31 | 32 | // use this instead of the above call to avoid deployment of the qml files and compile them into the binary with qt's resource system qrc 33 | // this is the preferred deployment option for publishing games to the app stores, because then your qml files and js files are protected 34 | // to avoid deployment of your qml files and images, also comment the DEPLOYMENTFOLDERS command in the .pro file 35 | // also see the .pro file for more details 36 | // felgo.setMainQmlFileName(QStringLiteral("qrc:/qml/Main.qml")); 37 | 38 | // add global c++ object to the QML context as a property 39 | MyGlobalObject* myGlobal = new MyGlobalObject(); 40 | myGlobal->doSomething("TEXT FROM C++"); 41 | engine.rootContext()->setContextProperty("myGlobalObject", myGlobal); // the object will be available in QML with name "myGlobalObject" 42 | 43 | // register a QML type made with C++ 44 | qmlRegisterType("com.yourcompany.xyz", 1, 0, "MyQMLType"); // MyQMLType will be usable with: import com.yourcompany.xyz 1.0 45 | 46 | 47 | engine.load(QUrl(felgo.mainQmlFileName())); 48 | 49 | // to start your project as Live Client, comment (remove) the lines "felgo.setMainQmlFileName ..." & "engine.load ...", 50 | // and uncomment the line below 51 | // FelgoLiveClient client (&engine); 52 | 53 | return app.exec(); 54 | } 55 | -------------------------------------------------------------------------------- /myglobalobject.cpp: -------------------------------------------------------------------------------- 1 | #include "myglobalobject.h" 2 | #include 3 | 4 | MyGlobalObject::MyGlobalObject() : m_counter(0) 5 | { 6 | // perform custom initialization steps here 7 | } 8 | 9 | void MyGlobalObject::doSomething(const QString &text) { 10 | qDebug() << "MyGlobalObject doSomething called with" << text; 11 | setCounter(m_counter + 1); 12 | } 13 | 14 | int MyGlobalObject::counter() const { 15 | return m_counter; 16 | } 17 | 18 | void MyGlobalObject::setCounter(int value) { 19 | if(m_counter != value) { 20 | m_counter = value; 21 | counterChanged(); // trigger signal of counter change (e.g. updates QML text that uses counter property) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /myglobalobject.h: -------------------------------------------------------------------------------- 1 | #ifndef MYGLOBALOBJECT_H 2 | #define MYGLOBALOBJECT_H 3 | 4 | #include 5 | 6 | class MyGlobalObject : public QObject 7 | { 8 | Q_OBJECT 9 | Q_PROPERTY(int counter READ counter WRITE setCounter NOTIFY counterChanged) // this makes counter available as a QML property 10 | 11 | public: 12 | MyGlobalObject(); 13 | 14 | public slots: // slots are public methods available in QML 15 | void doSomething(const QString &text); 16 | 17 | signals: 18 | void counterChanged(); 19 | 20 | public: 21 | int counter() const; 22 | void setCounter(int value); 23 | 24 | private: 25 | int m_counter; 26 | 27 | }; 28 | 29 | #endif // MYGLOBALOBJECT_H 30 | -------------------------------------------------------------------------------- /myqmltype.cpp: -------------------------------------------------------------------------------- 1 | #include "myqmltype.h" 2 | 3 | MyQMLType::MyQMLType() : m_message("") 4 | { 5 | 6 | } 7 | 8 | int MyQMLType::increment(int value) { 9 | return value + 1; 10 | } 11 | 12 | void MyQMLType::startCppTask() { 13 | this->doCppTask(); 14 | } 15 | 16 | void MyQMLType::doCppTask() { 17 | // NOTE: you can do calculations here in another thread, this may be used to perform 18 | // cpu-intense operations for e.g. AI (artificial itelligence), Machine Learning or similar purposes 19 | // When the work is done, we can trigger the cppTaskFinished signal and react anywhere in C++ or QML 20 | cppTaskFinished(); 21 | } 22 | 23 | 24 | QString MyQMLType::message() const { 25 | return m_message; 26 | } 27 | 28 | void MyQMLType::setMessage(const QString& value) { 29 | if(m_message != value) { 30 | m_message = value; 31 | messageChanged(); // trigger signal of property change 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /myqmltype.h: -------------------------------------------------------------------------------- 1 | #ifndef MYQMLTYPE_H 2 | #define MYQMLTYPE_H 3 | 4 | #include 5 | 6 | class MyQMLType : public QObject 7 | { 8 | Q_OBJECT 9 | Q_PROPERTY(QString message READ message WRITE setMessage NOTIFY messageChanged) // this makes message available as a QML property 10 | 11 | public: 12 | MyQMLType(); 13 | 14 | public slots: // slots are public methods available in QML 15 | int increment(int value); 16 | void startCppTask(); // starts internal calculations of doCppTask() 17 | 18 | signals: 19 | void messageChanged(); 20 | void cppTaskFinished(); // triggered after calculations in doCppTask() 21 | 22 | public: 23 | QString message() const; 24 | void setMessage(const QString& value); 25 | 26 | private: 27 | void doCppTask(); // method for internal calculations 28 | QString m_message; 29 | 30 | }; 31 | 32 | #endif // MYQMLTYPE_H 33 | -------------------------------------------------------------------------------- /qml/Main.qml: -------------------------------------------------------------------------------- 1 | import Felgo 3.0 2 | import QtQuick 2.5 3 | 4 | // custom import to use MyQMLType, a C++ based QML type 5 | // NOTE: the import identifier, version and QML type name are set in main.cpp at qmlRegisterType(...) 6 | import com.yourcompany.xyz 1.0 7 | 8 | App { 9 | id: app 10 | 11 | NavigationStack { 12 | Page { 13 | title: "Integrate C++ and QML" 14 | 15 | // Example 1 - Global Context Property 16 | // NOTE: myGlobalObject is available here because it is set as a context property in main.cpp 17 | Column { 18 | 19 | // 1.1: Calling myGlobalObject.doSomething() function 20 | AppButton { 21 | text: "myGlobalObject.doSomething()" 22 | onClicked: myGlobalObject.doSomething("TEXT FROM QML") 23 | } 24 | 25 | // 1.2: Increasing myGlobalObject.counter property 26 | // NOTE: the defined setter function of the property is used automatically and triggers the counterChanged signal 27 | AppButton { 28 | text: "myGlobalObject.counter + 1" 29 | onClicked: { 30 | myGlobalObject.counter = myGlobalObject.counter + 1 31 | } 32 | } 33 | 34 | // 1.3: Showing myGlobalObject counter value in a QML text 35 | // NOTE: property bindings are supported, as the counter property definition includes the counterChanged signal, 36 | // which is fired in the implementation of MyGlobalObject::setCounter() for each property change 37 | AppText { 38 | text: "Global Context Property Counter: "+myGlobalObject.counter 39 | } 40 | // Example 1 ends here... 41 | 42 | 43 | // Example 2: Custom QML Type implemented with C++ 44 | // NOTE: This type is declared in main.cpp and available after using "import com.yourcompany.xyz 1.0" 45 | // To create a type that also has a visual representation and may contain child items, derive from QQuickItem instead of QObject 46 | MyQMLType { 47 | id: typeFromCpp 48 | 49 | // 2.1: Property Binding for MyQMLType::message property 50 | // NOTE: Similar to types created purely with QML, you may use property bindings to keep your property values updated 51 | message: "counter / 2 = " + Math.floor(myGlobalObject.counter / 2) 52 | 53 | // 2.2: Reacting to property changes 54 | // NOTE: With the onMessageChanged signal, you can add code to handle property changes 55 | onMessageChanged: console.log("typeFromCpp message changed to '"+typeFromCpp.message+"'") 56 | 57 | // 2.3: Run code at creation of the QML component 58 | // NOTE: The Component.onCompleted signal is available for every QML item, even for items defined with C++. 59 | // The signal is fired when the QML Engine creates the item at runtime. 60 | Component.onCompleted: myGlobalObject.counter = typeFromCpp.increment(myGlobalObject.counter) 61 | 62 | // 2.4: Handling a custom signal 63 | onCppTaskFinished: { 64 | myGlobalObject.counter = 0 // reset counter to zero, this will also update the message 65 | } 66 | } 67 | 68 | // 2.1: Show typeFromCpp.message value, which is calculated automatically based on the myGlobalObject.counter value 69 | AppText { 70 | text: "Custom QML Type Message:\n" + typeFromCpp.message 71 | } 72 | 73 | // 2.4: Button to start cpp task 74 | AppButton { 75 | text: "typeFromCpp.startCppTask()" 76 | onClicked: { 77 | typeFromCpp.startCppTask() 78 | } 79 | } 80 | } 81 | 82 | // 2.5: Connections allow to add signal handlers for global context property objects 83 | Connections { 84 | target: myGlobalObject 85 | onCounterChanged: console.log("Counter changed to "+myGlobalObject.counter) 86 | } 87 | } 88 | 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /qml/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "FelgoCppQML", 3 | "identifier": "com.yourcompany.wizardEVP.FelgoCppQML", 4 | "orientation": "landscape", 5 | "versioncode": 1, 6 | "versionname": "1.0", 7 | "stage": "test" 8 | } 9 | -------------------------------------------------------------------------------- /resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /win/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FelgoSDK/FelgoCppQML-Example/c54e0e7f38060af3432308bae292a2ff0533c414/win/app_icon.ico -------------------------------------------------------------------------------- /win/app_icon.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "app_icon.ico" --------------------------------------------------------------------------------