Learn Qt 5
Nicholas Sherriff (Nick)
- 346 Seiten
- English
- ePUB (handyfreundlich)
- Über iOS und Android verfügbar
Learn Qt 5
Nicholas Sherriff (Nick)
Über dieses Buch
Learn the fundamentals of QT 5 framework to develop interactive cross-platform applicationsAbout This Book• 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 LinuxWho This Book Is ForThis 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.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 usersIn DetailQt 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.Style and approachThis book takes a hands-on approach to app development that emphasizes the key concepts while you're doing the project work.
Häufig gestellte Fragen
Information
Persistence
- SQLite
- Primary keys
- Creating clients
- Finding clients
- Editing clients
- Deleting clients
SQLite
QT += sql
#ifndef IDATABASECONTROLLER_H #define IDATABASECONTROLLER_H #include <QJsonArray> #include <QJsonObject> #include <QList> #include <QObject> #include <QString> #include <cm-lib_global.h> namespace cm { namespace controllers { class CMLIBSHARED_EXPORT IDatabaseController : public QObject { Q_OBJECT public: IDatabaseController(QObject* parent) : QObject(parent){} virtual ~IDatabaseController(){} virtual bool createRow(const QString& tableName, const QString& id,
const QJsonObject& jsonObject) const = 0; virtual bool deleteRow(const QString& tableName, const QString& id)
const = 0; virtual QJsonArray find(const QString& tableName, const QString&
searchText) const = 0; virtual QJsonObject readRow(const QString& tableName, const
QString& id) const = 0; virtual bool updateRow(const QString& tableName, const QString& id,
const QJsonObject& jsonObject) const = 0; }; }} #endif
#ifndef DATABASECONTROLLER_H #define DATABASECONTROLLER_H #include <QObject> #include <QScopedPointer> #include <controllers/i-database-controller.h> #include <cm-lib_global.h> namespace cm { namespace controllers { class CMLIBSHARED_EXPORT DatabaseController : public IDatabaseController { Q_OBJECT public: explicit DatabaseController(QObject* parent = nullptr); ~DatabaseController(); bool createRow(const QString& tableName, const QString& id, const
QJsonObject& jsonObject) const override; bool deleteRow(const QString& tableName, const QString& id) const
override; QJsonArray find(const QString& tableName, const QString&
searchText) const override; QJsonObject readRow(const QString& tableName, const QStrin...