SlideShare a Scribd company logo
Qt Quick Best Practices
Part 3
Justin Noel
Senior Consulting Engineer
ICS, Inc.
Agenda
• C++ / QML Integration
• Reusing Existing C++ Code
Using C++ and QML
Drive QML with C++
Model – View Pattern
• C++ code can know nothing about the UI
• Properties, Slots and Signals are the interface in
QML
• QML Items connect or bind to C++ Objects
• Good Design is Enforced
• C++ cannot depend on UI
• Avoids “accidental” storage of data inside UI
components
• C++ is more portable to other UI frameworks
C++ Integration Techniques
• Expose object instances from C++ to QML
• Objects appear as global variables to QML
• Effectively singletons
• Expose C++ types to QML
• New types are available for QML programmers
to use
• Remember how Rectangle and Text are actually
C++?
Creating Properties in C++
• Properties are the combination of
• Read function
• Write function
• Notify signal
• Signals/slots is Qt’s object communication system
Creating Properties in C++
• Inherit from QObject
• Use the Q_OBJECT macro
• Use the Q_PROPERTY macro
C++ Property Header
class CoffeeMaker : public QObject
{
Q_OBJECT
Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged)
public:
int getTemp() const;
void setTemp(int temp);
signals:
void tempChanged(); //Using a parameter is not required by QtQuick
};
Source is as usual
int CoffeeMaker ::getTemp() const
{
return m_temp;
}
void CoffeeMaker ::setTemp(int temp)
{
if(m_temp != temp)
{
m_temp = temp;
emit tempChanged();
}
}
Invokable C++ Methods
• Methods can be called from QML
• Any slot can be called
• Any Q_INVOKABLE can be called
Invokable C++ Return Types
• Any basic Qt or C++ type
• int, double, QString, etc
• Any returned QObject* belongs to QML
• Will be deleted by QML during GC
• NOTE: QObject* returned from a
Q_PROPERTY
• Belongs to C++
Invokable C++ Functions
class CoffeeMaker : public QObject
{
Q_OBJECT
Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged)
public:
int getTemp() const;
void setTemp(int temp);
Q_INVOKABLE void startBrew();
public slots:
void stopBrew();
signals:
void tempChanged(); //Using a parameter is not required by QtQuick
};
Exposing Instances
int main(int argc, char** argv)
{
QGuiApplication app(argc, argv);
CoffeeMaker maker;
QQuickView view;
view.rootContext()->setContextProperty(“maker”, &maker);
view.setSource(Qurl(“qrc:/main.qml”));
view.show();
return app.exec();
}
Basic C++ Integration QML
import QtQuick 2.2
Rectangle {
width: 1024
height: 768
Text {
anchors.centerIn: parent
text: “Coffee Temp” + maker.temp
}
MouseArea {
anchors.fill: parent
onClicked: maker.startBrew();
}
}
Complex Proeprties
• QObject* can be used as a property
• Used for encapsulation and creating trees of
properties
• Properties can have properties!
Complex Properties Header
class CoffeeMaker : public QObject
{
Q_OBJECT
Q_PROPERTY(QObject* options READ getOptions CONSTANT)
public:
QObject* getOptions() const { return &m_options; };
Q_INVOKABLE void startBrew();
private:
Options m_options;
};
Complex Properties Header
class Options: public QObject
{
Q_OBJECT
Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged)
public:
int getTemp() const;
void setTemp(int temp);
signals:
void tempChanged();
};
Complex Properties QML
import QtQuick 2.2
Rectangle {
width: 1024
height: 768
Text {
anchors.centerIn: parent
text: “Coffee temp” + maker.options.temp
}
MouseArea {
anchors.fill: parent
onClicked: maker.startBrew();
}
}
Enum Properties
• C++ enums can be used as QML types
• Use Q_ENUMS macro
• Use qmlRegisterUncreatableType<>(…)
• Package Name
• Major Version
• Minor Version
• Type Name
• Error Message
Enum Properties Header
class CoffeeMaker: public QObject
{
Q_OBJECT
Q_ENUMS(Strength)
Q_PROPERTY(Strength strength READ getStrength
WRITE setStrength
NOTIFY strengthChanged)
public:
CoffeeMaker();
enum Strength { Light, Medium, Dark };
Strength getStrength() const;
void setStrength(Strength newStrength);
signals:
void strengthChanged();
};
Enum Properties Source
CoffeeMaker::CoffeeMaker()
{
qmlRegisterUncreatableType<CoffeeMaker>(“MrCoffee”,
1, 0,
“CoffeeMaker”,
“Do not instance.”);
}
Enum Properties QML
import QtQuick 2.2
import MrCoffee 1.0 //Needed to get TypeInfo for CoffeeMaker
Rectangle {
width: 1024
height: 768
Text {
anchors.centerIn: parent
text:textFromStrength(maker.strength)//Evaluated as int
}
function textFromStrength(strength) { … }
MouseArea {
anchors.fill: parent
onClicked: maker.startBrew(CoffeeMaker.Strong); //Used by name
}
}
Reusing Existing Code
• QML requires that properties
• READ functions returns correct value
• Could be called anytime
• NOTIFY signal emitted when prop changes
• Immediate call to READ returns new changed value
Reuse Techniques
• Direct – Add Q_PROPERTY
• Model is already QObject based
• Stores its own data
• Wrapper – Write a new QObject class
• Model is not (or cannot be) QObject based
• Model does not store data
Direct Reuse Technique
• Use Q_PROPERTY with existing
• READ function
• WRITE function (optional)
• NOTIFY signal
• Use Q_INVOKABLE on existing methods
• Functions you want callable from the UI
Existing Header
class CoffeeMaker : public QObject
{
Q_OBJECT
public:
float targetTemp() const;
void setTargetTemp(float taregetTemp);
float temp() const;
signals:
void targetTempChanged(float targetTemp);
void tempChanged(float temp);
private:
… //Members
};
Direct Reuse Header
class CoffeeMaker : public QObject
{
Q_OBJECT
Q_PROPERTY(float targetTemp READ targetTemp NOTIFY targetTempChanged)
Q_PROPERTY(float temp READ temp NOTIFY tempChanged
public:
float targetTemp() const;
Q_INVOKABLE void setTargetTemp(float taregetTemp);
float temp() const;
signals:
void targetTempChanged(float targetTemp);
void tempChanged(float temp);
...
};
Read Only Properties
• Properties can be read-only
• Slots or Q_INVOKABLE functions
• Can change state and emit signals
• Sometimes it’s cleaner to have
• Read only properties
• Q_INVOKABLE setter functions
Direct Reuse Issues
• Inherited NOTIFY signals compile error
• NOTIFY signal needs be in the same class as
Q_PROPERTY declaration
• Workaround:
• Specify new signal in subclass
• Use SIGNAL – SIGNAL connection in ctor
Wrapper Reuse Technique
• Class that provides the QObject interface
• Inheritance
• Composition – Easier to test
• Less chance of “rocking the boat”
• More typing. More code
Wrappers fix a lot of issues
• Wrappers can work around limitations
• Class is template based
• Can’t directly inherit QObject
• Class does not use signals
• Uses some other callback mechanism
• Class does not follow get/set/notify pattern
• Wrapper can implement local data cache
Model-View-Presenter Pattern
• Wrappers can be an implementation of MVP
• Also called Supervising Controller Pattern
• Provides flexibility between the Model and U
• Presentation Layer can “reformat” data
• Create strings from multiple model values
• Convert QList<Foo> into an QAbstractItemModel
Model – View Presenter
View
Model
Presenter
Slots
Properties
State
Changed
Get / Set
Existing Header
template<class T> class Option
{
public:
T getSetting() const;
void setSetting(T newSetting);
void registerFooCallback(Callback<T>&);
private:
T m_setting;
CallbackCollection<T> m_settingCallbacks;
};
Wrapper Header
class DoubleOptionWrapper : public QObject, public Option<double>
{
Q_OBJECT
Q_PROPERTY(double setting READ getSetting WRITE setSetting
NOTIFY settingChanged)
public:
DoubleOptionWrapper();
signals:
void settingChanged();
private:
void handleSettingCallback(double newSetting);
Callback<double> m_settingCallback;
};
Wrapper Source
DoubleOptionWrapper::DoubleOptionWrapper() :
m_settingCallback(this, DoubleOptionWrapper::handleSettingCallback)
{
registerSettingCallback(m_settingCallback);
}
void DoubleOptionWrapper::handleSettingCallback(double newSetting)
{
Q_UNUSED(newSetting)
emit settingChanged();
}
Another Wrapper Example
• Issues
• No storage of values in model
• Does not support get function
• Does use QObject and signals
Existing Header
class BusData : public QObject
{
Q_OBJECT
public:
void requestSetTargetTemp(double temp);
signals:
void targetTempChanged(double temp);
void error(const QString& errorMessage);
private:
CanBusComm m_canBus;
};
Existing Code Structure
BusData TempPanel
void BusData::handleCan()
{
…
emit tempChanged(temp);
}
void setTemp(double temp)
{
m_TempLabel->setText(temp);
}
// UI Label is used for storage!
// Works, but not good design!
Connect()
Wrapper Header
class BusDataBridge : public QObject
{
Q_OBJECT
Q_PROPERTY(double targetTemp READ getTargetTemp NOTIFY targetTempChanged)
public:
BusDataBridge(BusData& busData);
double getTargetTemp() const;
Q_INVOKABLE void requestSetTargetTemp(double temp);
signals:
void targetTempChanged();
private slots:
void handleTempTargetChanged(double temp);
private:
BusData& m_busData;
double m_targetTemp;
};
Wrapper Source
BusDataBridge::BusDataBridge(BusData& busData) :
m_busData(busData)
{
connect(m_busData, SIGNAL(targetTempChanged(double),
this, SLOT(handleTargetTempChanged(double));
connect(m_busData, SIGNAL(error(QString)),
this, SIGNAL(error(QString)));
}
void BusDataBridge::handleTargetTemperatureChanged(double temp)
{
if(m_temp != temp)
{
m_temp = temp;
emit targetTemperatureChanged();
}
}
Wrapper Source
double BusDataBridge::getTargetTemp() const
{
return m_targetTemp;
}
void BusDataBridge::requestSetTargetTemperature(double temp)
{
m_busData.requestSetTargetTemperature(temp);
}
Threading Considerations
• BusData example can be useful pattern
• If BusData reads data on another thread
• Sig/Slot connections work across threads
• Qt will dispatch an async event automatically
• Automatic Copy/Lock of data across threads
• Storing data in Bridge object (on GUI thread).
• Good! Avoids locking on read
QObject Thread Affinity
• QObjects “belong” to a thread
• Default is the thread that created the QObject
• QObjects can be assigned another thread via
• obj->moveToThread(otherThread)
Cross Thread Signals and Slots
• At emit time Qt compares thread ids
• The id of the current thread calling emit signal
• The id the receiver belongs to via obj->thread()
• If the threads are the same slots are called
• If different an event is packaged/posted
Cross Thread Signal and Slot
BusBridge
void handleCanData(data)
{
…
emit tempChanged(temp);
}
void handleTempChanged(temp)
{
if(m_temp != temp) {
m_temp = temp;
emit tempChanged();
}
}
BusData
Worker Thread Main Thread
Event Loop
postEvent()
Passing Data Across Threads
• Signal parameters across threads
• Need to be QVariant Compatible
• Default constructor
• Assignment Operator
• Copy Constructor
• Q_DECLARE_METATYPE(Type) at end of Header
• qRegisterMetaType<Type>(“Type”); in Source
Implicit Sharing
• When copies are not actually copies
• Most data objects in Qt are implicitly shared
• QString, QList, QMap, QVector, etc
• Implemented w/ thread safe ref counting
• Copy constructor and assignment operator
• Copies an internal pointer and increments the ref
count
Exposing C++ Types to QML
• Rather than making 1 CoffeeMaker in main
• Allow QML Programmer to create N CoffeMaker
items
• All of the above applies to exposed types
• Instead of using setContextProperty
• Use qmlRegisterType<>()
Expose C++ Types
int main(int argc, char** argv)
{
QGuiApplication app(argc, argv);
qmlRegisterType<CoffeeMaker>(“MrCoffee”, 1, 0, “CoffeeMaker”);
QQuickView view;
view.setSource(Qurl(“qrc:/main.qml”));
view.show();
return app.exec();
}
Expose C++ Types QML
import QtQuick 2.2
import MrCoffee 1.0
Rectangle {
CoffeeMaker { id: maker }
Text {
anchors.centerIn: parent
text: “Coffee Temp” + maker.temp
}
MouseArea {
anchors.fill: parent
onClicked: maker.startBrew();
}
}
Thank You!
Justin Noel
Senior Consulting Engineer
ICS, Inc.
Ad

More Related Content

What's hot (20)

Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3
ICS
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key concepts
ICS
 
Qt Qml
Qt QmlQt Qml
Qt Qml
Steven Song
 
QVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI developmentQVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI development
ICS
 
Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1
Emertxe Information Technologies Pvt Ltd
 
Hello, QML
Hello, QMLHello, QML
Hello, QML
Jack Yang
 
Qt multi threads
Qt multi threadsQt multi threads
Qt multi threads
Ynon Perek
 
Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2
Emertxe Information Technologies Pvt Ltd
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7
Pasi Kellokoski
 
02 - Basics of Qt
02 - Basics of Qt02 - Basics of Qt
02 - Basics of Qt
Andreas Jakl
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong?
ICS
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
ICS
 
Qt Framework Events Signals Threads
Qt Framework Events Signals ThreadsQt Framework Events Signals Threads
Qt Framework Events Signals Threads
Neera Mital
 
Qt programming-using-cpp
Qt programming-using-cppQt programming-using-cpp
Qt programming-using-cpp
Emertxe Information Technologies Pvt Ltd
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
ICS
 
Introduction to Qt programming
Introduction to Qt programmingIntroduction to Qt programming
Introduction to Qt programming
Dragos Tudor Acostachioaie
 
Basics of Model/View Qt programming
Basics of Model/View Qt programmingBasics of Model/View Qt programming
Basics of Model/View Qt programming
ICS
 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
Juha Peltomäki
 
Qt for beginners
Qt for beginnersQt for beginners
Qt for beginners
Sergio Shevchenko
 
Practical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme ChangePractical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme Change
Burkhard Stubert
 
Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3Best Practices in Qt Quick/QML - Part 3
Best Practices in Qt Quick/QML - Part 3
ICS
 
Qt for beginners part 1 overview and key concepts
Qt for beginners part 1   overview and key conceptsQt for beginners part 1   overview and key concepts
Qt for beginners part 1 overview and key concepts
ICS
 
QVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI developmentQVariant, QObject — Qt's not just for GUI development
QVariant, QObject — Qt's not just for GUI development
ICS
 
Qt multi threads
Qt multi threadsQt multi threads
Qt multi threads
Ynon Perek
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7
Pasi Kellokoski
 
QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong? QThreads: Are You Using Them Wrong?
QThreads: Are You Using Them Wrong?
ICS
 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
ICS
 
Qt Framework Events Signals Threads
Qt Framework Events Signals ThreadsQt Framework Events Signals Threads
Qt Framework Events Signals Threads
Neera Mital
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
ICS
 
Basics of Model/View Qt programming
Basics of Model/View Qt programmingBasics of Model/View Qt programming
Basics of Model/View Qt programming
ICS
 
Practical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme ChangePractical QML - Key Navigation, Dynamic Language and Theme Change
Practical QML - Key Navigation, Dynamic Language and Theme Change
Burkhard Stubert
 

Viewers also liked (17)

[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
ICS
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
ICS
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
ICS
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design Patterns
Ynon Perek
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the experts
ICS
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
Puja Pramudya
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applications
account inactive
 
Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...
Ikusi Velatia
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and Slots
Jussi Pohjolainen
 
Qt Widget In-Depth
Qt Widget In-DepthQt Widget In-Depth
Qt Widget In-Depth
account inactive
 
Hybrid Apps with Qt
Hybrid Apps with QtHybrid Apps with Qt
Hybrid Apps with Qt
Ynon Perek
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
account inactive
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
Ariya Hidayat
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and Qt
ICS
 
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
ICS
 
What's unique to Qt
What's unique to QtWhat's unique to Qt
What's unique to Qt
Yikei Lu
 
How to Make Your Qt App Look Native
How to Make Your Qt App Look NativeHow to Make Your Qt App Look Native
How to Make Your Qt App Look Native
account inactive
 
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
ICS
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
ICS
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
ICS
 
Qt Design Patterns
Qt Design PatternsQt Design Patterns
Qt Design Patterns
Ynon Perek
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the experts
ICS
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applications
account inactive
 
Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...
Ikusi Velatia
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and Slots
Jussi Pohjolainen
 
Hybrid Apps with Qt
Hybrid Apps with QtHybrid Apps with Qt
Hybrid Apps with Qt
Ynon Perek
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
account inactive
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
Ariya Hidayat
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and Qt
ICS
 
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with QtConvert Your Legacy OpenGL Code to Modern OpenGL with Qt
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
ICS
 
What's unique to Qt
What's unique to QtWhat's unique to Qt
What's unique to Qt
Yikei Lu
 
How to Make Your Qt App Look Native
How to Make Your Qt App Look NativeHow to Make Your Qt App Look Native
How to Make Your Qt App Look Native
account inactive
 
Ad

Similar to Best Practices in Qt Quick/QML - Part III (20)

Integrazione QML / C++
Integrazione QML / C++Integrazione QML / C++
Integrazione QML / C++
Paolo Sereno
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
QT-day
 
Petri Niemi Qt Web Kit
Petri Niemi Qt Web KitPetri Niemi Qt Web Kit
Petri Niemi Qt Web Kit
NokiaAppForum
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overview
Fantageek
 
Qt Quick in depth
Qt Quick in depthQt Quick in depth
Qt Quick in depth
Develer S.r.l.
 
Treinamento Qt básico - aula II
Treinamento Qt básico - aula IITreinamento Qt básico - aula II
Treinamento Qt básico - aula II
Marcelo Barros de Almeida
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
Andreas Jakl
 
The Ring programming language version 1.10 book - Part 104 of 212
The Ring programming language version 1.10 book - Part 104 of 212The Ring programming language version 1.10 book - Part 104 of 212
The Ring programming language version 1.10 book - Part 104 of 212
Mahmoud Samir Fayed
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
Daker Fernandes
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1
NokiaAppForum
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Janel Heilbrunn
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
ICS
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
Clare Macrae
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC
 
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
Ortus Solutions, Corp
 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Application
account inactive
 
Qt Workshop
Qt WorkshopQt Workshop
Qt Workshop
Johan Thelin
 
Integrazione QML / C++
Integrazione QML / C++Integrazione QML / C++
Integrazione QML / C++
Paolo Sereno
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
QT-day
 
Petri Niemi Qt Web Kit
Petri Niemi Qt Web KitPetri Niemi Qt Web Kit
Petri Niemi Qt Web Kit
NokiaAppForum
 
Objective-C Runtime overview
Objective-C Runtime overviewObjective-C Runtime overview
Objective-C Runtime overview
Fantageek
 
06 - Qt Communication
06 - Qt Communication06 - Qt Communication
06 - Qt Communication
Andreas Jakl
 
The Ring programming language version 1.10 book - Part 104 of 212
The Ring programming language version 1.10 book - Part 104 of 212The Ring programming language version 1.10 book - Part 104 of 212
The Ring programming language version 1.10 book - Part 104 of 212
Mahmoud Samir Fayed
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
Daker Fernandes
 
Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1Petri Niemi Qt Advanced Part 1
Petri Niemi Qt Advanced Part 1
NokiaAppForum
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
Janel Heilbrunn
 
Porting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - WebinarPorting Motif Applications to Qt - Webinar
Porting Motif Applications to Qt - Webinar
ICS
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Quickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop ApplicationsQuickly Testing Qt Desktop Applications
Quickly Testing Qt Desktop Applications
Clare Macrae
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companionPGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC 2018 - Patroni: Kubernetes-native PostgreSQL companion
PGConf APAC
 
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
ITB2019 10 in 50: Ten Coldbox Modules You Should be Using in Every App - Jon ...
Ortus Solutions, Corp
 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Application
account inactive
 
Ad

More from ICS (20)

Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step ExampleThreat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
ICS
 
8 Mandatory Security Control Categories for Successful Submissions
8 Mandatory Security Control Categories for Successful Submissions8 Mandatory Security Control Categories for Successful Submissions
8 Mandatory Security Control Categories for Successful Submissions
ICS
 
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdfFuture-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
ICS
 
Choosing an Embedded GUI: Comparative Analysis of UI Frameworks
Choosing an Embedded GUI: Comparative Analysis of UI FrameworksChoosing an Embedded GUI: Comparative Analysis of UI Frameworks
Choosing an Embedded GUI: Comparative Analysis of UI Frameworks
ICS
 
Medical Device Cyber Testing to Meet FDA Requirements
Medical Device Cyber Testing to Meet FDA RequirementsMedical Device Cyber Testing to Meet FDA Requirements
Medical Device Cyber Testing to Meet FDA Requirements
ICS
 
Threat Modeling and Risk Assessment Webinar.pdf
Threat Modeling and Risk Assessment Webinar.pdfThreat Modeling and Risk Assessment Webinar.pdf
Threat Modeling and Risk Assessment Webinar.pdf
ICS
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
ICS
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
ICS
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ICS
 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdf
ICS
 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
ICS
 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues Webinar
ICS
 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
ICS
 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
ICS
 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdf
ICS
 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdf
ICS
 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up
ICS
 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdf
ICS
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step ExampleThreat Modeling & Risk Assessment Webinar: A Step-by-Step Example
Threat Modeling & Risk Assessment Webinar: A Step-by-Step Example
ICS
 
8 Mandatory Security Control Categories for Successful Submissions
8 Mandatory Security Control Categories for Successful Submissions8 Mandatory Security Control Categories for Successful Submissions
8 Mandatory Security Control Categories for Successful Submissions
ICS
 
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdfFuture-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
Future-Proofing Embedded Device Capabilities with the Qt 6 Plugin Mechanism.pdf
ICS
 
Choosing an Embedded GUI: Comparative Analysis of UI Frameworks
Choosing an Embedded GUI: Comparative Analysis of UI FrameworksChoosing an Embedded GUI: Comparative Analysis of UI Frameworks
Choosing an Embedded GUI: Comparative Analysis of UI Frameworks
ICS
 
Medical Device Cyber Testing to Meet FDA Requirements
Medical Device Cyber Testing to Meet FDA RequirementsMedical Device Cyber Testing to Meet FDA Requirements
Medical Device Cyber Testing to Meet FDA Requirements
ICS
 
Threat Modeling and Risk Assessment Webinar.pdf
Threat Modeling and Risk Assessment Webinar.pdfThreat Modeling and Risk Assessment Webinar.pdf
Threat Modeling and Risk Assessment Webinar.pdf
ICS
 
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceSecure-by-Design Using Hardware and Software Protection for FDA Compliance
Secure-by-Design Using Hardware and Software Protection for FDA Compliance
ICS
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
ICS
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ICS
 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdf
ICS
 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
ICS
 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues Webinar
ICS
 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
ICS
 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
ICS
 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdf
ICS
 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdf
ICS
 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up
ICS
 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdf
ICS
 

Recently uploaded (20)

Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 

Best Practices in Qt Quick/QML - Part III

  • 1. Qt Quick Best Practices Part 3 Justin Noel Senior Consulting Engineer ICS, Inc.
  • 2. Agenda • C++ / QML Integration • Reusing Existing C++ Code
  • 5. Model – View Pattern • C++ code can know nothing about the UI • Properties, Slots and Signals are the interface in QML • QML Items connect or bind to C++ Objects • Good Design is Enforced • C++ cannot depend on UI • Avoids “accidental” storage of data inside UI components • C++ is more portable to other UI frameworks
  • 6. C++ Integration Techniques • Expose object instances from C++ to QML • Objects appear as global variables to QML • Effectively singletons • Expose C++ types to QML • New types are available for QML programmers to use • Remember how Rectangle and Text are actually C++?
  • 7. Creating Properties in C++ • Properties are the combination of • Read function • Write function • Notify signal • Signals/slots is Qt’s object communication system
  • 8. Creating Properties in C++ • Inherit from QObject • Use the Q_OBJECT macro • Use the Q_PROPERTY macro
  • 9. C++ Property Header class CoffeeMaker : public QObject { Q_OBJECT Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged) public: int getTemp() const; void setTemp(int temp); signals: void tempChanged(); //Using a parameter is not required by QtQuick };
  • 10. Source is as usual int CoffeeMaker ::getTemp() const { return m_temp; } void CoffeeMaker ::setTemp(int temp) { if(m_temp != temp) { m_temp = temp; emit tempChanged(); } }
  • 11. Invokable C++ Methods • Methods can be called from QML • Any slot can be called • Any Q_INVOKABLE can be called
  • 12. Invokable C++ Return Types • Any basic Qt or C++ type • int, double, QString, etc • Any returned QObject* belongs to QML • Will be deleted by QML during GC • NOTE: QObject* returned from a Q_PROPERTY • Belongs to C++
  • 13. Invokable C++ Functions class CoffeeMaker : public QObject { Q_OBJECT Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged) public: int getTemp() const; void setTemp(int temp); Q_INVOKABLE void startBrew(); public slots: void stopBrew(); signals: void tempChanged(); //Using a parameter is not required by QtQuick };
  • 14. Exposing Instances int main(int argc, char** argv) { QGuiApplication app(argc, argv); CoffeeMaker maker; QQuickView view; view.rootContext()->setContextProperty(“maker”, &maker); view.setSource(Qurl(“qrc:/main.qml”)); view.show(); return app.exec(); }
  • 15. Basic C++ Integration QML import QtQuick 2.2 Rectangle { width: 1024 height: 768 Text { anchors.centerIn: parent text: “Coffee Temp” + maker.temp } MouseArea { anchors.fill: parent onClicked: maker.startBrew(); } }
  • 16. Complex Proeprties • QObject* can be used as a property • Used for encapsulation and creating trees of properties • Properties can have properties!
  • 17. Complex Properties Header class CoffeeMaker : public QObject { Q_OBJECT Q_PROPERTY(QObject* options READ getOptions CONSTANT) public: QObject* getOptions() const { return &m_options; }; Q_INVOKABLE void startBrew(); private: Options m_options; };
  • 18. Complex Properties Header class Options: public QObject { Q_OBJECT Q_PROPERTY(int temp READ getTemp WRITE setTemp NOTIFY tempChanged) public: int getTemp() const; void setTemp(int temp); signals: void tempChanged(); };
  • 19. Complex Properties QML import QtQuick 2.2 Rectangle { width: 1024 height: 768 Text { anchors.centerIn: parent text: “Coffee temp” + maker.options.temp } MouseArea { anchors.fill: parent onClicked: maker.startBrew(); } }
  • 20. Enum Properties • C++ enums can be used as QML types • Use Q_ENUMS macro • Use qmlRegisterUncreatableType<>(…) • Package Name • Major Version • Minor Version • Type Name • Error Message
  • 21. Enum Properties Header class CoffeeMaker: public QObject { Q_OBJECT Q_ENUMS(Strength) Q_PROPERTY(Strength strength READ getStrength WRITE setStrength NOTIFY strengthChanged) public: CoffeeMaker(); enum Strength { Light, Medium, Dark }; Strength getStrength() const; void setStrength(Strength newStrength); signals: void strengthChanged(); };
  • 23. Enum Properties QML import QtQuick 2.2 import MrCoffee 1.0 //Needed to get TypeInfo for CoffeeMaker Rectangle { width: 1024 height: 768 Text { anchors.centerIn: parent text:textFromStrength(maker.strength)//Evaluated as int } function textFromStrength(strength) { … } MouseArea { anchors.fill: parent onClicked: maker.startBrew(CoffeeMaker.Strong); //Used by name } }
  • 24. Reusing Existing Code • QML requires that properties • READ functions returns correct value • Could be called anytime • NOTIFY signal emitted when prop changes • Immediate call to READ returns new changed value
  • 25. Reuse Techniques • Direct – Add Q_PROPERTY • Model is already QObject based • Stores its own data • Wrapper – Write a new QObject class • Model is not (or cannot be) QObject based • Model does not store data
  • 26. Direct Reuse Technique • Use Q_PROPERTY with existing • READ function • WRITE function (optional) • NOTIFY signal • Use Q_INVOKABLE on existing methods • Functions you want callable from the UI
  • 27. Existing Header class CoffeeMaker : public QObject { Q_OBJECT public: float targetTemp() const; void setTargetTemp(float taregetTemp); float temp() const; signals: void targetTempChanged(float targetTemp); void tempChanged(float temp); private: … //Members };
  • 28. Direct Reuse Header class CoffeeMaker : public QObject { Q_OBJECT Q_PROPERTY(float targetTemp READ targetTemp NOTIFY targetTempChanged) Q_PROPERTY(float temp READ temp NOTIFY tempChanged public: float targetTemp() const; Q_INVOKABLE void setTargetTemp(float taregetTemp); float temp() const; signals: void targetTempChanged(float targetTemp); void tempChanged(float temp); ... };
  • 29. Read Only Properties • Properties can be read-only • Slots or Q_INVOKABLE functions • Can change state and emit signals • Sometimes it’s cleaner to have • Read only properties • Q_INVOKABLE setter functions
  • 30. Direct Reuse Issues • Inherited NOTIFY signals compile error • NOTIFY signal needs be in the same class as Q_PROPERTY declaration • Workaround: • Specify new signal in subclass • Use SIGNAL – SIGNAL connection in ctor
  • 31. Wrapper Reuse Technique • Class that provides the QObject interface • Inheritance • Composition – Easier to test • Less chance of “rocking the boat” • More typing. More code
  • 32. Wrappers fix a lot of issues • Wrappers can work around limitations • Class is template based • Can’t directly inherit QObject • Class does not use signals • Uses some other callback mechanism • Class does not follow get/set/notify pattern • Wrapper can implement local data cache
  • 33. Model-View-Presenter Pattern • Wrappers can be an implementation of MVP • Also called Supervising Controller Pattern • Provides flexibility between the Model and U • Presentation Layer can “reformat” data • Create strings from multiple model values • Convert QList<Foo> into an QAbstractItemModel
  • 34. Model – View Presenter View Model Presenter Slots Properties State Changed Get / Set
  • 35. Existing Header template<class T> class Option { public: T getSetting() const; void setSetting(T newSetting); void registerFooCallback(Callback<T>&); private: T m_setting; CallbackCollection<T> m_settingCallbacks; };
  • 36. Wrapper Header class DoubleOptionWrapper : public QObject, public Option<double> { Q_OBJECT Q_PROPERTY(double setting READ getSetting WRITE setSetting NOTIFY settingChanged) public: DoubleOptionWrapper(); signals: void settingChanged(); private: void handleSettingCallback(double newSetting); Callback<double> m_settingCallback; };
  • 37. Wrapper Source DoubleOptionWrapper::DoubleOptionWrapper() : m_settingCallback(this, DoubleOptionWrapper::handleSettingCallback) { registerSettingCallback(m_settingCallback); } void DoubleOptionWrapper::handleSettingCallback(double newSetting) { Q_UNUSED(newSetting) emit settingChanged(); }
  • 38. Another Wrapper Example • Issues • No storage of values in model • Does not support get function • Does use QObject and signals
  • 39. Existing Header class BusData : public QObject { Q_OBJECT public: void requestSetTargetTemp(double temp); signals: void targetTempChanged(double temp); void error(const QString& errorMessage); private: CanBusComm m_canBus; };
  • 40. Existing Code Structure BusData TempPanel void BusData::handleCan() { … emit tempChanged(temp); } void setTemp(double temp) { m_TempLabel->setText(temp); } // UI Label is used for storage! // Works, but not good design! Connect()
  • 41. Wrapper Header class BusDataBridge : public QObject { Q_OBJECT Q_PROPERTY(double targetTemp READ getTargetTemp NOTIFY targetTempChanged) public: BusDataBridge(BusData& busData); double getTargetTemp() const; Q_INVOKABLE void requestSetTargetTemp(double temp); signals: void targetTempChanged(); private slots: void handleTempTargetChanged(double temp); private: BusData& m_busData; double m_targetTemp; };
  • 42. Wrapper Source BusDataBridge::BusDataBridge(BusData& busData) : m_busData(busData) { connect(m_busData, SIGNAL(targetTempChanged(double), this, SLOT(handleTargetTempChanged(double)); connect(m_busData, SIGNAL(error(QString)), this, SIGNAL(error(QString))); } void BusDataBridge::handleTargetTemperatureChanged(double temp) { if(m_temp != temp) { m_temp = temp; emit targetTemperatureChanged(); } }
  • 43. Wrapper Source double BusDataBridge::getTargetTemp() const { return m_targetTemp; } void BusDataBridge::requestSetTargetTemperature(double temp) { m_busData.requestSetTargetTemperature(temp); }
  • 44. Threading Considerations • BusData example can be useful pattern • If BusData reads data on another thread • Sig/Slot connections work across threads • Qt will dispatch an async event automatically • Automatic Copy/Lock of data across threads • Storing data in Bridge object (on GUI thread). • Good! Avoids locking on read
  • 45. QObject Thread Affinity • QObjects “belong” to a thread • Default is the thread that created the QObject • QObjects can be assigned another thread via • obj->moveToThread(otherThread)
  • 46. Cross Thread Signals and Slots • At emit time Qt compares thread ids • The id of the current thread calling emit signal • The id the receiver belongs to via obj->thread() • If the threads are the same slots are called • If different an event is packaged/posted
  • 47. Cross Thread Signal and Slot BusBridge void handleCanData(data) { … emit tempChanged(temp); } void handleTempChanged(temp) { if(m_temp != temp) { m_temp = temp; emit tempChanged(); } } BusData Worker Thread Main Thread Event Loop postEvent()
  • 48. Passing Data Across Threads • Signal parameters across threads • Need to be QVariant Compatible • Default constructor • Assignment Operator • Copy Constructor • Q_DECLARE_METATYPE(Type) at end of Header • qRegisterMetaType<Type>(“Type”); in Source
  • 49. Implicit Sharing • When copies are not actually copies • Most data objects in Qt are implicitly shared • QString, QList, QMap, QVector, etc • Implemented w/ thread safe ref counting • Copy constructor and assignment operator • Copies an internal pointer and increments the ref count
  • 50. Exposing C++ Types to QML • Rather than making 1 CoffeeMaker in main • Allow QML Programmer to create N CoffeMaker items • All of the above applies to exposed types • Instead of using setContextProperty • Use qmlRegisterType<>()
  • 51. Expose C++ Types int main(int argc, char** argv) { QGuiApplication app(argc, argv); qmlRegisterType<CoffeeMaker>(“MrCoffee”, 1, 0, “CoffeeMaker”); QQuickView view; view.setSource(Qurl(“qrc:/main.qml”)); view.show(); return app.exec(); }
  • 52. Expose C++ Types QML import QtQuick 2.2 import MrCoffee 1.0 Rectangle { CoffeeMaker { id: maker } Text { anchors.centerIn: parent text: “Coffee Temp” + maker.temp } MouseArea { anchors.fill: parent onClicked: maker.startBrew(); } }
  • 53. Thank You! Justin Noel Senior Consulting Engineer ICS, Inc.