使用<em>qml</em>文件我们能够快速构建UI界面，大大减少了C++代码编写界面的难度，但一些底层的编程还是需要使用C++来完成，这时我们就需要QML与C++混合编程了，一般就是使用QML 快速构建界面， C++ 实现非界面的业务逻辑和复杂运算。QML的基本类型比如Item，实际上在C++中的实现就是QQuickItem，这意味着QML中是可以使用C++类和对象的，而C++也是可以识别<em>qml</em>构建的对象并控制它的
Learn the fundamentals of QT 5 framework to develop interactive cross-platform applications
A practical guide on the fundamentals of application development with QT 5
Learn to write scalable, robust and adaptable C++ code with QT
Deploy your application on different platforms such as Windows, Mac OS, and Linux
Qt is a mature and powerful framework for delivering sophisticated applications across a multitude of platforms. It has a rich history in the Linux world, is widely used in embedded devices, and has made great strides in the Mobile arena over the past few years. However, in the Microsoft Windows and Apple Mac OS X worlds, the dominance of C#/.NET and Objective-C/Cocoa means that Qt is often overlooked.
This book demonstrates the power and flexibility of the Qt framework for desktop application development and shows how you can write your application once and deploy it to multiple operating systems. Build a complete real-world line of business (LOB) solution from scratch, with distinct C++ library, QML user interface, and QtTest-driven unit-test projects.
This is a suite of essential techniques that cover the core requirements for most LOB applications and will empower you to progress from a blank page to shipped application.
What you will learn
Install and configure the Qt Framework and Qt Creator IDE
Create a new multi-project solution from scratch and control every aspect of it with QMake
Implement a rich user interface with QML
Learn the fundamentals of QtTest and how to integrate unit testing
Build self-aware data entities that can serialize themselves to and from JSON
Manage data persistence with SQLite and CRUD operations
Reach out to the internet and consume an RSS feed
Produce application packages for distribution to other users
Who This Book Is For
This book is for application developers who want a powerful and flexible framework to create modern, responsive applications on Microsoft Windows, Apple Mac OS X, and Linux desktop platforms. You should be comfortable with C++ but no prior knowledge of Qt or QML is required.
Table of Contents
Install the Qt Framework and Qt Creator IDE
Create a new solution and sub projects ready for application development.
UX layout and navigation
Styling QML and adding custom components
Implement self aware data entities and JSON serialisation
Unit testing our data entities
Persist our data in a SQLite database
Connect to the internet and consume a RSS feed
Create a customised installation package for our application