deepin DTK (Development ToolKit) has been officially adapted to Qt6!

Introduction Recently, deepin announced that deepin DTK (Development ToolKit) has been officially adapted to Qt6 (6.4.2) to achieve a comprehensive upgrade.

deepin DTK (Development ToolKit) has officially adapted to Qt6! deepin DTK (Development ToolKit) has officially adapted to Qt6!

As a simple and practical universal development framework developed by deepin based on Qt, DTK is at the core of the deepin operating system. This successful adaptation means that the deepin operating system will make full use of the new features and functions of the Qt6 version in the future. Provide users with a more advanced and efficient experience to the greatest extent possible.

Why should we adapt to Qt6?

Since the birth of deepin, the deepin desktop operating system has attracted widespread attention for its simple, intuitive and beautiful appearance, as well as its unique operation method. As the core tool development component of the deepin operating system, DTK not only provides users with rich controls, but also has strong customization capabilities and high scalability, injecting unique personality and charm into the deepin desktop operating system. Therefore, the deepin team has been paying attention to changes in Qt.

Qt6, as the latest version of the development tool kit (SDK) we are using, is not only an upgrade to the Qt5 version, but also a comprehensive innovation from scratch. It not only strengthens cross-platform compatibility, improves performance, but also introduces many new features. Features and tools, such as more powerful graphics rendering, multi-threading support, etc.

Considering that Qt6 will become the main version in the next few years, in order to ensure that the application keeps pace with the latest technology in future development, we have completed the adaptation of DTK to Qt6 (6.4.2) in the deepin V23 Beta version.

After this adaptation to Qt6, developers can directly access DTK on projects developed based on Qt6, without the need to separately adapt Qt5 & DTK twice, which greatly reduces the duplication and waste of development resources. Applications that are already developed using Qt6 can also access the DTK framework for in-depth development of programs that are more in line with DDE style. While taking into account performance, the beauty is still online.

Adaptation issues and solutions

  • API changes

Qt6 has made major changes and adjustments to some APIs, resulting in some original code needing to be modified and adapted. So we conducted a comprehensive analysis and reconstruction of the code to ensure its compatibility in Qt6 and Qt5.

  • missing functionality

In Qt6, due to technical and architectural changes, some features present in Qt5 may be removed, replaced, or (temporarily) disabled. This means we need to find alternative ways to achieve the same functionality, or redesign and develop related functionality.

  • Third-party library and plug-in compatibility

Qt5 is often integrated with other third-party libraries and plug-ins, but these libraries and plug-ins may not be fully compatible with Qt6. Therefore, when adapting to Qt6, we evaluated and tested these integrations and made necessary modifications and adjustments. For example, qtxdg/QGSettings has not fully adapted to Qt6, so the libqtxdg/QGSettings related code is temporarily disabled when compiling Qt6.

  • Dependency updates

Qt6 usually upgrades some external libraries and tool chains it depends on to meet the requirements of Qt6. So we decided to upgrade and adapt these dependencies.

  • Implementation of packaging and version management of DTK6

After DTK was adapted to Qt6, considering maintainability, we did not create new branches to manage DTK5 and DTK6. They use the same set of code, and DTK5 and DTK6 will coexist in the system.

  • Interface adaptation

For interfaces in Qt5 that have been marked as obsolete but are still in use, when adapting to Qt6, we will directly delete them and replace them with available interfaces. For some unstable interfaces, such as some Qt private interfaces and even private variables obtained through certain technologies, we compare the source codes of Qt5 and Qt6 versions, find the changed interfaces based on the functional logic, and try to use Qt6 public interfaces. its replacement.

Results and future plans

During the entire Qt6 adaptation process, a total of 1000+ (1609) files were changed, 20000+ lines of code were added, and 10000+ lines of code were removed.

Up to now, deepin DTK has completed 5 version iterations, 100+ updates, a total of nearly 200,000 lines of code submitted, and has been migrated to more than 10  Linux  distributions.

In the future, we will also keep pace with the latest technology to further improve the stability of the application. We sincerely hope that this adaptation can bring a more advanced and efficient experience to developers and users, and we also look forward to more interested friends joining us to discuss more content and contribute to promoting ecological development.

Guess you like

Origin blog.csdn.net/weixin_56035688/article/details/133302982