kdab / kddockwidgets Goto Github PK
View Code? Open in Web Editor NEWKDAB's Dock Widget Framework for Qt
Home Page: https://www.kdab.com/development-resources/qt-tools/kddockwidgets
License: Other
KDAB's Dock Widget Framework for Qt
Home Page: https://www.kdab.com/development-resources/qt-tools/kddockwidgets
License: Other
Hi,
it would be great, if DockWidgetBase have QProperties. At the moment the class interface is not uniform. Example:
The focus has a Qt signal:
connect(dockWidget, &KDDockWidgets::DockWidget::isFocusedChanged, ui->isFocusCheckBox, &QCheckBox::setChecked);
But for floating I must use the corresponding QAction:
connect(dockWidget->floatAction(), &QAction::toggled, ui->isFloatingCheckBox, &QCheckBox::setChecked);
Here are some suggested QProperties:
Furthermore for using GammaRay all QProperties will be displayed:
Kind Regards,
Thomas
I know it is stupid, but how to run the example? I need to use it both on Windows and Linux, it would be appreciated if you could list steps.
It could be interesting to limit the dock areas for some dock widget: for example, in Visual Studio, the source file dock can only be docked in the central area.
KDDockWidgets commit: 4e88b37
Windows 10
QT 5.14.2
When using 2 identical model side by side displays, each set to same display resolution, sliding a dockwidget panel from one monitor to the other monitor causes the dock widget panel to not repaint properly at right edge of window. Slightly expanding/contracting the widget causes a repaint which will then paint properly.
Reproduce:
Launch example test app.
Slide widget containing DockWidget #6, #7 & #8 to the other display.
Note dock widget on right hand side & bottom of window has a repaint issue.
This issue can also be reproduced by sliding a contained dock widget from one monitor to the 2nd monitor. Letting the widget stay in the 2nd monitor by releasing the drag button on the mouse. Then sliding the widget back to the original monitor and releasing the drag button on the mouse.
Hi,
at this moment, it is not possible to hide the close icon on the tabs if we choose closable tabs.
Will it be possible to provide a feature like in visual studio, where the close icon appears on the tab widget upon mouse hover event
and close icon is also visible on currently active Tab.
In the attached fig we see close buttons of all the tabs, irrespective of the active status of the tab and mouse position.
Kind Regards
Nandish
I'm wondering why some widgets are private.
I'm as a user of the library I see this "interface":
| Config.h
| docks_export.h
| DockWidget.h
| DockWidgetBase.h
| FocusScope.h
| FrameworkWidgetFactory.h
| KDDockWidgets.h
| LayoutSaver.h
| LayoutSaver_p.h
| MainWindow.h
| MainWindowBase.h
| QWidgetAdapter.h
|
+---multisplitter
| Item_p.h
| multisplitter_export.h
| Separator_p.h
| Separator_qwidget.h
| Widget.h
| Widget_qwidget.h
|
---private
| Draggable_p.h
| DropIndicatorOverlayInterface_p.h
| FloatingWindow_p.h
| Frame_p.h
| TitleBar_p.h
|
---widgets
FloatingWindowWidget_p.h
FrameWidget_p.h
QWidgetAdapter_widgets_p.h
TabBarWidget_p.h
TabWidgetWidget_p.h
TabWidget_p.h
TitleBarWidget_p.h
For example I can reimplement/inherit from TitleBarWidget which is located in private/widgets/TitleBarWidget_p.h.
It is strange to use something from a "private" folder. If I use for exmaple QToolBar https://doc.qt.io/qt-5/qtoolbar.html it is not hidden in a private folder.
Furthermore in the documentation the "private" classes/types are not listed (https://docs.kdab.com/kddockwidgets/latest/annotated.html). Of course I can change the doxygen configuration to list the private classes, but for me there aren't private.
For me it is interessting to see the inheritance graph to have a feeling how the classes relate to each other.
Kind Regards,
Thomas
Hello. I cannot build project.
cmake -G Ninja
CMake Error: Could not find cmake module file: CMakeDetermineHOMEPAGE_URLCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_HOMEPAGE_URL_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_HOMEPAGE_URL_COMPILER
CMake Error: Could not find cmake module file: /home/andrei/KDDockWidgets/CMakeFiles/3.10.2/CMakeHOMEPAGE_URLCompiler.cmake
CMake Error: Could not find cmake module file: CMakeDeterminehttps://github.com/KDAB/KDDockWidgetsCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_https://github.com/KDAB/KDDockWidgets_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_https://github.com/KDAB/KDDockWidgets_COMPILER
CMake Error: Could not find cmake module file: /home/andrei/KDDockWidgets/CMakeFiles/3.10.2/CMakehttps://github.com/KDAB/KDDockWidgetsCompiler.cmake
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_HOMEPAGE_URL_COMPILER could be found.
Tell CMake where to find the compiler by setting the CMake cache entry
CMAKE_HOMEPAGE_URL_COMPILER to the full path to the compiler, or to the
compiler name if it is in the PATH.
CMake Error: Could not find cmake module file: CMakeHOMEPAGE_URLInformation.cmake
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_https://github.com/KDAB/KDDockWidgets_COMPILER could be found.
Tell CMake where to find the compiler by setting the CMake cache entry
CMAKE_https://github.com/KDAB/KDDockWidgets_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error: Could not find cmake module file: CMakehttps://github.com/KDAB/KDDockWidgetsInformation.cmake
CMake Error: CMAKE_HOMEPAGE_URL_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_https://github.com/KDAB/KDDockWidgets_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Hi,
With the below code, I could add icons to all the dockwidgets.
By adding the below lines in KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget() Function
QIcon myIcon(":/assets/bakterium.svg");
dock->setIcon(myIcon);
It appears as shown in attachment TabwithIcons.png
However i needed tabwidgets without icon, but the dockwidgets with icons.
I could achieve this by tweaking the function
void TabWidgetWidget::insertDockWidget(int index, DockWidgetBase *dw,
const QIcon &icon, const QString &title)
{
insertTab(index, dw, title);
}
It appears as shown in TabwithoutIcons.
Would it be possible for you to provide an interface where in which we could create dockwidgets with icons and the icons does not appear when the dock widget is tabbed.
This is required in our application and we would highly appriciate the efforts from your side.
Kind Regards
Nandish
Title says all - I can't grab them when opening the example.
This is similar to #46.
But here the dock widget is getting smaller and smaller.
I use Qt 5.15.0 Window 64 and there are two monitors (100% and 150% scaling).
I assume that the solution is ugly, but we have a lot of customers which use our application with two screens (1 desktop and 1 laptop screen is normal).
Hi, I tested the KDDockWidgets with the cube example QOpenGLWidget from Qt 5.12. It initializes the widget ok but as soon as I undock the widget, it doesn't draw my gl widget but instead just shows a floating window with nothing in it. When I stepped through with the debugger, it calls InitializeGL after undocking, but it never calls the resizeGL or paintGL functions within my class.
There is a scaling problem with the kddock widgets example. How to reproduce:
2 screens (100% and 150%)
Build the example with
flags &= ~KDDockWidgets::Config::Flag_AeroSnapWithClientDecos;
The animation explains the rest:
The behaviour is crashing the application (like in this animation) or the dock widget is getting bigger/smaller.
Hello! How can I safely delete previous widget and insert another one into DockWidget?
Do I have to assign another unique name to dock widget in the same MainWindow instance, if I recreate dock widget itself?
When docking widgets, KDDockWidgets resizes the entire container where the widget is going to go, resizing every widget in that container, seen here:
It would be nice to have an option to have dragged widgets split the area of the widget where it is being dragged on, without modifying any other widgets. The AdvancedDockingSystem repo does this:
Hello! The question is about resetting DockWidget. When I simply remove widgetA after calling setWidget(widgetB), then I've got empty area besides widgetB. Do I have to call close()
/forceClose()
?
dock->setWidget(widgetA);
dock->close(); // or forceClose()?
dock->setWidget(widgetB);
delete widgetA;
I really tried but still failed. I installed ninga and configured the required environment. It's almost the latest step. But when I try to run cmake step, I encountered the following problems.
CMake Error at CMakeLists.txt:10 (find_package):
Could not find a configuration file for package "KDDockWidgets" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
C:/library/kddockwidgets/src/KDDockWidgetsConfig.cmake, version: 0.1 (64bit)
ps:
when I use command
cmake -DCMAKE_PREFIX_PATH=C:\library\kddockwidgets,
error occured as follows,
Could not find a package configuration file provided by "KDDockWidgets" with any of the following names:
KDDockWidgetsConfig.cmake
kddockwidgets-config.cmake
so I use this instead
cmake -DKDDockWidgets_DIR=C:\library\kddockwidgets\src
could you please help me,thanks a lot
Environment:
Windows 10;
Qt 5.12.6;
MSVC 2017 community;
Cmake 3.15.2.
here is my code:
@Code1
KDDockWidgets::LayoutSaver saver;
if (true == saver.saveToDisk())
{
auto arr = saver.serializeLayout();
std::string s = saver.serializeLayout().toStdString();
std::ofstream ofile(".\\layout.config", ios::out);
if (ofile.is_open())
{
ofile << s;
ofile.close();
}
saver.restoreLayout(arr);
}
std::ifstream ifile("layout.config", ios::in);
if (ifile.is_open())
{
std::string temp, s;
while (std::getline(ifile, temp))
{
s += temp;
s += "\n";
}
QByteArray arr = QByteArray::fromStdString(s);
KDDockWidgets::LayoutSaver saver;
saver.restoreLayout(arr);
}
// @Code2
I hope to use the last layout, when opening the app again.
but, the following error occurred!
I tried to solve the error, but I failed. Is it possible that the information ‘saver.serializeLayout()’ keeps is not comprehensive?
Download commit 180fb96
cd s:\KDDockWidgets-master
cmake -DCMAKE_INSTALL_PREFIX=S:\KDDockWidgets
ERROR:
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
CMake Error at src/CMakeLists.txt:157 (install):
install TARGETS given target "kddockwidgets_multisplitter" which does not
exist in this directory.
-- Configuring incomplete, errors occurred!
See also "S:/QT/KDDockWidgets-master/CMakeFiles/CMakeOutput.log".
The QT_BEGIN_NAMESPACE and QT_END_NAMESPACE macros are missing. So the code currently will not compile for Qt5 Builds using a different Namespace.
Steps:
Result: This dock widget does not appear at previos place.
Bug only with floating windows.
Window 10, Qt 5.11.0 and Qt 5.14.1
At least with 6a46744
there is an build error reagarding DockWidgetBase and MainWindowBase.
A
friend class KDDockWidgets::MainWindowBase;
in DockWidgetBase fixes the bug.
After installing the KDDockWidget library into my program and building the example project, neither allow docking
Programmatic docking is functional but the interface for docking floating windows nor the functionality itself works
I created a custom (*.pri) file in order to import the library as I have with my other libraries, rather than using the cmake implementation - I am unsure if this is the reason this is happening
https://streamable.com/ybnwt
Hi, is it possible to enable changing the order of the tabs by dragging? You can't do it by default in the example, I was wondering if there are any flags to enable that functionality.
Environment:
Windows 8 and 10;
Qt 5.12.3 and 5.12.4;
mingw (gcc 8.3) and MSVC 19.16;
Cmake 3.12.
Steps to reproduce:
I assume that this crash happens when you have time to click twice or more on the "close" button.
Hi,
we have widgets which will display different gui elements (e.g. toggle visiblity of a toolbar) depending if the dockwidget is docked or is a flaoting window.
It would be great if the underlaying widget will be informed if the dockwidget is docked or floating.
I have prepared two suggestions with connecting signal/slot:
Or do you have already a solution for this?
Greetings,
Thomas
My project (x64dbg) is using Qt 5.6 and I managed to get it to compile on Qt 5.6 with minimal configuration changes. However I'd like to know what Qt version is officially required as a minimum version, because things do not seem to work very well on this version.
We need a notify mechanism (Qt signal), that the active/focus state has changed. Is there still something available?
This regards issue #56
Traceback (most recent call last):
File "C:\Server\sborka\dcbot.py", line 1, in
from disco.cli import disco_main
ImportError: No module named disco.cli
[ERROR] Erro nas Portas server. Reiniciar servidor 3 seconds
Help, i try to install this module, but it gives an error.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement disco.cli (from versions: none)
ERROR: No matching distribution found for disco.cli
Hi,
there is a wrong include path in QWidgetAdapter.h:
#include "../multisplitter/Widget_qwidget.h"
It should be
#include "multisplitter/Widget_qwidget.h"
Background: In our project we didn't added the include dir "multisplitter". Therefore Widget_qwidget.h couldn't be found.
If the multisplitter dir is important then please add it to the cmake file:
Greetings,
Thomas
As a user, I don't want to install anything to see a demo. What I want is to build a library, build examples, and check them out. Why should I care about how to make examples work?
Also as a developer, I don't want to reinstall the library after each library change. What I want is to rebuild the library and see my changes quickly.
I suggest getting rid of installation dependency for library examples.
Apologies if this is the wrong place, but just generally curious about the status of using this in a QtQuick-based project? I see many references to it across the source files, but note that it is still part of the 'Roadmap' at the same time. It seems like it is not quite functional yet, but please correct me if I'm wrong.
Assuming there is still work to be done, is there any particular way to be helpful in terms of contributions?
With the flag KDDockWidgets::Config::Flag_TitleBarIsFocusable the title bar is able to get the focus changed.
But the tabs we need the same functionality. A click on a tab the focus changed signal should be emitted.
In the following animation I started the example with "-p". So the content and the title bar react on the click event, but not the tabs:
This even more important, if the titlebar is hidden.
Kind Regards,
Thomas
To reduce screen flickering I need to be able to set the position of a newly created floating dock widget before calling show / raise.
Currently this does not seem possible because the framework centers newly created floating widgets automatically.
Hi Sergio,
could you please provide an interface like IsDockedToMainWindow() which informs if the dock widget is docked to mainWindow or if its docked to some other dock widget.
For example in the attach,
Dockwidget 1, 3,4,5,8 are docked to Mainwindow and should return true.
Dockwidget 0,3,4 are not docked to mainwindow and should return false.
Dockwidget->IsDockedToMainWindow().
I have a requirement to dock the widget or float depending on if the widget is docked to main window or not.
Kind Regards
Nandish
Hi,
I would like to extend the kddockwidgets_example with the KDDockWidgets::TabBar and KDDockWidgets::TabWidget. But the forward headers of TabBar and TabWidget are missing. A look into the fwd_headers folder there is only TitleBar:
And the FrameworkWidgetFactory have a lot of futher Widgets which can be reimplemented:
Please add the missing forward headers.
Furthermore the includes in MyFrameworkWidgetFactory are not needed, because of the forward decarations in kddockwidgets/FrameworkWidgetFactory.h.
Here is the example of the missing TabWidget header:
Do you need further information?
Kind Regards,
Thomas Lämmlein
Hello Sergio,
in the Dock Widget example program, once we drag out the docked widgets from the Floating window (technically not floating because it has multiple dock widgets with in), the window title is wrongly updated.
Attached gif is self explanatory.
However this happens only for the first time, then on we get the correct name on the title bar.
Could you please fix this.
Kind Regards
Nandish
Hello Sergio,
I added the below code
----------------------------MyWidget.cpp----------------------------
MyWidget::MyWidget(const QString &backgroundFile, const QString &logoFile, QWidget parent)
: QWidget(parent)
{
m_is_floating_checkbox = new QCheckBox(this);
m_label = new QLabel(this);
m_label->setStyleSheet("QLabel { background-color : orange; color : black; }");
m_label->setText("Floating");
QFont f( "Arial", 12, QFont::Bold);
m_label->setFont( f);
m_label->move(20,0);
....
....
....
}
void MyWidget::connectTo(KDDockWidgets::DockWidget dock) {
connect(dock->floatAction(), &QAction::toggled, m_is_floating_checkbox, &QCheckBox::setChecked);
bool val = dock->floatAction()->isChecked();
m_is_floating_checkbox->setChecked(val);
}
----------------------------MyWidget.h----------------------------
class MyWidget : public QWidget
{
...
...
public:
void connectTo(KDDockWidgets::DockWidget* parent);
protected:
QCheckBox* m_is_floating_checkbox = nullptr;
QLabel* m_label = nullptr;
};
---------------------------MyMainWindow.cpp------------------------
MyMainWindow::MyMainWindow(.. ) {
...
...
connect(newAction, &QAction::triggered, this, [] {
static int count = 0;
count++;
auto w = newMyWidget();
w->setGeometry(100, 100, 400, 400);
auto dock = new KDDockWidgets::DockWidget(QStringLiteral("new dock %1").arg(count));
dock->setWidget(w);
w->connectTo(dock);
dock->resize(600, 600);
dock->show();
});
}
KDDockWidgets::DockWidgetBase *MyMainWindow::newDockWidget()
{
....
....
myWidget->connectTo(dock);
count++;
return dock;
}
To simplify, i have added a checkbox which will be checked if the window is floating. But in the below gif, you can see that checkbox remains checked when dock widget is docked to another floating widget.
We do not see this issue when widgets are tabbed.
If you need more information, please feel free to write back.
Kind Regards
Nandish
Following errors occurs while running cmake on Windows with -DOPTION_BUILD_PYTHON_BINDINGS=ON
The error is due to missing pkg_config
CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.17/Modules/FindPkgConfig.cmake:45 (find_package_handle_standard_args)
cmake/Python/FindShiboken2.cmake:20 (find_package)
python/CMakeLists.txt:14 (find_package)
The error is due to find_package(PkgConfig REQUIRED)
line in the following cmake files:
Both cmake files run happily when
find_package(PkgConfig REQUIRED)
pkg_check_modules(SHIBOKEN2_PRIV shiboken2 QUIET)
is replaced with:
if(NOT WIN32)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SHIBOKEN2_PRIV shiboken2 QUIET)
endif()
So WIN32 specific logic is implemented in these files, but crash occurs due to pkg_config not found.
Suggested patch attached. Happy to submit a PR, if you think that's valid.
win32_cmake_files.patch.txt
Tested on:
Windows 10 version 1909 / CMake 3.17.0 / cl.exe 19.25.28611 (x64) / Qt 5.15.0
Thanks for creating Python bindings for KDDockWidgets!
Hi,
my goal is to have a different title bar color if the dock widget is "active".
I (re)implemented the "MyTitleBar" in the kddockwidgets example:
void paintEvent(QPaintEvent*) override
{
QPainter p(this);
QColor c = isActiveWindow() ? QColor("#F28D26") : Qt::gray;
p.fillRect(rect(), c);
p.drawText(rect().adjusted(5, 0, 0, 0), Qt::AlignLeading | Qt::AlignVCenter, title());
}
But this is not right. It changes the title bar color if the whole window is active. I would like to change the color for dock widget.
The following animation shows that only the whole window is changing the color and not the dock widget.
In Visual Studio it is possible to change the "active" color of each docking window.
Greetings,
Thomas
Hi,
we find that the title bar occupies so much space, specially when Docked and has more Tabs with in the dock widget. In our product we are trying to eliminate the title bar if the widget has more than one tab and is docked to another widget.
In the attach you shall find 3 different screen shots.
In MainWindow pic,
we would want to remove titlebar dockwidget#4.
However we would like to keep the title bar if the widget is floating, as seen in FloatingWindow pic.
Would it be possible for you to provide such an option or interface.
Kind Regards
Nandish
Thank you for #70.
Unfortunately, the focus is not set when you click on a current tab.
Greetings,
Thomas
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.