6. What is this talk about?
●
Qt offers a stable UI framework for cross-
platform mobile applications development
●
Large and complex Qt mobile applications
still lack some architectural-level support
●
A lot of functionalities are recurrent and
amenable to automatic code generation
7. What is this talk about?
●
Some Qt disabilities in mobile development:
– Lack of high-level frameworks delivering
modular and reusable architectural solutions for
mobile apps
– KDE Frameworks 5 is likely to be cumbersome
and/or introduce unwanted dependencies
– Lack of high-level reusable UI components (KDE
Kirigami to the rescue)
8. What is this talk about?
●
Some Qt disabilities in mobile development:
– No built-in support for JSON-based RESTful
communication (lack of a JSONListModel)
– No built-in support for disconnected operations
(with automatic sync upon reconnected)
– No built-in cross-platform support for receiving
push notifications
– Issues with deployment of read-write files across
platforms
9. What is this talk about?
●
We’ve been working on some mobile Qt
development projects at IFBA over the last
1.5 years
●
Such Qt disabilities has motivated us to
investigate to which extent such problems
can be alleviated with the use of well-
thought architectures and effective tooling
10. Introducing Meg
=
+
Meg
A lean dynamic QML-based
architecture for Qt
cross-platform mobile
applications
A code generator which
Enables the productive
creation of modular
RESTful servers and
Qt mobile applications
11. Introducing Meg
●
Implemented as a Ruby Thor-based CLI
●
Templates are specified in Embedded RuBy
(ERB)
●
Generators are modular (Thor with modules)
●
Provides a JSONListModel QML object
●
Automatic download of Google Material Icons
12. Introducing Meg
●
Currently available templates:
●
Sinatra RESTful server with modular architecture
(sinatra-server)
●
Ruby Sinatra RESTful service plug-in (sinatra-service-
plugin)
●
Simple Qt mobile app with plugin-based architecture
(simple-app)
●
Qt mobile RESTful app with plugin-based architecture
(restful-app)
●
Qt mobile RESTful client plug-in (restful-client-plugin)
13. Meg – quick demo
●
Installing meg:
– git clone https://github.com/sandroandrade/meg.git
– install ruby
– run ‘gem install bundler’
– Run ‘bundle install’
– CLI is in ‘./bin/meg’
14. Meg – quick demo
●
Creating a simple Qt plugin-based mobile
app:
– ./bin/meg new SimpleApp -t simple-app
●
Creating some plug-ins:
– ./bin/meg generate plugin students -t basic-plugin -a
simpleapp/
– ./bin/meg generate plugin teachers -t basic-plugin -a
simpleapp/
15. Meg – quick demo
●
Creating a modular Sinatra RESTful server:
– ./bin/meg new myserver -t sinatra-server
●
Creating some plug-ins:
– ./bin/meg generate plugin Conference -t sinatra-service-
plugin -a myserver/ acronym:string name:string
city:string country:string venue:string start_date:datetime
end_date:datetime
– ./bin/meg generate plugin Speaker -t sinatra-service-
plugin -a myserver/ name:string affiliation:string
shortbio:string
16. Meg – quick demo
●
Running the server:
– run ‘rake db:migrate’
– populate database with some data
– start the server: ‘ruby myserver.rb’
●
Checking the services:
– curl http://localhost:4567/conferences | python -m
json.tool
– curl http://localhost:4567/speakers | python -m json.tool
17. Meg – quick demo
●
Creating a mobile Qt RESTful client:
– ./bin/meg new MyApp -t restful-app
●
Creating the RESTful client plug-ins:
– ./bin/meg generate plugin conferences -t restful-client-
plugin -a myapp -i name -c action/ic_speaker_notes
acronym:string name:string city:string venue:string
start_date:datetime end_date:datetime
– ./bin/meg generate plugin speakers -t restful-client-plugin
-a myapp -i name -c action/ic_record_voice_over
name:string affiliation:string shortbio:string
19. Meg – quick demo
●
Future work:
– Add templates for full CRUD support
– Add template for kirigami-based UI
workflows
– Support relationships between models
– Support push notification
●
Try it! Contributions welcome!