Skip to content

KDDockWidgets An advanced docking framework for Qt

KDDockWidgets is an effort by KDAB to provide an advanced docking system for Qt.

Throughout the years KDAB has contributed and funded QDockWidget development. Sadly, this wasn’t without pain: each change took many days to implement and an equal amount of time to fix regressions.

QDockWidget mixes GUI code with logic/state in a spaghetti manner, making it very hard to move forward. In hindsight, what caused this complexity was the combinatorial explosion of options it supports (which seem unneeded to me, as most people just want to use all the features). That, times 3 platforms, which have different nuances, times 2, since code behaves drastically different if you have animations enabled or not.

KDDockWidgets was born from my need to preserve sanity after having worked in two projects that needed extensive customization. One where we tried to work directly upstream but the regression rate ended up being too much. And another one where I took the route of using private API, fake mouse events and event filters, which seemed like a good idea at first, but ended up being a world of pain. Furthermore, our customers were getting more creative with their requests, so it was clear we needed a better docking framework.

Say hello to KDDockWidgets

KDDockWidgets in action

The immediate differences you can spot are the very precise docking indicators and the total freedom in terms of docking areas.

Here’s a comprehensive list:

  • You can now dock into the center or simply remove the concept of “central widget”
  • You can have tabs in the center
  • Nesting dock widgets in a floating window and docking that group back to main window works (Olivier Goffart from Woboq in collaboration with KDAB implemented the nesting part in QDockWidget for Qt 5.10, but dropping the floating window back to main window was too difficult to finish.)
  • Docking to any main window. The main window is no longer the “owner” of a dock widget
  • Separated GUI code from logic, so we can easily provide a QtQuick backend
  • Exposes inner helper widgets so the user can customize them or provide his own
  • 140+ tests, including some which send fake mouse events to test GUI DnD operations
  • A fuzzer to help find bugs
  • Allows the user to implement different types of docking indicators
  • Eventually: QtQuick support

Moreover, it intends to be a framework, so you can easily override interfaces to provide custom behaviour and appearance.

KDDockWidgets is Open Source (GPLv2 & GPLv3). Alternatively contact KDAB for other licensing options if you need it in proprietary software.

What’s next ?

In the last months we’ve been having fun using KDDockWidgets in a couple of customer projects already, incorporating valuable feedback into the API. The next step is getting official documentation and source/binary-compat guarantees, in preparation for the 1.0 release. I also hope to gather feature requests from the community, so feel free to comment here or drop me an e-mail.

FacebookTwitterLinkedInEmail

Categories: KDAB Blogs / KDAB Labs / KDAB on Qt / Qt

6 thoughts on “KDDockWidgets”

  1. Great start! It would be nice to have such framework as part of Qt in the future. Do you have the plans?

    1. Hi Dzmitry,

      As Sergio explained in the blog, we actually tried to improve QDockWidget, but reached a dead-end at some point, that’s the whole reason for this external library.
      We don’t plan on pushing this library upstream in Qt.

    1. Hi Alex,

      It is possible to use it in a close-source software, the library is dual license GPL/Commercial.
      If you are interested, please contact us at info@kdab.com

      Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close