[Qt-interest] Dragging QDockWidget between multiple windows in Qt4
John Cummings
jcummings2 at users.sf.net
Wed Aug 19 20:30:45 CEST 2009
>
> As such, I have attached a short example demonstrating more fully what I
> said in my previous email. I believe it will give us a better starting
> point for discussing solutions. For reference, I am developing with Qt 4.4
> but I did not see anything in Qt 4.5 that addresses this issue.
>
> So, has anyone else actually managed to dock a widget in multiple main
> windows?
>
I have updated the example with the beginning of a clean drag and drop
implementation (since I haven't found any better way to do it). As I
mentioned in my first email, I did start on this before, but this time I'm
doing it in a smaller scale, which should help.
I have currently only captured the mouse events. However, I decided to send
the example at this point to highlight some of the difficulties I am having
with QDockWidget, which I hope someone can help me with:
0. The mouse event methods are not called because QDockWidget overrides the
more general event() method. This issue is minor, but didn't bode well.
1. I cannot determine if a click is within the title area unless I insert a
custom title bar widget. It appears that those details are hidden within
QDockWidget's private data.
2. For testing purposed, I did create a dummy title widget that is a QLabel.
However, it does not have all of the nice buttons the default title bar has.
I would like to subclass it, but it seems that this class is private as well.
I'm forging ahead, but these issues make me think that there must be an easier
way. I'm about to subclass QMimeData, which I think is the route I need to go
in this case.
Thank you
John Cummings
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dock.cpp
Type: text/x-c++src
Size: 3088 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090819/6a81b6a4/attachment.bin
More information about the Qt-interest-old
mailing list