All Qt Examples
Qt Concurrent
Demonstrates how to asynchronously scale images | |
Demonstrates how to scale images synchronously | |
Demonstrates how to monitor the progress of the active processes | |
Demonstrates how to use the map-reduce algorithm | |
Demonstrates how to run standard functions concurrently |
Qt Core
Contiguous Cache example shows how to use QContiguousCache to manage memory usage for very large models. In some environments memory is limited and, even when it isn't, users still dislike an application using excessive memory. Using QContiguousCache to manage a list, rather than loading the entire list into memory, allows the application to limit the amount of memory it uses, regardless of the size of the data set it accesses | |
Custom Type example shows how to integrate a custom type into Qt's meta-object system | |
JSON Save Game example demonstrates how to save and load a small game using QJsonDocument, QJsonObject and QJsonArray | |
Demonstrates using QLocalSocket for a simple local service client | |
Demonstrates using QLocalServer and QLocalSocket for serving a simple local service | |
Shows the hierarchy of MIME types and can be used to determine the MIME type of a file | |
Mandelbrot example demonstrates multi-thread programming using Qt. It shows how to use a worker thread to perform heavy computations without blocking the main thread's event loop | |
Demonstrates multi-thread programming using Qt | |
Demonstrates multi-thread programming using Qt | |
Demonstrates doing inter-process communication using shared memory with the QSharedMemory class | |
Demonstrates multi-thread programming using Qt |
Qt D-Bus
Demonstrates communication among instances of an application | |
Demonstrates usage of the Qt D-Bus typesystem | |
Shows how to access the D-Bus bus daemon service | |
Demonstrates a simple message system using D-Bus | |
Shows how to use Qt D-Bus to control a car from another application |
Qt GUI
Analog Clock Window example shows how to draw the contents of a custom window | |
This example shows how to create a minimal QWindow based application for the purpose of using OpenGL | |
This example shows how to create a minimal QWindow based application using QPainter for rendering |
Qt Network
Demonstrates how to create a client for a network service | |
Demonstrates how to receive information broadcasted over a local network | |
Demonstrates how to broadcast information to multiple clients on a local network | |
Demonstrates how to create a client for a network service | |
Demonstrates how to create a server for a network service | |
Obtains the list of search recommendations by the Google search engine | |
Demonstrates a simple HTTP client | |
Demonstrates the client-server communication on a local host | |
Demonstrates how to receive information sent to a multicast group | |
Demonstrates how to send messages to a multicast group | |
Demonstrates a stateful peer-to-peer Chat client | |
Demonstrates how to use networking APIs for multiple downloads | |
Demonstrates how to use the networking APIs for multiple downloads | |
Demonstrates how to communicate over an encrypted (SSL) connection | |
Threaded Fortune Server example shows how to create a server for a simple network service that uses threads to handle requests from different clients. It is intended to be run alongside the Fortune Client example | |
Demonstrates complex TCP/IP operations |
Qt OpenGL
2D Painting example shows how QPainter and QGLWidget can be used together to display accelerated 2D graphics on supported hardware | |
Cube OpenGL ES 2.0 example shows how to write mouse rotateable textured 3D cube using OpenGL ES 2.0 with Qt. It shows how to handle polygon geometries efficiently and how to write simple vertex and fragment shader for programmable graphics pipeline. In addition it shows how to use quaternions for representing 3D object orientation | |
Hello GL2 example demonstrates the basic use of the OpenGL-related classes provided with Qt | |
Textures example demonstrates the use of Qt's image classes as textures in applications that use both OpenGL and Qt to display graphics |
Qt SQL
Shows how to use Qt SQL classes with a model/view framework | |
Cached Table example shows how a table view can be used to access a database, caching any changes to the data until the user explicitly submits them using a push button | |
Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and QDataWidgetMapper classes | |
Master Detail Example shows how to present data from different data sources in the same application. The album titles, and the corresponding artists and release dates, are kept in a database, while each album's tracks are stored in an XML file | |
Query Model example shows how to make customized versions of data obtained from a SQL query, using a model that encapsulates the query and table views to display the results | |
Relational Table Model example shows how to use table views with a relational model to visualize the relations between items in a database | |
SQL Browser example shows how a data browser can be used to visualize the results of SQL statements on a live database | |
SQL Widget Mapper example shows how to use a map information from a database to widgets on a form | |
Table Model example shows how to use a specialized SQL table model with table views to edit information in a database |
Qt Test
How to write a unit test | |
How to create data driven tests | |
Howe to simulate GUI events | |
How to replay GUI events | |
How to write a benchmark |
Qt Widgets
Visualizes a huge graphic view scene with 40000 chip items | |
Address book example shows how to use proxy models to display different views onto data from a single model | |
Demonstrates how affine transformations in QPainter works | |
Analog Clock example shows how to draw the contents of a custom widget | |
Demonstrates anchor layout in a graphics view scene | |
Animated Tiles example animates items in a graphics scene | |
Application Chooser example shows how to use the Qt state machine and the animation framework to select between applications | |
Application example shows how to implement a standard GUI application with menus, toolbars, and a status bar. The example itself is a simple text editor program built around QPlainTextEdit | |
Basic Drawing example shows how to display basic graphics primitives in a variety of styles using the QPainter class | |
Demonstrates how to create basic graphics layout | |
Shows how to use the standard layout managers | |
Basic Sort/Filter Model example illustrates how to use QSortFilterProxyModel to perform basic sorting and filtering | |
Demonstrates how to apply graphical effects on items in the view | |
Shows how to arrange child widgets along a border | |
Combines advanced OpenGL rendering with the Graphics View framework | |
Example shows how to use signals and slots to implement the functionality of a calculator widget, and how to use QGridLayout to place child widgets in a grid | |
Calendar example shows how to create rich text content and display it using a rich text editor | |
Calendar Widget example shows use of QCalendarWidget | |
Character Map example shows how to create a custom widget that can both display its own content and respond to user input | |
Chart example shows how to create a custom view for the model/view framework | |
License Wizard example shows how to implement linear wizards using QWizard | |
Code Editor example shows how to create a simple editor that has line numbers and that highlights the current line | |
Demonstrates how to animate items on a graphics view | |
This example shows how to create an editor that can be used by a QItemDelegate | |
Combo Widget Mapper example shows how to use a custom delegate to map information from a model to specific widgets on a form | |
Completer example shows how to provide string-completion facilities for an input widget based on data provided by a model | |
Demonstrates how Composition Modes work in QPainter | |
Demonstrates the improved quality that antialiasing and floating point precision gives | |
Config Dialog examples shows how a configuration dialog can be created by using an icon view with a stacked widget | |
Custom Completer example shows how to provide string-completion facilities for an input widget based on data provided by a model. The completer pops up suggestions for possible words based on the first three characters input by the user and the user's choice of word is inserted into the TextEdit using QTextCursor | |
Custom Sort/Filter Model example illustrates how to subclass QSortFilterProxyModel to perform advanced sorting and filtering | |
Demonstrate how to use the Graphics View framework | |
Digital Clock example shows how to use QLCDNumber to display a number with LCD-like digits | |
This example demonstrates the usage of a tree view | |
Dock Widgets example shows how to add dock windows to an application. It also shows how to use Qt's rich text engine | |
Drag and Drop Puzzle example demonstrates a way of using the drag and drop system with item view widgets | |
Demonstrates how to drag and drop items in a graphics view | |
Draggable Icons example shows how to drag and drop image data between widgets in the same application, and between different applications | |
Draggable Text example shows how to drag and drop textual data between widgets in the same application, and between different applications | |
Example shows how to distinguish the various MIME formats available in a drag and drop operation | |
Shows how to re-orient widgets in running applications | |
Easing Curves example shows how to use easing curves to control the speed of an animation | |
This example shows how to create a Qt plugin | |
This example shows how to implement a simple item-based tree model that can be used with other classes the model/view framework | |
Demonstrates how to interact with graphical items in a scene | |
This example creates a widget similar to QLabel, that elides the last visible line, if the text is too long to fit the widget's geometry | |
Demonstrates how to embed dialogs into a graphics view | |
Event Transitions example shows how to use event transitions, a feature of The State Machine Framework | |
Extension example shows how to add an extension to a QDialog using the QAbstractButton::toggled() signal and the QWidget::setVisible() slot | |
Factorial States example shows how to use The State Machine Framework to calculate the factorial of an integer | |
Demonstrates how to apply effects on items in the view | |
Fetch More example shows how two add items to an item view model on demand | |
Find Files example shows how to use QProgressDialog to provide feedback on the progress of a slow operation. The example also shows how to use QFileDialog to facilitate browsing, how to use QTextStream's streaming operators to read a file, and how to use QTableWidget to provide standard table display facilities for applications. In addition, files can be opened using the QDesktopServices class | |
Shows how to arrange widgets for different window sizes | |
Font Sampler example shows how to preview and print multi-page documents | |
Fridge Magnets example illustrates how to move around several types of MIME-encoded data with drag and drop | |
This example demonstrates how to freeze a column within a QTableView | |
Shows how gradients can be used with QPainter | |
Demonstrates flow layout on a graphics view scene | |
Group Box example shows how to use the different kinds of group boxes in Qt | |
Internationalization (I18N) example demonstrates Qt's support for translated text. Developers can write the initial application text in one language, and translations can be provided later without any modifications to the code. It also demonstrates how to detect the system language settings and show the UI in the appropriate language | |
Icons example shows how QIcon can generate pixmaps reflecting an icon's state, mode and size | |
Shows how composition modes work in QPainter | |
Demonstrates the use of simple gestures in a widget | |
Example shows how to combine QLabel and QScrollArea to display an image | |
This example demonstrates the usage of the model/view framework | |
Puzzle example shows how to enable drag and drop with a custom model to allow items to be transferred between a view and another widget | |
License Wizard example shows how to implement complex wizards in Qt | |
Demonstrates how to apply effects on items in the view | |
Line Edits example demonstrates the many ways that QLineEdit can be used, and shows the effects of various properties and validators on the input and output supplied by the user | |
MDI example shows how to implement a Multiple Document Interface using Qt's QMdiArea class | |
Main Window example shows Qt's extensive support for tool bars, dock windows, menus, and other standard application features | |
Menus example demonstrates how menus can be used in a main window application | |
'Mouse Button Tester' example demonstrates how to reimplement mouse events within a custom class. You can also use this program to verify that Qt is actually receiving mouse events from your mouse | |
Move Blocks example shows how to animate items in a QGraphicsScene using a QStateMachine with a custom transition | |
Movie example demonstrates how to use QMovie and QLabel to display animations | |
Order Form example shows how to generate rich text documents by combining a simple template with data input by the user in a dialog | |
Demonstrates how to create animated user interface | |
Painter Paths example shows how painter paths can be used to beuild complex shapes for rendering | |
Path Stroking example shows various types of pens that can be used with QPainter | |
Ping Pong States example shows how to use parallel states together with custom events and transitions in The State Machine Framework | |
Pixelator example shows how delegates can be used to customize the way that items are rendered in standard item views | |
A plugin providing the basic tools for painting functionality | |
Demonstrates how to extend Qt applications using plugins | |
A plugin providing the extra filters | |
QRegularExpression example shows how regular expressions in Qt are applied to text by providing an environment in which new regular expressions can be created and tested on custom text strings | |
Regular Expressions (RegExp) example shows how regular expressions in Qt are applied to text by providing an environment in which new regular expressions can be created and tested on custom text strings | |
Rogue example shows how to use the Qt state machine for event handling | |
SDI example shows how to create a Single Document Interface. It uses a number of top-level windows to display the contents of different text files | |
Screenshot example shows how to take a screenshot of the desktop | |
Scribble example shows how to reimplement some of QWidget's event handlers to receive the events generated for the application's widgets | |
Settings Editor example shows how Qt's standard settings support is used in an application by providing an editor that enables the user to view the settings for installed applications, and modify those that can be edited | |
Shaped Clock example shows how to apply a widget mask to a top-level widget to produce a shaped window | |
Demonstrates anchor layout on a graphics view scene | |
Simple DOM Model example shows how an existing class can be adapted for use with the model/view framework | |
Simple Tree Model example shows how to use a hierarchical model with Qt's standard view classes | |
Simple Widget Mapper example shows how to use a widget mapper to display data from a model in a collection of widgets | |
Sliders example shows how to use the different types of sliders available in Qt: QSlider, QScrollBar and QDial | |
Spin Box Delegate example shows how to create an editor for a custom delegate in the model/view framework by reusing a standard Qt editor widget | |
Spin Boxes example shows how to use the many different types of spin boxes available in Qt, from a simple QSpinBox widget to more complex editors like the QDateTimeEdit widget | |
Spreadsheet example shows how to create a simple spreadsheet application | |
Standard Dialogs example shows the standard dialogs that are provided by Qt | |
Star Delegate example shows how to create a delegate that can paint itself and that supports editing | |
States example shows how to use the Qt state machine to play animations | |
Stickman example shows how to animate transitions in a state machine to implement key frame animations | |
This example shows how to create a plugin that extends Qt with a new GUI look and feel | |
Style Sheet Example shows how to use style sheets | |
Styles example illustrates how to create custom widget drawing styles using Qt, and demonstrates Qt's predefined styles | |
This example shows Qt's ability to combine the animation framework and the state machine framework to create a game | |
Syntax Highlighter example shows how to perform simple syntax highlighting | |
System Tray Icon example shows how to add an icon with a menu and popup messages to a desktop environment's system tray | |
Tab Dialog example shows how to construct a tab dialog using the QTabWidget class | |
This example shows how to use a Wacom tablet in Qt applications | |
Tetrix example is a Qt version of the classic Tetrix game | |
How to import and export text using text codecs | |
Text Edit example shows Qt's rich text editing facilities in action | |
Tool Tips example shows how to provide static and dynamic tool tips for an application's widgets | |
Traffic Light example shows how to use The State Machine Framework to implement the control flow of a traffic light | |
Transformations example shows how transformations influence the way that QPainter renders graphics primitives | |
Tree Model Completer example shows how to provide completion facilities for a hierarchical model, using a period as the separator to access Child, GrandChild and GrandGrandChild level objects | |
Trivial Wizard example illustrates how to create a linear three-page registration wizard using three instances of QWizardPage and one instance of QWizard | |
Two-way button example shows how to use The State Machine Framework to implement a simple state machine that toggles the current state when a button is clicked | |
This example shows Qt's undo framework in action | |
This example shows how to implement undo/redo functionality with the Qt undo framework | |
Validators example shows the signal emission behavior of input validators | |
Demonstrates how to manipulate the elements of a QPainterPath | |
Demonstrates anchor layout on a graphics view scene | |
Wiggly example shows how to animate a widget using QBasicTimer and timerEvent(). In addition, the example demonstrates how to use QFontMetrics to determine the size of text on screen | |
Window Flags example shows how to use the window flags available in Qt |
Qt XML
Provides a reader for XML Bookmark Exchange Language files | |
Demonstrates how to read and write to XBEL files | |
Demonstrates how to read XBEL files | |
A commandline tool reading from an input file and writing to the standard output file |