-
-
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.
[FEATURE] Introduction of QGIS Quick library
This pull request is a subset of #6490 This adds a new library for creation of applications based on Qt Quick framework. It contains reusable QML / Qt Quick components based on QGIS core library. The initial work introduces MapCanvas To enable compilation of the library, use WITH_QUICK=TRUE Further documentation of the library is located in doc/qgsquick.dox For background information see the associated QEP: qgis/QGIS-Enhancement-Proposals#109 The initial implementation is largely based on the work of Matthias Kuhn and Marco Bernasocchi on QField probject - kudos to them for the great job!
- Loading branch information
1 parent
f816588
commit b1bf9b2
Showing
37 changed files
with
3,287 additions
and
3 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
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
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,47 @@ | ||
# Qt QML Tools | ||
# ~~~~~~~~~~~~ | ||
# | ||
# To generate qmltypes files required by Qt Creator to allow QML code inspection | ||
# (http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html#generating-qmltypes-files) | ||
# we need to have installed qmlplugindump unity (shipped with Qt 4.8 and later) | ||
# http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html#dumping-plugins-automatically | ||
# | ||
# Find the installed version of qmlplugindump utility. | ||
# FindQtQmlTools should be called after Qt5 has been found | ||
# | ||
# This file defines the following variables: | ||
# | ||
# QMLPLUGINDUMP_FOUND - system has qmlplugindump | ||
# QMLPLUGINDUMP_EXECUTABLE - Path to qmlplugindump executable | ||
# | ||
# Also defines MACRO to create qmltypes file, when QML directory is supplied | ||
# | ||
# Copyright (c) 2017, Peter Petrik <zilolv at gmail dot com> | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
MACRO(FIND_QMLPLUGINDUMP) | ||
IF(NOT QMLPLUGINDUMP_EXECUTABLE) | ||
IF (MSVC) | ||
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump.exe) | ||
ELSE (MSVC) | ||
FIND_PROGRAM(QMLPLUGINDUMP_EXECUTABLE qmlplugindump) | ||
ENDIF (MSVC) | ||
ENDIF(NOT QMLPLUGINDUMP_EXECUTABLE) | ||
|
||
IF (QMLPLUGINDUMP_EXECUTABLE) | ||
SET(QMLPLUGINDUMP_FOUND TRUE) | ||
MESSAGE(STATUS "Found qmlplugindump: ${QMLPLUGINDUMP_EXECUTABLE}") | ||
ELSE() | ||
SET(QMLPLUGINDUMP_FOUND FALSE) | ||
IF (QMLPLUGINDUMP_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "Could not find qmlplugindump") | ||
ELSE (QMLPLUGINDUMP_FIND_REQUIRED) | ||
MESSAGE(WARNING "Could not find qmlplugindump") | ||
ENDIF (QMLPLUGINDUMP_FIND_REQUIRED) | ||
ENDIF (QMLPLUGINDUMP_EXECUTABLE) | ||
ENDMACRO(FIND_QMLPLUGINDUMP) | ||
|
||
IF (NOT QMLPLUGINDUMP_FOUND) | ||
FIND_QMLPLUGINDUMP() | ||
ENDIF (NOT QMLPLUGINDUMP_FOUND) |
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
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
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/*! \page qgsquick QGIS Quick Documentation | ||
|
||
\tableofcontents | ||
|
||
\section qgsquick_overview Overview | ||
|
||
QGIS Quick is a QT Quick based GUI library primarily for mobile/tablet devices. Covering basic GIS components (e.g. MapCanvas, Scalebar), | ||
it simplifies creation of a mobile applications for surveys, data gathering or other on-site work. Qt Quick provides tools | ||
to create a rich application with a fluid and dynamic user interface. Additionally, Qt Quick Controls 2 provides highly | ||
optimized controls for embedded/mobile devices with limited resources. | ||
|
||
QGIS Quick consists of a Qt plugin that provides the QML components and of a shared library that can be used from C++ code. | ||
|
||
\subsection qgsquick_overview_widgets QML Classes | ||
\subsubsection qgsquick_overview_widgets_mapcanvas MapCanvas | ||
|
||
\section qgsquick_styling Styling | ||
|
||
Since the QGIS Quick library is meant to be reusable for a wide variety of applications with different styles/themes of the user | ||
interface, some effort has been done to allow developers customize the colors and layouts of the components. Individual | ||
components either have attributes for customization (e.g. ScaleBar has "barColor", "barBackgroundColor" properties) or more complex | ||
components accept a custom styling object (e.g. FeatureForm has "style" property of type FeatureFormStyling with a hierarchy of color | ||
and layout properties). | ||
|
||
\section qgsquick_versioning_api Versioning and API stability | ||
|
||
QML engine supports versioning of individual components with libraries - a single component may be available in multiple versions | ||
with slightly different set of features. This is allows QML libraries to keep API compatibility with older code. | ||
|
||
QGIS Quick library is currently in version 0.1 and since it is still a very new library, there are no API stability guarantees: | ||
the following releases of QGIS may ship updates to components while keeping the same version or even remove some components. | ||
Over time we expect that as the library will become stable, we will deliver stable API just like with the other QGIS libraries. | ||
|
||
\section qgsquick_gui Designing scalable applications | ||
|
||
Qt Quick uses pixel sizes for the visual items. When building applications that may run on devices with varying screen DPI, | ||
this is a problem as the absolute pixel values make the application look different depending on the screen pixel density. | ||
We recommend to use values device independent pixels ("dp"). It is a concept used on mobile devices, where an item of width of 10dp | ||
will have always the same physical size (e.g. in millimeters) regardless of the screen density. To set width of an item to 10dp | ||
in QML, one would write: "width: 10 * QgsQuick.Utils.dp". | ||
|
||
\section qgsquick_lib Building the library | ||
|
||
The QGIS Quick library is not built by default because QGIS application currently does not use it. In order to build the library | ||
please make sure that WITH_QUICK variable in CMake configuration is set to ON. | ||
|
||
It is recommended to build with CMake variable ENABLE_TESTS set to ON because that will also build a small example application | ||
that uses Qt Quick components. In the generated project you should see target "qgis_quickapp". | ||
|
||
The built QML plugin is installed to a dedicated directory - see QgsApplication::qmlImportPath(). When using QGIS Quick components, | ||
it is necessary to either use QQmlEngine::addImportPath() to add that directory or to specify QML2_IMPORT_PATH environment variable. | ||
|
||
\section qgsquick_demo_app Demo application | ||
|
||
A demo application with some basic componets and functionality is available on https://github.com/lutraconsulting/qgis-quick-demo-app | ||
|
||
The demo application repository contains also instructions on how to build the application, QGIS Quick and other dependencies on Android. | ||
|
||
*/ | ||
|
||
|
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
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
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
Oops, something went wrong.