Hi,
Is there any way in MainWindow to receive events of a floating QDockWidget?
Thank you in advance.
Hi,
Is there any way in MainWindow to receive events of a floating QDockWidget?
Thank you in advance.
QDockWidget already emits a few useful signals, is that what you are looking for?
http://doc.qt.nokia.com/4.7/qdockwidget.html#signals
Thanks mattc, but, none gives me information about intermediate events happening.
For example
is emitted once the drag/drop of the dockwidget has finished. I need to follow the movement itself.Qt Code:
void dockLocationChanged ( Qt::DockWidgetArea area )To copy to clipboard, switch view to plain text mode
I think you will have to subclass and override the mouseMoveEvent().
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
And how could MainWindow have information about that, high_flyer?
Should I create signals in my subclassed dockWidget and connect to MainWindow's slots?
Wouldn't that be quite inefficient?
Lets take a step back.
What is it that you are trying to achieve?
Not in terms of implementation, but functionality - what should happen from a user point of view?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
My aim is to control the QDockWidget drag/drop.
When a user starts to drag a dockWidget, the MainWindow shows several arrows (four general arrows and four arrows + tab relative to other dockwidgets).
When the mouse is released over one of these arrows, the dockwidget is docked in that position.
By now, my solution works while the dockWidgets remain docked. If a dockWidget is not released over an arrow, it becomes floating. But then, if I want to start drag/dropping it again, the MainWindow has lost the control.
Use QEvent::move for this!
Bookmarks