Top Banner
Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri
10

Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Dec 27, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Best Design Practices Using the Qt Runtime SDK (using QML)

Michael Tims – Esri

Page 2: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Session Agenda

• Bundled SDK Components- Toolkit

- Extras

• Modularize your QML Components

• JavaScript code in QML- Object ownership and garbage collection

• Property binding- Property notifications

- Model/View

• Testing and Deployment

• Q&A

Page 3: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Bundled SDK ComponentsUse what’s already available to you

• Toolkit - Controls and Dialogs- Reuse or subclass existing components

• ArcGIS Extras plugin for Qt- High-demand APIs exposed to QML

- File I/O

- Application settings

- UI scale factor

Page 4: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Modularize your QML ComponentsBreak apart UI from business logic

• Keep your UI in separate QML files- Declare component as a local type

• Access components through custom properties

Page 5: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

JavaScript code in QMLQML is a JavaScript-based language

• Write or use existing JavaScript code in QML- Write custom JavaScript functions

- Use common JavaScript objects (Math, Date, etc…)

• Be aware of object ownership- QML-declared components are owned by the QML Engine/JS Engine

- Objects returned from ArcGISRuntime.createObject() are given JS ownership

Page 6: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Property bindingThe basis for property notifications

• UI updates when property changes- Property notifies any other bound property that it has changed

• Create property bindings from JavaScript- property = Qt.binding(function() { return calculated_value })

• Models and Views- Models notify the view to update when data changes

- Binding list properties to QML views

Page 7: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Testing and Deployment

• Test and debug your app directly from Qt Creator

• Deploy your app with local data

Page 8: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Thank you…

• Please fill out the session survey in your mobile app

• Select “Best Design Practices Using the Qt Runtime SDK (using QML)” in the Mobile App- Use the Search Feature to quickly find this title

• Click “Demo Theater Survey”

• Answer a few short questions and enter any comments

Page 9: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.

Questions?

Page 10: Best Design Practices Using the Qt Runtime SDK (using QML) Michael Tims – Esri.