Skip to content

Instantly share code, notes, and snippets.

View stephenquan's full-sized avatar

Stephen Quan stephenquan

View GitHub Profile
import QtQuick 2.7
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Sql 1.0
Item {
width: 640
height: 480
FileFolder {
id: fileFolder
@stephenquan
stephenquan / SQLiteSpatialSnippet.sql
Created September 11, 2017 00:01
AppStudio SQLite spatial functions example
SELECT ST_Distance(ST_Point(144.965819, -37.830658, 4326),
ST_Point(144.954433, -37.832262, 4326)) as distance;
-- 1015.7444936798523
SELECT ST_Azimuth(ST_Point(144.965819, -37.830658, 4326),
ST_Point(144.954433, -37.832262, 4326)) as radians;
-- 4.535820702776582
@stephenquan
stephenquan / appstudio-copy-and-open-resource.qml
Last active March 4, 2018 21:42
AppStudio copy and open and embedded resource
// This sample demonstrates how to copy out a resource from your app to your file system.
//
// This AppStudio works around the issue that you cannot give the operating system links
// to resources embedded in your application. To achieve this, we copy the resources out
// which causes their URL to change from a qrc:/ to file:/ URI. After copying, we can
// easily open the file with Qt.openUrlExternally.
import QtQuick 2.7
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0
@stephenquan
stephenquan / appstudio-shortcuts.qml
Last active March 9, 2018 10:49
AppStudio return shortcuts to standard locations
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import QtQuick.Dialogs 1.0
import ArcGIS.AppFramework 1.0
App {
id: app
width: 640 * AppFramework.displayScaleFactor
@stephenquan
stephenquan / appstudio-sqlaggregatefunction-sample.qml
Last active March 19, 2018 20:28
appstudio-sqlaggregatefunction-sample.qml
// appstudio-sqlaggregatefunction-sample.qml
//
// Sample demonstrating how to use SqlAggregateFunction.
import QtQuick 2.8
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import QtQuick.Controls 2.1
import QtGraphicalEffects 1.0
import ArcGIS.AppFramework 1.0
@stephenquan
stephenquan / appstudio-messagehandler-loader-sample.qml
Last active March 21, 2018 04:57
appstudio-messagehandler-loader-sample.qml
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Controls 1.0
Item {
property string errorString: ""
@stephenquan
stephenquan / appstudio-networkrequest-sample.qml
Last active March 23, 2018 05:27
appstudio-networkrequest-sample.qml
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.1
import ArcGIS.AppFramework 1.0
import ArcGIS.AppFramework.Networking 1.0
App {
id: app
width: 640
height: 480
@stephenquan
stephenquan / appstudio-sqldatabase-sample.qml
Created March 28, 2018 20:57
appstudio-sqldatabase-sample.qml
// This sample demonstrates creation, populating and querying a SQLite database.
// When run, a TextArea component, displays cities retrieved from the database:
//
// Melbourne, Australia - 4.2M - (-37.9717, 144.773)
// London, UK - 8788.0M - (51.5288, -0.24168)
// Paris, France - 2.2M - (48.859, 2.27702)
// New York City, USA - 8538.0M - (40.6977, -74.1198)
// Tokyo, Japan - 13.6M - (35.6735, 139.57)
import QtQuick 2.9
@stephenquan
stephenquan / appstudio-sqltablemodel-sample.qml
Last active April 4, 2018 01:47
appstudio-sqltablemodel-sample.qml
// This sample demonstrates creation, populating and querying a SQLite database.
// When run the TableView component is populated with a data from the Cities table.
//
// Melbourne, Australia, -37.9716929, 144.7729583
// London, UK, 51.5287718, -0.2416804
// Paris, France, 48.8589507, 2.2770205
// New York City, USA, 40.6976637, -74.1197639
// Tokyo, Japan, 35.6735408, 139.5703047
import QtQuick 2.9
@stephenquan
stephenquan / qml-image-filedialog-sample.qml
Last active April 4, 2018 03:52
qml-image-filedialog-sample.qml
// This sample allows you to pick and view an image from your pictures folder
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.3
Item {
ColumnLayout {
anchors.fill: parent