logo资料库

《从入门学习Qt的教程》PDF档.pdf

第1页 / 共110页
第2页 / 共110页
第3页 / 共110页
第4页 / 共110页
第5页 / 共110页
第6页 / 共110页
第7页 / 共110页
第8页 / 共110页
资料共110页,剩余部分请下载后查看
About
Chapter 1: Getting started with Qt
Remarks
Versions
Examples
Installation and Setup on Windows and Linux
Hello World
Basic application with QtCreator and QtDesigner
Chapter 2: About using layouts, widget parenting
Introduction
Remarks
Examples
Basic Horizontal Layout
Basic Vertical Layout
Combining Layouts
Grid layout example
Chapter 3: Build QtWebEngine from source
Introduction
Examples
Build on Windows
Chapter 4: CMakeLists.txt for your Qt project
Examples
CMakeLists.txt for Qt 5
Chapter 5: Common Pitfalls
Examples
Using Qt:DirectConnection when receiver object doesn't receive signal
Chapter 6: Communication between QML and C++
Introduction
Examples
Call C++ in QML
Call QML in C++
Chapter 7: Deploying Qt applications
Examples
Deploying on windows
Integrating with CMake
Deploying on Mac
Deploying on linux
Chapter 8: Header on QListView
Introduction
Examples
Custom QListView declaration
Implementation of the custom QListView
Use case: MainWindow declaration
Use case: Implementation
Use case: Sample output
Chapter 9: Implicit sharing
Remarks
Examples
Basic Concept
Chapter 10: Model/View
Examples
A Simple Read-only Table to View Data from a Model
A simple tree model
Chapter 11: Multimedia
Remarks
Examples
Video Playback in Qt 5
Audio Playback in Qt5
Chapter 12: QDialogs
Remarks
Examples
MyCompareFileDialog.h
MyCompareFileDialogDialog.cpp
MainWindow.h
MainWindow.cpp
main.cpp
mainwindow.ui
Chapter 13: QGraphics
Examples
Pan, zoom, and rotate with QGraphicsView
Chapter 14: qmake
Examples
Default "pro" file.
Preserving source directory structure in a build (undocumented "object_parallel_to_source" option).
Simple Example (Linux)
SUBDIRS example
Library example
Creating a project file from existing code
Chapter 15: QObject
Remarks
Examples
QObject example
qobject_cast
QObject Lifetime and Ownership
Chapter 16: Qt - Dealing with Databases
Remarks
Examples
Using a Database on Qt
Qt - Dealing with Sqlite Databases
Qt - Dealing with ODBC Databases
Qt - Dealing with in-memory Sqlite Databases
Remove Database connection correctly
Chapter 17: Qt Container Classes
Remarks
Examples
QStack usage
QVector usage
QLinkedList usage
QList
Chapter 18: Qt Network
Introduction
Examples
TCP Client
TCP Server
Chapter 19: Qt Resource System
Introduction
Examples
Referencing files within code
Chapter 20: QTimer
Remarks
Examples
Simple example
Singleshot Timer with Lambda function as slot
Using QTimer to run code on main thread
Basic Usage
QTimer::singleShot simple usage
Chapter 21: Signals and Slots
Introduction
Remarks
Examples
A Small Example
The new Qt5 connection syntax
Connecting overloaded signals/slots
Multi window signal slot connection
Chapter 22: SQL on Qt
Examples
Basic connection and query
Qt SQL query parameters
MS SQL Server Database Connection using QODBC
Chapter 23: Threading and Concurrency
Remarks
Examples
Basic usage of QThread
QtConcurrent Run
Invoking slots from other threads
Chapter 24: Using Style Sheets Effectively
Examples
Setting a UI widget's stylesheet
Credits
Qt #qt
Table of Contents About Chapter 1: Getting started with Qt Remarks Versions Examples Installation and Setup on Windows and Linux Hello World Basic application with QtCreator and QtDesigner Chapter 2: About using layouts, widget parenting Introduction Remarks Examples Basic Horizontal Layout Basic Vertical Layout Combining Layouts Grid layout example Chapter 3: Build QtWebEngine from source Introduction Examples Build on Windows Chapter 4: CMakeLists.txt for your Qt project Examples CMakeLists.txt for Qt 5 Chapter 5: Common Pitfalls Examples Using Qt:DirectConnection when receiver object doesn't receive signal Chapter 6: Communication between QML and C++ Introduction Examples Call C++ in QML 1 2 2 2 2 2 8 9 13 13 13 13 13 14 15 16 19 19 19 19 20 20 20 22 22 22 24 24 24 24
Call QML in C++ Chapter 7: Deploying Qt applications Examples Deploying on windows Integrating with CMake Deploying on Mac Deploying on linux Chapter 8: Header on QListView Introduction Examples Custom QListView declaration Implementation of the custom QListView Use case: MainWindow declaration Use case: Implementation Use case: Sample output Chapter 9: Implicit sharing Remarks Examples Basic Concept Chapter 10: Model/View Examples A Simple Read-only Table to View Data from a Model A simple tree model Chapter 11: Multimedia Remarks Examples Video Playback in Qt 5 Audio Playback in Qt5 Chapter 12: QDialogs Remarks Examples MyCompareFileDialog.h 25 30 30 30 30 31 32 33 33 33 33 34 35 35 36 38 38 38 38 40 40 40 43 47 47 47 47 47 49 49 49 49
MyCompareFileDialogDialog.cpp MainWindow.h MainWindow.cpp main.cpp mainwindow.ui Chapter 13: QGraphics Examples Pan, zoom, and rotate with QGraphicsView Chapter 14: qmake Examples Default "pro" file. Preserving source directory structure in a build (undocumented "object_parallel_to_source" Simple Example (Linux) SUBDIRS example Library example Creating a project file from existing code Chapter 15: QObject Remarks Examples QObject example qobject_cast QObject Lifetime and Ownership Chapter 16: Qt - Dealing with Databases Remarks Examples Using a Database on Qt Qt - Dealing with Sqlite Databases Qt - Dealing with ODBC Databases Qt - Dealing with in-memory Sqlite Databases Remove Database connection correctly Chapter 17: Qt Container Classes Remarks 49 50 50 51 51 53 53 53 55 55 55 55 56 57 59 59 61 61 61 61 61 62 64 64 64 64 65 66 68 69 71 71
Examples QStack usage QVector usage QLinkedList usage QList Chapter 18: Qt Network Introduction Examples TCP Client TCP Server Chapter 19: Qt Resource System Introduction Examples Referencing files within code Chapter 20: QTimer Remarks Examples Simple example Singleshot Timer with Lambda function as slot Using QTimer to run code on main thread Basic Usage QTimer::singleShot simple usage Chapter 21: Signals and Slots Introduction Remarks Examples A Small Example The new Qt5 connection syntax Connecting overloaded signals/slots Multi window signal slot connection Chapter 22: SQL on Qt Examples 71 71 71 72 72 75 75 75 75 77 81 81 81 81 82 82 82 82 84 84 84 85 87 87 87 87 87 88 90 91 94 94
Basic connection and query Qt SQL query parameters MS SQL Server Database Connection using QODBC Chapter 23: Threading and Concurrency Remarks Examples Basic usage of QThread QtConcurrent Run Invoking slots from other threads Chapter 24: Using Style Sheets Effectively Examples Setting a UI widget's stylesheet Credits 94 94 95 98 98 98 98 99 100 102 102 102 103
About You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: qt It is an unofficial and free Qt ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official Qt. The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners. Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to info@zzzprojects.com https://riptutorial.com/ 1
Chapter 1: Getting started with Qt Remarks As official documentation stated, Qt is a cross-platform application development framework for desktop, embedded and mobile. Supported Platforms include Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry, Sailfish OS and others. This section provides an overview of what Qt is, and why a developer might want to use it. It should also mention any large subjects within Qt, and link out to the related topics. Since the documentation for qt is new, you may need to create initial versions of those related topics. Versions Version Release date Qt 3.0 2001-10-16 Qt 3.3 2004-02-05 Qt 4.1 2005-12-20 Qt 4.8 2011-12-15 Qt 5.0 2012-12-19 Qt 5.6 2016-03-16 Qt 5.7 2016-06-16 Qt 5.8 2017-01-23 Qt 5.9 2017-05-31 Examples Installation and Setup on Windows and Linux Download Qt for Linux Open Source Version Go to https://www.qt.io/download-open-source/ and click on Download Now, make sure that you are downloading the Qt installer for Linux. https://riptutorial.com/ 2
分享到:
收藏