IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt Examples And Tutorials

A list of Qt examples and tutorials.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt Examples And Tutorials

A collection of code samples and tutorials are provided with Qt to help new users get started with Qt development. These documents cover a range of topics, from basic use of widgets to step-by-step tutorials that show how an application is put together.

The examples are part of the Qt packages. Visit the Downloads page for more information.

Running the Examples

Open and run examples within Qt Creator's Welcome mode. Most of the examples run on various platforms and to search for platform-specific examples, type the platform name (or any keywords) in the search field. For example, typing Android in the search field lists the examples that are fully compatible with Android.

For more information about running examples in Qt Creator, visit the Building and Running an Example page.

Application Examples

  • Calqlatr: A Qt Quick app designed for portrait devices that uses custom components, animated with AnimationController, and JavaScript for the application logic.

  • Coffee Machine: A Qt Quick application with a state-based custom user interface.

  • Dice: A dice throwing application that demonstrates using Qt Quick 3D Physics and Qt Quick 3D.

  • Document Viewer: A Widgets application to display and print JSON, text, and PDF files.

  • FX & Material Showroom: Demonstrates material and effects capabilities of Qt Quick 3D. This example demonstrates how you can use particle effects and materials in Qt Quick 3D.

  • File System Explorer: A desktop QML app utilizing customized Qt Quick Controls to display text files from a filesystem.

  • Getting Started Programming with Qt Quick: A tutorial for Qt Quick based on an alarms application.

  • Media Player Example: Playing audio and video using Qt Quick.

  • Photo Surface: A QML app for touch devices that uses a Repeater with a FolderListModel to access content in a folder, and a PinchHandler to handle pinch gestures on the fetched content.

  • Qt Quick Demo - RESTful API client: Example of how to create a RESTful API QML client.

  • Robot Arm Example: Demonstrates how to add a C++ backend to a 3D project from Qt Design Studio. This example demonstrates adding a C++ backend to a 3D project created in Qt Design Studio. The example itself consists of an interactive industrial robot arm in a Qt Quick 3D scene. The 2D UI to control the robot arm is implement using Qt Quick Controls.

  • Same Game: A QML implementation of the popular puzzle game by Kuniaki Moribe.

  • Thermostat: A user interface for a home thermostat, implemented in Qt Quick. It demonstrates how to create responsive applications that scale from large desktop displays to mobile and small embedded displays.

  • To Do List Example: A QML implementation of to do list application that demonstrates how to create application thats looks native on any platform.

Desktop

  • COM App Example (ActiveQt): The COM App example shows how to use ActiveQt to develop a Qt application that can be automated via COM. Different QObject based classes are exposed as COM objects that communicate with the GUI of the running Qt application. The APIs of those COM objects has been designed to resemble the APIs of standard COM applications; i.e. those from Microsoft Office.

  • Media Player Example: Playing audio and video using Qt Quick.

  • Qutlook Example (ActiveQt): The Qutlook example demonstrates the use of ActiveQt to automate Outlook. The example makes use of the dumpcpp tool to generate a C++ namespace for the type library describing the Outlook Object Model.

  • Simple Example (ActiveQt): The Simple example demonstrates the use of QAxBindable and QAxFactory.

  • System Tray Icon Example: The System Tray Icon example shows how to add an icon with a menu and popup messages to a desktop environment's system tray.

  • Taking a Screenshot: The Screenshot example shows how to take a screenshot of the desktop.

  • Wrapper Example (ActiveQt): The Wrapper example demonstrates how to export existing QWidget classes as ActiveX controls, and the use of QAxFactory together with the QAXFACTORY_EXPORT() macro. ActiveX controls in this example are the standard button classes QPushButton, QCheckBox and QRadioButton as provided by Qt.

Mobile

Embedded

  • Coffee Machine: A Qt Quick application with a state-based custom user interface.

  • Qt Quick Controls - Wearable Demo: Demonstrates an application launcher designed for wearable devices.

  • Thermostat: A user interface for a home thermostat, implemented in Qt Quick. It demonstrates how to create responsive applications that scale from large desktop displays to mobile and small embedded displays.

Graphics

Multimedia

Data Visualization & 3D

Data Processing & I/O

  • Bindable Properties: Demonstrates how the usage of bindable properties can simplify your C++ code.

  • Books: Shows how to use Qt SQL classes with a model/view framework.

  • Cached SQL Table: The 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.

  • Contiguous Cache Example: The 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.

  • DOM Bookmarks Application: Provides a reader for XML Bookmark Exchange Language files.

  • Drill Down Example: The Drill Down example shows how to read data from a database as well as submit changes, using the QSqlRelationalTableModel and QDataWidgetMapper classes.

  • Echo Plugin Example: This example shows how to create a Qt plugin.

  • IPC: Shared Memory: Demonstrates how to share image data between different processes using the Shared Memory IPC mechanism.

  • MIME Type Browser: Shows the hierarchy of MIME types and can be used to determine the MIME type of a file.

  • Mandelbrot: The 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.

  • Master Detail Example: The 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.

  • Parsing and displaying CBOR data: A demonstration of how to parse files in CBOR format.

  • Prime Counter: Demonstrates how to monitor the progress of concurrent operations.

  • Producer and Consumer using Semaphores: The Producer and Consumer using Semaphores example shows how to use QSemaphore to control access to a circular buffer shared by a producer thread and a consumer thread.

  • Producer and Consumer using Wait Conditions: The Producer and Consumer using Wait Conditions example shows how to use QWaitCondition and QMutex to control access to a circular buffer shared by a producer thread and a consumer thread.

  • QXmlStream Bookmarks Example: Demonstrates how to read and write XBEL files.

  • Qt Quick Examples - Local Storage: A collection of QML local storage examples.

  • Query Model Example: The 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.

  • Queued Custom Type: The Queued Custom Type example shows how to send custom types between threads with queued signals and slots.

  • Relational Table Model Example: The 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: The 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: The SQL Widget Mapper example shows how to use a map information from a database to widgets on a form.

  • Saving and Loading a Game: How to save and load a game using Qt's JSON or CBOR classes.

  • Serialization Converter: How to convert between different serialization formats.

  • Table Model Example: The Table Model example shows how to use a specialized SQL table model with table views to edit information in a database.

  • Undo Framework Example: This example shows how to implement undo/redo functionality with the Qt undo framework.

  • Word Count: Demonstrates how to use the map-reduce algorithm.

Connectivity

Networking

Positioning & Location

  • GeoJson Viewer (C++/QML): The GeoJson viewer example demonstrates how to manipulate MapItems, handle user input and I/O to and from a GeoJson file.

  • Log File Position Source (C++): Logfile Position Source shows how to create and work with a custom position source. It can be useful for simulating GPS data, or when the data is received in some custom format.

  • Map Viewer (QML): The Map Viewer example shows how to display and interact with a map, search for an address, and find driving directions.

  • MapItemView Transitions (QML): How to use transitions together with MapItemView.

  • Minimal Map (QML): The minimum code to display a map using Qt Quick.

  • Places (QML): The Places example demonstrates how to search for Places and access related content.

  • Places List (QML): The Places List example demonstrates how to search for and display a list of places using a ListView.

  • Places Map (QML): The Places Map example demonstrates how to search for and display a list of places on a map using a MapItemView.

  • Plane Spotter (QML): The Plane Spotter example demonstrates the tight integration of location and positioning data types into QML.

  • SatelliteInfo (C++/QML): The SatelliteInfo example shows the available satellites using Sky View, Table View, or RSSI View and the user's current position.

  • Weather Info (C++/QML): The Weather Info example shows how to use the user's current position to retrieve local content from a web service in a C++ plugin for QML.

User Interface Components

Web Technologies

  • HTTP Client: Demonstrates a simple HTTP client.

  • Qt Quick Demo - RSS News: A QML RSS news reader that uses XmlListModel and XmlListModelRole custom QML types to download XML data, ListModel and ListElement to create a category list, and ListView to display the data.

Community Examples

To view and run examples provided through the Qt Project, visit the Community Examples page.

All Examples

All Qt Examples lists all examples categorized by the Qt module they belong to.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+