Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Sérgio Martins
24 September 2020
The KDDockWidgets 1.0 release is now available!
KDDockWidgets is an advanced docking system for Qt, with features that are not available in QDockWidget.
See our first blog post, for a quick introduction and the motivation for a new docking framework.
We've come a long way since the initial announcement of KDDockWidgets. The 1.0 release represents the culmination of one year of using the library in production for five different huge projects -- one year of incorporating real feedback in the form of new features, bug fixes, or simply making the framework more customizable.
We could have tagged 1.0 much sooner, but I gain more personal satisfaction in calling the current state 1.0, as it's very stable and almost feature-complete. We're on the verge of stepping on the gas for the Qt Quick port, as there's very little to add to the Qt Widget API.
Read on, for a few of the highlights of the KDDockWidgets 1.0 release.
We now have 200 automated tests, accounting for 30% of the codebase. It took a lot of time to get there but now they actually save us time, catching regressions very soon.
We wrote a fuzzer, to test the example app randomly for hours until it crashes. All this with Address Sanitizer enabled so memory violations and leaks don't escape.
For the KDDockWidgets 1.0 release, the layouting engine was factored out into its own reusable library without QWidget dependencies. This will allow sharing 5000 lines of code for the Qt Quick port right off the bat, but also benefits the QWidget codebase a lot, as the new engine is much more flexible. For instance, it was trivial to add support for max-size constraints and honour a bit of QSizePolicy.
Additionally, KDDW allows users to provide their own docking indicators. This is not just about changing icons or colors, the whole mechanism can be modified.
In the example below, we demonstrate how we created a new docking indicator type called "Segmented Indicators" in just a few hours.
Run kddockwidgets_example -y
to see it in action.
You can now dock a main window into another main window, as if it were a dock widget. On top of that, you can even dock floating windows into the inner dock widget if that pleases you.
Not saying you should, but it's something many people asked. Sometimes, it's simply because they had this in MFC and wouldn't be able to complete a port to Qt without it.
In the example below, I show you the "affinity" concept. The yellow dock widgets can only be docked into the yellow main window, but this is optional. If you want, you can dock anything, anywhere.
Aero-snap is the functionality which maximizes a window when you drag it near the screen's edges. Typically you loose this feature when using Qt::FramelessWindowHint
, but that can be worked around.
For the KDDockWidgets 1.0 release, we even did many improvements for using Aero-snap with Windows with custom title bars. Expect some HDPI fixes for v1.1 too.
Layout restoring is now done in two steps. First, everything is loaded and validated. Only if the validation passes do we change the GUI. Before, it was very hard to recover from an error if we were in the middle of the restore.
Save/restore now works better on different HDPI setups. We've added the RestoreOption_RelativeToMainWindow
, which, when used, will restore the dock widgets in relation to the main window's size, instead of using absolute values which could have been saved in a different screen size.
Config::flags()
has 5 new options for tuning little details. They are:
Consult the documentation for more information, but they are pretty self-explanatory :).
Here is a more comprehensive list of features and improvements in the KDDockWidgets 1.0 release:
Stay tuned, 1.1 should be out soon!
Visit the KDDockWidgets GitHub page to get the update: https://github.com/KDAB/KDDockWidgets/releases/tag/v1.0.0.
The source code for the KDDockWidgets 1.0 release can be found on GitHub at:
https://github.com/KDAB/KDDockWidgets
Tarballs and zipballs for 1.0 are available from:
https://github.com/KDAB/KDDockWidgets/releases
Prebuilt packages for some popular Linux distributions can be found at:
https://build.opensuse.org/project/repositories/isv:KDAB
For commercial licensing regarding inclusion in proprietary software and/or for tailored support options contact us and ask for a 30-day free trial license.
This blog uses KDDockWidgets as an example for creating Python bindings for your Qt Libraries. Give it a read if you're interested in that process.
View our 'Widgets and more' video series
Yes, widgets are still alive and kicking. In the many years we have worked with them, we have gathered quite a number of tips and tricks that we’d love to share with you.
About KDAB
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Upgrade your applications from Qt 5 to Qt 6 with KDAB’s migration services. Get a free migration assessment and join a hands-on workshop to prepare your team for a successful transition!
Learn more