Open-source project
feiyangqingyun/QWidgetDemo avatar
feiyangqingyun/QWidgetDemo

QWidgetDemo: Independent Qt C++ Demo Projects for Custom Controls and UI

Qt编写的一些开源的demo,预计会有100多个,一直持续更新完善,代码简洁易懂注释详细,每个都是独立项目,非常适合初学者,代码随意传播使用,拒绝打赏和捐赠,欢迎留言评论!公众号:Qt实战/Qt入门和进阶/Qt教程

6,942 stars1,718 forksC++NOASSERTION

At a glance

What is it?
QWidgetDemo is a collection of over 100 independent Qt C++ demo projects organized across eight categories: custom controls, tools, video playback, window widgets, UI styling, miscellaneous utilities, third-party integrations, and community contributions. Each demo compiles as a standalone project, targets Qt 4 through Qt 6, and is documented in Chinese with the aim of being readable for Qt beginners.
Who is it for?
QWidgetDemo is a practical reference for a Qt developer who needs working examples of specific controls or UI patterns and does not want to start from scratch. The demos are self-contained, so a developer can open any single `.pro` file in Qt Creator and study or adapt that one demo without loading the entire collection.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 137 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What QWidgetDemo Is and Who It Is For

QWidgetDemo is a collection of independent Qt C++ demonstration projects maintained by feiyangqingyun. The README describes the goal as providing simple, well-commented code that is easy to understand, specifically aimed at beginners learning Qt development. Each project in the collection is completely self-contained: it has its own `.pro` file, can be compiled on its own, and does not depend on other demos in the collection.

The collection targets Qt developers working on desktop and embedded applications. Many of the demos address practical UI problems that Qt's built-in widgets do not solve directly: a battery level indicator, an IP address input box, a frameless window widget, a video monitoring layout, and a flat-style UI framework are all represented. A developer looking for a starting point for a specific control type can find a working example here rather than building from first principles.

The README notes that all projects support Qt 4, Qt 5, and Qt 6, tested on Windows, Linux, macOS, and UOS. A small number of projects explicitly skip certain Qt versions (such as Qt 6) and are documented as doing so in their individual `.pro` files. The collection has been tested personally by the author across Qt 4.6 to Qt 6.6.

Repository Structure and the Eight Categories

The repository is organized into eight top-level directories, each corresponding to a category of demos. The README presents this as a table with directory name, category in Chinese, English name, and a description of each demo. Demos marked in bold in the README are identified as higher-quality projects.

The eight categories are: `control` for custom widget controls, `tool` for utility applications, `video` for video playback and monitoring, `widget` for window and dialog widgets, `ui` for interface styling and themes, `other` for miscellaneous examples, `third` for third-party library integrations, and `netfriend` for community-contributed demos.

Selected demos from `control` include a battery level widget, an IP address input field, a navigation button, a log redirect output control, and a CPU memory display widget. The `tool` category includes a serial port debug assistant, a network debug assistant, a network relay server, a base64 converter, and a key generator. The `video` category covers monitoring layouts, panels, and individual player controls using ffmpeg, VLC, and MPV.

The `ui` category provides flat-style themes, three preset style packs, and several interface beautification examples including a flat main window. The `third` category integrates third-party components such as qcustomplot for charts and miniblink as a browser engine.

Opening and Compiling the Demos

The README provides two compilation approaches. The first is to open `QWidgetDemo.pro` in Qt Creator, which loads all demos as a single project and compiles them all at once. The second is to navigate to any individual demo directory and open its `.pro` file to compile just that demo.

The README strongly recommends downloading via Git command line rather than as a compressed archive. The note explains that re-extracting the archive after download may cause an error reporting "Excess closing brace." The Git-based download avoids this issue.

Compiled executables are placed in a `bin` directory at the same level as the source code directories, not inside the individual demo folders. The README specifies this explicitly so developers know where to find the output after compilation.

For demos that do not load when opening the main `.pro` file, the README instructs developers to open the individual `.pro` file and read the comments inside, which explain any version-specific conditions or prerequisites that might cause a sub-project to be excluded.

The `docs/` directory is present in the top-level repository entries, though the README does not describe its contents in detail. Individual demo subdirectories may contain their own documentation or resource files.

Notable Demos and What They Demonstrate

Several demos stand out for the Qt patterns they illustrate. The `framelesswidget` demo in the `widget` category shows how to implement a borderless window, a common requirement in embedded and industrial UI development where the default OS window chrome is unwanted. The `savelog` demo in `control` demonstrates log redirection output, a practical need in any application that requires writing runtime logs to a visible UI component.

The `styledemo` in `ui` provides three complete style presets, and `uidemo10` demonstrates a flat main window layout. For developers building industrial or monitoring interfaces, `videobox` and `videopanel` in `video` show how to lay out and manage multiple video monitoring feeds in a single window.

The `echart` demo in `other` demonstrates JavaScript-to-Qt interaction using the ECharts charting library, and `qcustomplotdemo` in `third` uses the qcustomplot library for more traditional chart rendering. The `iconhelper` demo in `ui` implements icon fonts, a pattern that avoids the need for separate image assets for toolbar and UI icons.

The community-contributed `imagecropper` in `netfriend` provides an avatar cropping widget, and `slidepuzzlewidget` implements a slider image CAPTCHA, both examples of more complex interaction patterns that the main collection does not cover.

Limitations and What the Collection Does Not Cover

The README documentation is entirely in Chinese. The code itself uses English for class names, variable names, and Qt API calls, which is standard for Qt development. But the explanatory text in the README, including the directory table and the project notes, requires reading Chinese to use fully. Developers who do not read Chinese will need to rely on the code itself and the English labels in Qt Creator.

The last push to the repository was on 2026-05-16. The project is not archived. Given that the repository description says updates are continuous and that the author plans to reach over 100 demos, the pace of updates has slowed compared to what the description suggests.

The license field in the repository metadata is NOASSERTION, meaning no standard license is declared. The README does not include a formal license statement in the text available in the prompt material. A developer who wants to use code from these demos in a commercial product should clarify the licensing terms with the author before doing so.

The collection is a reference, not a framework. There is no shared library to import, no package to install via a package manager, and no API contract. Each demo is a finished example application. Adapting a specific control to a new project means reading the demo source and copying the relevant class definitions.

Qt Version Compatibility and Platform Coverage

The README states that all projects have been tested across Qt 4.6 to Qt 6.6, and across Windows, Linux, macOS, and UOS (a Linux distribution common in Chinese enterprise deployments). This breadth of compatibility is a specific design goal, not a side effect: the author tested each platform personally, as the README notes with the phrase "personally tested."

A small number of projects do not support all Qt versions. The README notes these cases exist and says they are handled by automatic exclusion in the build system. The condition is documented in the individual `.pro` file for any affected project. A developer targeting a specific Qt version can check the `.pro` comments to confirm support before investing time in a given demo.

For developers comparing Qt demo collections, the alternative is the official Qt examples included with the Qt installation, which cover the full Qt API surface but are not focused on the specific UI patterns that QWidgetDemo addresses, such as monitoring layouts, flat-style themes, or industrial controls. QWidgetDemo's value is in its focus on common industrial and embedded UI requirements rather than general API coverage.

Editorial conclusion

QWidgetDemo is a practical reference for a Qt developer who needs working examples of specific controls or UI patterns and does not want to start from scratch. The demos are self-contained, so a developer can open any single `.pro` file in Qt Creator and study or adapt that one demo without loading the entire collection. It is not a library to link against: each demo is a finished application or widget, and adapting it to a different project requires reading and extracting the relevant code. The README documentation is in Chinese, which limits accessibility for developers who do not read Chinese.

Frequently asked questions

Does QWidgetDemo work with Qt 6?

The README states that all projects support Qt 4, Qt 5, and Qt 6. A small number of projects do not support certain Qt versions and are excluded automatically during compilation; those cases are documented in the individual .pro file's comments.

Can I use QWidgetDemo code in a commercial product?

The repository license is listed as NOASSERTION in the metadata, and the README does not include a standard license statement in the available material. Verify the license terms with the author before using any demo code in a commercial project.

How do I open just one demo instead of the entire collection?

Navigate to the individual demo's directory and open its .pro file in Qt Creator. Each demo is a fully independent project. The README notes that compiled executables are placed in a bin directory at the same level as the source directories, not inside the individual demo folder.

Official sources

  1. feiyangqingyun/QWidgetDemo on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/feiyangqingyun-qwidgetdemo.svg)](https://hysenlabs.com/projects/feiyangqingyun-qwidgetdemo)