Cross-platform software libraries and APIs
Qt Creator IDE and productivity tools
UI Design tool for UI composition
for Qt projects
Digital advertising for UI apps
Usage intelligence for embedded devices
GUI test automation
Code coverage analysis
Test results management and analysis
Software static code analysis
Software architecture verification
The latest version of Qt.
Make the most of Qt tools, with options for commercial licensing, subscriptions, or open-source.
Explore Qt features, the Framework essentials, modules, tools & add-ons.
The project offers PySide6 - the official Python bindings that enhance Python applications.
Qt empowers productivity across the entire product development lifecycle, from UI design and software development to quality assurance and deployment. Find the solution that best suits your needs.
Insight into the evolution and importance of user-centric trends and strategies.
Learn how to shorten development times, improve user experience, and deploy anywhere.
Tips on efficient development, software architecture, and boosting team happiness.
Get the latest resources, check out upcoming events, and see who’s innovating with Qt.
A wealth of Qt knowledge at your fingertips—discover your ideal learning resource or engage with the community.
Whether you're a beginner or a seasoned Qt pro, we have all the help and support you need to succeed.
February 13, 2009 by Jens Bache-Wiig | Comments
Qt already provides a set of standard icons. The nice thing about these icons is that they adapt to the current desktop environment. However the current selection of available icons is rather limited, at least compared to what KDE apps have at their disposal through the freedesktop icon specification. Since most of these icons only are available on the X11 platform, we still haven't decided how to make them available to pure Qt applications such as Designer and Creator. While we are thinking about that, I thought I might as well wrap up the essential code and provide it as a simple convenience class, QtIconLoader, that you can use in your own project. You can find the source code here.
The class currently only provides one static function:
QIcon QtIconLoader::icon(const QString &iconName, const QIcon &fallback = QIcon()).
Usage should be fairly obvious:
new QAction(QtIconLoader::icon("document-new"), tr("&New"), this);
The fallback is of course for platform compatibility so you can provide your own masterpiece as a fallback for other platforms, which is probably the icon you are already using.
And since no blog post is complete without some eye candy, I modified our well know textedit example to QtIconLoader:
Here is how it looks running on KDE 4.2:
And since we also pick up GNOME settings, this is how it looks when running GNOME:
I'm sure there are bugs. For some reason freedesktop standardized on everything except a convenient way to detect which theme to use, so we need to do some trickery to get to the KDE and GNOME settings. Feel free to report issues and suggestions here.
Download the latest release here: www.qt.io/download.
Qt 6.7 focuses on the expansion of supported platforms and industry standards. This makes code written with Qt more sustainable and brings more value in Qt as a long-term investment.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Apr 18, 2024
A recently reported potential Use-After-Free issue in Qt’s wasm..
Feb 15, 2024
A recently reported potential buffer overflow issue in Qt’s KTX’s image..
Dec 20, 2023
We have released Qt 6.7 Beta 1 today. As usual, Qt 6.7 Beta 1 is available..
Qt Group includes The Qt Company Oy and its global subsidiaries and affiliates.