Detecting Drop Events Outside Application in QT C++
-
Hello everyone,
I'm currently working on a project using QT C++ and facing a unique challenge that I hope to get some insights from you guys.
I've implemented a custom QTabBar and QTabWidget in my application to ensure smooth drag-and-drop functionality for tabs both within and between different tab bars. My current focus is on enhancing this feature by allowing a new window to open with the content of a tab when it's dropped outside of any tab bar (like in every modern browser). However, I'm unsure how to detect drop events that occur outside the application.
In theory, I've considered using a hook to detect such events, but I'm aware that this approach is platform-specific and may lead to complications. Does anyone have experience or suggestions on alternative methods to achieve this functionality?
Any guidance or pointers to relevant resources would be greatly appreciated!
Thanks :)
-
Hello everyone,
I'm currently working on a project using QT C++ and facing a unique challenge that I hope to get some insights from you guys.
I've implemented a custom QTabBar and QTabWidget in my application to ensure smooth drag-and-drop functionality for tabs both within and between different tab bars. My current focus is on enhancing this feature by allowing a new window to open with the content of a tab when it's dropped outside of any tab bar (like in every modern browser). However, I'm unsure how to detect drop events that occur outside the application.
In theory, I've considered using a hook to detect such events, but I'm aware that this approach is platform-specific and may lead to complications. Does anyone have experience or suggestions on alternative methods to achieve this functionality?
Any guidance or pointers to relevant resources would be greatly appreciated!
Thanks :)
@M4cM4rco
You can just override drag events in your custom Widgets like documented here. The drag override makes sure that the user observes the outside of main window as a valid drop area. The drop override has to implement a new window being created. I’d look into dock widget options, because much of the required functionality comes out of the box here. -