Developing
                   Device-Adaptive Apps
                              Using KDE Plasma Technologies




Sebastian Kügler & Daker Fernandes Pinheiro
Overview


          ●   Conceptual Intro
          ●   Qt Quick / QML Introduction
          ●   Extending Qt Quick using C++
          ●   Plasma Quick
          ●   Tools, Tips & Tricks
          ●   Hacking / Discussion / Hands-on / Help




Developing Device-Adaptive Apps – Overview
Adapt instead of dumbing down


      ●   Different interfaces for different devices
          ●   UI as thin layer
          ●   Switchable input profiles (part of the platform, “for free”)
          ●   Switchable layouts (per app, usually one file per device)
      ●   Work with different input methods
      ●   Reusable components




Developing Device-Adaptive Apps – General
Technologies


          ●   Qt / QML
          ●   KDE libraries
          ●   UI profile switchable by env var
          ●   Reusable components




Developing Device-Adaptive Apps – General
Developer Story


          ●   Chad – casual hacker, familiar with web technologies
              ●   Plasmate introduces Chad to Plasma
          ●   Lwing – experienced C++ developer, own codebase
              ●   Lwing ports, develops and packages her applications using the Mer SDK
          ●   Brian – KDE Hacker
              ●   Brian is part of the KDE team and regularly contributes patches




Developing Device-Adaptive Apps – General
Qt Quick: Intro

   ●    Declarative UI – not procedural but “object tree”
   ●    JSON + JavaScript
   ●    Interpreted at runtime
   ●    Dynamic types
   ●    Reusable components
    •   http://qt-project.org/doc/qt-4.8/qdeclarativeintroduction.html
    •   https://developer.mozilla.org/en/JavaScript/Guide




Developing Device-Adaptive Apps – QtQuick Intro
Qt Quick: Concepts

   ●    Property binding vs. value assignment
   ●    Extensible using modules
   ●    Layouting using anchors
   ●    Reusable components


    •   http://qt-project.org/doc/qt-4.8/qdeclarativeintroduction.html
    •   https://developer.mozilla.org/en/JavaScript/Guide




Developing Device-Adaptive Apps – QtQuick Intro
Qt Quick Example
           import QtQuick 1.1


           Rectangle {
                width: 200
                height: 200
                color: "blue"


                Image {
                      source: "pics/logo.png"
                      anchors.centerIn: parent
                }
           }


Developing Device-Adaptive Apps – QtQuick Intro
Qt Quick Anchor Layouts

          •   Align objects to each other
          •   Useful for flexible layouts
          •   Dynamic sizing of objects: Scales well
          •   Surprisingly painless and logical
          •   Very powerful




Developing Device-Adaptive Apps – QtQuick Intro
QML Lists & Models
           import QtQuick 1.1

           Item {
               width: 200; height: 250

               ListModel {
                   id: myModel
                   ListElement { type: "Dog"; age: 8 }
                   ListElement { type: "Cat"; age: 5 }
               }

               Component {
                   id: myDelegate
                   Text { text: type + ", " + age }
               }

               ListView {
                   anchors.fill: parent
                   model: myModel
                   delegate: myDelegate
               }
           }


Developing Device-Adaptive Apps – QtQuick Intro
QML & C++ Hybrids: Basics

   ●   QML can be extended using C++
   ●   Getting data from C++ to QML:
       ●   setContextProperty()
       ●   qmlRegisterType()
       ●   Creating new imports (careful, public API!)
   ●   QObject as base class
       ●   Q_PROPERTY() for getter, setter, notify
       ●   Q_INVOKABLE() for methods

Developing Device-Adaptive Apps – Advanced QML
QML & C++ Hybrids: Models

   ●    QStringList – really basic, “modelData” holds your string
   ●    QList<QObject*> – useful for smallish lists
   ●    QAbstractItemModel – Full power, full control, full pain




    •   http://qt-project.org/doc/qt-4.8/qdeclarativemodels.html
    •   http://qt-project.org/doc/qt-4.8/qdeclarativemodels.html#qml-c-models
    •



    http://steveire.wordpress.com/2010/02/19/qml-with-akonadi-or-how-to-use-your-existing-model-view
    •   http://sf2011.meego.com/program/sessions/data-models-qml

Developing Device-Adaptive Apps – Advanced QML
Plasma Quick: Basics

   ●    QtQuick + Plasma / KDE libraries
   ●    i18n() for translation
   ●    Plasma Components
   ●    PlasmaCore, QtExtras, PlasmaExtras, ...


    •   http://techbase.kde.org/Development/Tutorials/Plasma/QML/API
    •   http://api.kde.org/4.x-api/plasma-qml-apidocs/
    •




Developing Device-Adaptive Apps – Plasma Quick
Plasma Quick: Classes

   ●    PlasmaCore.Theme
   ●    PlasmaCore.{SvgItem,FrameSvg,...}
   ●    PlasmaCore.DataSource to use dataengines
   ●    PlasmaCore.Dialog
   ●    PlasmaCore.SortFilterModel
   ●    QIconItem, QPixmapItem, QImageItem, ...


    •   http://techbase.kde.org/Development/Tutorials/Plasma/QML/API


Developing Device-Adaptive Apps – Plasma Quick
    •
Tools

   ●   QtCreator
   ●   qmlviewer
       ●   qmlviewer -I `kde4-config --prefix`/lib/kde4/imports/
   ●   Plasmoidviewer
           plasmoidviewer --list
       ●   plasmoidviewer [pluginname]
   ●   Qt Assistant (try searching for QML!)




Developing Device-Adaptive Apps – Tips & Tricks
Tips & Tricks
●   git clone kde:kdeexamples → plasma/declarative/*
●   Use PlasmaComponents.Label instead of Text
●   Think about splitting into reusable components
●   grep in kde:declarative-plasmoids and kde:plasma-mobile
●   Rectangle { color: “orange”; opacity: 0.3; anchors.fill: parent; }

inside your Item helps finding sizing problems




    Developing Device-Adaptive Apps – Tips & Tricks
Plasmate


              Workflow-driven IDE for Plasmoids:
          ●   Create – Hack – Test – Deploy – Publish
          ●   1.0 end of summer
          ●   Clone from git://anongit.kde.org/plasmate
          ●   Build using cmake (needs kdelibs-devel)
          ●   Start hacking




Developing Device-Adaptive Apps – SDK “light”
Mer SDK

          Chroot environment with everything pre-setup
          ●   Work in progress: involves a bit of manual setup
          ●   Easy way to cross-compile
          ●   Easy way to build packages for $DEVICE
          ●   Takes complexity away big time




Developing Device-Adaptive Apps – Limitless SDK
Help!

   •   #plasma on Freenode
   •   plasma-devel@kde.org



Sebastian Kügler
Happy hacking!
   Interesting blogs:
   •   http://codecereal.blogspot.com.br/ (Daker)
   •   http://vizZzion.org (sebas)
   •   http://notmart.org (Marco Martin)




Sebastian Kügler

More Related Content

PDF
Why is Python slow? Python Nordeste 2013
PDF
Network programming with Qt (C++)
PDF
Translating Qt Applications
PPTX
Introduction to Qt
ODP
Qt Workshop
PDF
[KubeCon EU 2020] containerd Deep Dive
PDF
A Brief Introduction to the Qt Application Framework
ODP
Cross Platform Qt
Why is Python slow? Python Nordeste 2013
Network programming with Qt (C++)
Translating Qt Applications
Introduction to Qt
Qt Workshop
[KubeCon EU 2020] containerd Deep Dive
A Brief Introduction to the Qt Application Framework
Cross Platform Qt

What's hot (19)

PDF
ISC HPCW talks
PDF
[KubeCon NA 2020] containerd: Rootless Containers 2020
PDF
Qt Internationalization
 
PDF
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
PPT
了解 Qt
PDF
[FOSDEM 2020] Lazy distribution of container images
PPTX
Qt for beginners part 1 overview and key concepts
 
PDF
10 reasons to be excited about go
PDF
Metasepi team meeting #7: Snatch application on tiny OS
PDF
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
PDF
Rootless Containers & Unresolved issues
PDF
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
PDF
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
PDF
Extending Node.js using C++
PDF
A Python Tutorial
PDF
QThreads: Are You Using Them Wrong?
 
PDF
NUS-ISS Learning Day 2017 - Bots-Managed CloudOps
PDF
平行化你的工作 part1
ISC HPCW talks
[KubeCon NA 2020] containerd: Rootless Containers 2020
Qt Internationalization
 
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
了解 Qt
[FOSDEM 2020] Lazy distribution of container images
Qt for beginners part 1 overview and key concepts
 
10 reasons to be excited about go
Metasepi team meeting #7: Snatch application on tiny OS
[KubeCon EU 2021] Introduction and Deep Dive Into Containerd
Rootless Containers & Unresolved issues
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
OSDC 2016 - rkt and Kubernentes what's new with Container Runtimes and Orches...
Extending Node.js using C++
A Python Tutorial
QThreads: Are You Using Them Wrong?
 
NUS-ISS Learning Day 2017 - Bots-Managed CloudOps
平行化你的工作 part1
Ad

Similar to Plasmaquick Workshop - FISL 13 (20)

PPTX
Qt Qml
ODP
Qt 5 - C++ and Widgets
PDF
Qt for beginners part 4 doing more
 
PDF
Making your app soar without a container manifest
PDF
Necessitas - Qt on Android - from FSCONS 2011
PDF
QtQuick Day 1
PPTX
Introduction to kubernetes
PPTX
K8s in 3h - Kubernetes Fundamentals Training
PDF
Porting Motif Applications to Qt - Webinar
 
PDF
Porting Motif Applications to Qt - Webinar
PDF
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
PDF
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
PPTX
From development to production: Deploying Java and Scala apps to kubernetes
PDF
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
PDF
下午3 intel fenghaitao_mee_go api and application development
PDF
Nugwc k8s session-16-march-2021
KEY
Building production-quality apps with Node.js
PDF
DevEx | there’s no place like k3s
PPTX
Ultimate Guide to Microservice Architecture on Kubernetes
Qt Qml
Qt 5 - C++ and Widgets
Qt for beginners part 4 doing more
 
Making your app soar without a container manifest
Necessitas - Qt on Android - from FSCONS 2011
QtQuick Day 1
Introduction to kubernetes
K8s in 3h - Kubernetes Fundamentals Training
Porting Motif Applications to Qt - Webinar
 
Porting Motif Applications to Qt - Webinar
A GitOps Kubernetes Native CICD Solution with Argo Events, Workflows, and CD
Comment développer une application mobile en 8 semaines - Meetup PAUG 24-01-2023
From development to production: Deploying Java and Scala apps to kubernetes
OSDC 2018 | Three years running containers with Kubernetes in Production by T...
下午3 intel fenghaitao_mee_go api and application development
Nugwc k8s session-16-march-2021
Building production-quality apps with Node.js
DevEx | there’s no place like k3s
Ultimate Guide to Microservice Architecture on Kubernetes
Ad

More from Daker Fernandes (8)

PDF
Functional Pattern Matching on Python
PDF
Raspberry Pi + Python
PDF
Opengl aula-01
PDF
Jogos em Qt
PDF
Dominando Modelos Ocultos de Markov com Python e GHMM
PDF
CITi - PySide
PDF
QtQuick - WSL II
PDF
Mongodb workshop cinlug
Functional Pattern Matching on Python
Raspberry Pi + Python
Opengl aula-01
Jogos em Qt
Dominando Modelos Ocultos de Markov com Python e GHMM
CITi - PySide
QtQuick - WSL II
Mongodb workshop cinlug

Recently uploaded (20)

PPTX
Build Your First AI Agent with UiPath.pptx
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
Configure Apache Mutual Authentication
PPT
Geologic Time for studying geology for geologist
PPTX
Modernising the Digital Integration Hub
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Architecture types and enterprise applications.pdf
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PPT
What is a Computer? Input Devices /output devices
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PPTX
2018-HIPAA-Renewal-Training for executives
PDF
Five Habits of High-Impact Board Members
Build Your First AI Agent with UiPath.pptx
Consumable AI The What, Why & How for Small Teams.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Final SEM Unit 1 for mit wpu at pune .pptx
A review of recent deep learning applications in wood surface defect identifi...
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Getting started with AI Agents and Multi-Agent Systems
Configure Apache Mutual Authentication
Geologic Time for studying geology for geologist
Modernising the Digital Integration Hub
Benefits of Physical activity for teenagers.pptx
OpenACC and Open Hackathons Monthly Highlights July 2025
Taming the Chaos: How to Turn Unstructured Data into Decisions
Architecture types and enterprise applications.pdf
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
What is a Computer? Input Devices /output devices
Convolutional neural network based encoder-decoder for efficient real-time ob...
2018-HIPAA-Renewal-Training for executives
Five Habits of High-Impact Board Members

Plasmaquick Workshop - FISL 13

  • 1. Developing Device-Adaptive Apps Using KDE Plasma Technologies Sebastian Kügler & Daker Fernandes Pinheiro
  • 2. Overview ● Conceptual Intro ● Qt Quick / QML Introduction ● Extending Qt Quick using C++ ● Plasma Quick ● Tools, Tips & Tricks ● Hacking / Discussion / Hands-on / Help Developing Device-Adaptive Apps – Overview
  • 3. Adapt instead of dumbing down ● Different interfaces for different devices ● UI as thin layer ● Switchable input profiles (part of the platform, “for free”) ● Switchable layouts (per app, usually one file per device) ● Work with different input methods ● Reusable components Developing Device-Adaptive Apps – General
  • 4. Technologies ● Qt / QML ● KDE libraries ● UI profile switchable by env var ● Reusable components Developing Device-Adaptive Apps – General
  • 5. Developer Story ● Chad – casual hacker, familiar with web technologies ● Plasmate introduces Chad to Plasma ● Lwing – experienced C++ developer, own codebase ● Lwing ports, develops and packages her applications using the Mer SDK ● Brian – KDE Hacker ● Brian is part of the KDE team and regularly contributes patches Developing Device-Adaptive Apps – General
  • 6. Qt Quick: Intro ● Declarative UI – not procedural but “object tree” ● JSON + JavaScript ● Interpreted at runtime ● Dynamic types ● Reusable components • http://qt-project.org/doc/qt-4.8/qdeclarativeintroduction.html • https://developer.mozilla.org/en/JavaScript/Guide Developing Device-Adaptive Apps – QtQuick Intro
  • 7. Qt Quick: Concepts ● Property binding vs. value assignment ● Extensible using modules ● Layouting using anchors ● Reusable components • http://qt-project.org/doc/qt-4.8/qdeclarativeintroduction.html • https://developer.mozilla.org/en/JavaScript/Guide Developing Device-Adaptive Apps – QtQuick Intro
  • 8. Qt Quick Example import QtQuick 1.1 Rectangle { width: 200 height: 200 color: "blue" Image { source: "pics/logo.png" anchors.centerIn: parent } } Developing Device-Adaptive Apps – QtQuick Intro
  • 9. Qt Quick Anchor Layouts • Align objects to each other • Useful for flexible layouts • Dynamic sizing of objects: Scales well • Surprisingly painless and logical • Very powerful Developing Device-Adaptive Apps – QtQuick Intro
  • 10. QML Lists & Models import QtQuick 1.1 Item { width: 200; height: 250 ListModel { id: myModel ListElement { type: "Dog"; age: 8 } ListElement { type: "Cat"; age: 5 } } Component { id: myDelegate Text { text: type + ", " + age } } ListView { anchors.fill: parent model: myModel delegate: myDelegate } } Developing Device-Adaptive Apps – QtQuick Intro
  • 11. QML & C++ Hybrids: Basics ● QML can be extended using C++ ● Getting data from C++ to QML: ● setContextProperty() ● qmlRegisterType() ● Creating new imports (careful, public API!) ● QObject as base class ● Q_PROPERTY() for getter, setter, notify ● Q_INVOKABLE() for methods Developing Device-Adaptive Apps – Advanced QML
  • 12. QML & C++ Hybrids: Models ● QStringList – really basic, “modelData” holds your string ● QList<QObject*> – useful for smallish lists ● QAbstractItemModel – Full power, full control, full pain • http://qt-project.org/doc/qt-4.8/qdeclarativemodels.html • http://qt-project.org/doc/qt-4.8/qdeclarativemodels.html#qml-c-models • http://steveire.wordpress.com/2010/02/19/qml-with-akonadi-or-how-to-use-your-existing-model-view • http://sf2011.meego.com/program/sessions/data-models-qml Developing Device-Adaptive Apps – Advanced QML
  • 13. Plasma Quick: Basics ● QtQuick + Plasma / KDE libraries ● i18n() for translation ● Plasma Components ● PlasmaCore, QtExtras, PlasmaExtras, ... • http://techbase.kde.org/Development/Tutorials/Plasma/QML/API • http://api.kde.org/4.x-api/plasma-qml-apidocs/ • Developing Device-Adaptive Apps – Plasma Quick
  • 14. Plasma Quick: Classes ● PlasmaCore.Theme ● PlasmaCore.{SvgItem,FrameSvg,...} ● PlasmaCore.DataSource to use dataengines ● PlasmaCore.Dialog ● PlasmaCore.SortFilterModel ● QIconItem, QPixmapItem, QImageItem, ... • http://techbase.kde.org/Development/Tutorials/Plasma/QML/API Developing Device-Adaptive Apps – Plasma Quick •
  • 15. Tools ● QtCreator ● qmlviewer ● qmlviewer -I `kde4-config --prefix`/lib/kde4/imports/ ● Plasmoidviewer plasmoidviewer --list ● plasmoidviewer [pluginname] ● Qt Assistant (try searching for QML!) Developing Device-Adaptive Apps – Tips & Tricks
  • 16. Tips & Tricks ● git clone kde:kdeexamples → plasma/declarative/* ● Use PlasmaComponents.Label instead of Text ● Think about splitting into reusable components ● grep in kde:declarative-plasmoids and kde:plasma-mobile ● Rectangle { color: “orange”; opacity: 0.3; anchors.fill: parent; } inside your Item helps finding sizing problems Developing Device-Adaptive Apps – Tips & Tricks
  • 17. Plasmate Workflow-driven IDE for Plasmoids: ● Create – Hack – Test – Deploy – Publish ● 1.0 end of summer ● Clone from git://anongit.kde.org/plasmate ● Build using cmake (needs kdelibs-devel) ● Start hacking Developing Device-Adaptive Apps – SDK “light”
  • 18. Mer SDK Chroot environment with everything pre-setup ● Work in progress: involves a bit of manual setup ● Easy way to cross-compile ● Easy way to build packages for $DEVICE ● Takes complexity away big time Developing Device-Adaptive Apps – Limitless SDK
  • 19. Help! • #plasma on Freenode • plasma-devel@kde.org Sebastian Kügler
  • 20. Happy hacking! Interesting blogs: • http://codecereal.blogspot.com.br/ (Daker) • http://vizZzion.org (sebas) • http://notmart.org (Marco Martin) Sebastian Kügler