-
Notifications
You must be signed in to change notification settings - Fork 4
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
f2d9432
commit 355a084
Showing
7 changed files
with
30 additions
and
82 deletions.
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
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,20 +1,12 @@ | ||
#include <QGuiApplication> | ||
#include <QQmlApplicationEngine> | ||
|
||
// This include is required to use the following plugin macros | ||
#include <QtQml/qqmlextensionplugin.h> | ||
Q_IMPORT_QML_PLUGIN(MainPlugin) | ||
Q_IMPORT_QML_PLUGIN(TextRowPlugin) | ||
Q_IMPORT_QML_PLUGIN(StringsPlugin) | ||
|
||
int main (int argCount, char* argVector[]) | ||
{ | ||
QGuiApplication subdirectoryExampleApp(argCount, argVector); | ||
|
||
QQmlApplicationEngine engine; | ||
// The import path is needed in case a custom output directory is set | ||
engine.addImportPath("qrc:/"); | ||
engine.load("qrc:/Main/main.qml"); | ||
engine.loadFromModule("com.example.subdirectories.main", "Main"); | ||
|
||
subdirectoryExampleApp.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 |
---|---|---|
@@ -1,25 +1,10 @@ | ||
# This ensures CMake will search this folder | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
qt_add_library(subdirectories-main) | ||
|
||
# This is exactly the same thing as in sub2/CMakeLists.txt | ||
# So use either qt_add_library or STATIC in the qt_add_qml_module. | ||
|
||
#qt_add_library(main STATIC) | ||
|
||
# Our QML files that are going to be | ||
# shipped with our application need to be static. | ||
# Creating the target "main" here | ||
# (also called a module) | ||
# autogenerates a mainplugin that can be used in | ||
# the root target_link_libraries(). | ||
qt_add_qml_module(main | ||
URI "Main" | ||
qt_add_qml_module(subdirectories-main | ||
URI "com.example.subdirectories.main" | ||
VERSION 1.0 | ||
RESOURCE_PREFIX "/" | ||
# OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml | ||
# OUTPUT_DIRECTORY "Main" | ||
QML_FILES "main.qml" | ||
STATIC | ||
OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/com/example/subdirectories/main" | ||
QML_FILES "Main.qml" | ||
) | ||
|
||
add_subdirectory(sub2) |
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
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,25 +1,10 @@ | ||
# This ensures CMake will search this folder | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
qt_add_library(subdirectories-textrow) | ||
|
||
# This is exactly the same thing as in sub2/CMakeLists.txt | ||
# So use either qt_add_library or STATIC in the qt_add_qml_module. | ||
|
||
qt_add_library(textrow STATIC) | ||
|
||
# Our QML files that are going to be | ||
# shipped with our application need to be static. | ||
# Creating the target "main" here | ||
# (also called a module) | ||
# autogenerates a mainplugin that can be used in | ||
# the root target_link_libraries(). | ||
qt_add_qml_module(textrow | ||
URI "TextRow" | ||
qt_add_qml_module(subdirectories-textrow | ||
URI "com.example.subdirectories.textrow" | ||
VERSION 1.0 | ||
RESOURCE_PREFIX "/" | ||
# OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml | ||
# OUTPUT_DIRECTORY "TextRow" | ||
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/com/example/subdirectories/textrow | ||
QML_FILES "TextRow.qml" | ||
# STATIC | ||
) | ||
|
||
add_subdirectory(sub3) |
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ Frame { | |
id: label | ||
} | ||
TextField { | ||
Layout.fillWidth: true | ||
id: field | ||
} | ||
} | ||
|
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,22 +1,8 @@ | ||
# This ensures CMake will search this folder | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
# This add new source files to the desired target, namely our executable. | ||
# Because this is a single header file, we can set its visibility to INTERFACE. | ||
# The main effect of this is the file appearing in the Projects tab in IDEs. | ||
target_sources(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/strings.hpp) | ||
|
||
# Like the previous CMakeLists.txt files, | ||
# either method for setting STATIC works. | ||
|
||
#qt_add_library(strings STATIC) | ||
qt_add_library(subdirectories-strings) | ||
|
||
qt_add_qml_module(strings | ||
URI "Strings" | ||
URI "com.example.subdirectories.strings" | ||
VERSION 1.0 | ||
RESOURCE_PREFIX "/" | ||
# OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml | ||
# OUTPUT_DIRECTORY "Strings" | ||
OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/com/example/subdirectories/strings" | ||
SOURCES "strings.hpp" | ||
STATIC | ||
) |