A Visual Studio style docking windows library for Qt Widgets based applications
DockingPanes is a library for Qt Widgets that implements docking windows that have the look and feel of Visual Studio. It provides a simple API which allows an application to make use of docking windows with a few calls.
The library has only been tested under windows and may require tweaking of drawing for other platforms, however, there is no platform specific code.
A qmake project file is provided to build the library, this allows the library to be build either inside QtCreator by opening the project or by using qmake from the command line and building native files for your build system.
Debug builds of the library are suffixed with a per platform string to allow debug and release builds to exist side by side.
A CMakeLists.txt
file is provided on the root folder. The current options supported are:
-DBUILD_SHARED_LIBS
: If ON
, then the result will be a shared lib (*.so
/*.dll
file). If OFF
, the result will be a static lib (*.a
/*.lib
file). By default is ON
.-DBUILD_EXAMPLES
: If ON
, It will build the applications inside examples
folder. By default is ON
.cd _build/
cmake -DCMAKE_INSTALL_PREFIX=/your/desired/location -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -j<number_of_cores>
cmake --install .
Then, the directory /your/desired/location
will be (on linux):
.
├── bin
│ └── simple
├── include
│ └── dockingpanes
│ └── DockingPaneManager.h
└── lib
├── libdockingpanes.so -> libdockingpanes.so.1
├── libdockingpanes.so.1 -> libdockingpanes.so.1.0.0
└── libdockingpanes.so.1.0.0
The API is designed to be simple to use and as such there is currently no documentation available. The DockingManager class contains the most useful calls.
We will add doxygen documentation as and when we are able to, however this is not a high priority.
The following is a short basic example of initialising the docking manager, creating a tool window and setting the central widget of the MainWindow to the docking manager widget.
auto centralWidget = new QLabel("Hello World");
auto dockingManager = new DockingPaneManager;
dockingManager->setClientWidget(centralWidget);
auto toolWindowWidget = new QLabel("Hola World");
auto initialSize = QSize(200,100);
auto dockingWindow = dockingManager->createPane("myPaneId", "Window Title", toolWindowWidget, initialSize, DockingManager::dockFloat, nullptr);
// the window is now created and managed by the docking manager. The ToolWindow returned can be used with other API calls to open or close the window and other functions.
setCentralWidget(dockingManager->widget());
DockingPanes is licensed under the GPLv3 License, if you would like to use the library and this is not compatible then you should contact us to discuss options.