Catalog / Qt Framework Cheatsheet
Qt Framework Cheatsheet
A quick reference guide to the Qt framework, covering essential classes, functions, and concepts for developing cross-platform applications.
Core Concepts
Signals and Slots
Qt’s signal and slot mechanism facilitates communication between objects. A signal is emitted when a particular event occurs, and a slot is a function that is called in response to a signal.
|
Example:
|
Qt’s signals and slots provide a type-safe way to implement callbacks, reducing the risk of runtime errors. |
Meta-Object System
The Meta-Object System (MetaObject) provides information about the objects at runtime.
|
Example:
|
Object Model
Qt’s object model is based on a hierarchical object tree.
|
Example:
|
Common Classes
QWidgets
|
A button that the user can click. |
|
Displays text or an image. |
|
A single-line text editor. |
|
A multi-line text editor with rich text support. |
|
A combo box widget (drop-down list). |
|
A checkbox widget. |
|
A horizontal or vertical slider. |
|
Displays the progress of a task. |
Layout Managers
|
Arranges widgets vertically. |
|
Arranges widgets horizontally. |
|
Arranges widgets in a grid. |
|
Arranges widgets in a two-column form. |
Data Handling
Containers
|
A dynamically-sized array. |
|
Provides contiguous storage. |
|
A key-value storage. |
|
Stores unique values. |
|
A list of strings. |
String Handling
|
Common QString Methods:
|
Networking
Network Classes
|
Provides a TCP socket. |
|
Listens for incoming TCP connections. |
|
Provides a UDP socket. |
|
Represents a network request. |
|
Manages network requests. |
HTTP Operations
Qt simplifies HTTP operations using
|
Example:
|