PDA

View Full Version : Highlight DockArea



thibs
23rd January 2017, 13:33
Hey guys,

I'm trying to display the dockAreas without having a dockWidget over it. In other words, when you drag a dockWidget over the MainWindow, this shows a blue transparent rectangle which indicates where and how the dock will be docked. I would like to know how to show this blue transparent rectangle without have a dock over MainWindow, like using a pushbutton or anything like these.

ChrisW67
23rd January 2017, 20:19
Take a look at QRubberBand to see if that scratches your itch.

The Qt source code for QDockWidget and QMainWindow will (obviously) show you exactly how how this is achieved for dock drag and drop.

anda_skoa
24th January 2017, 09:12
You'll need to look into QMainWindow, it might have container widgets for each of its dock areas.

Cheers,
_

thibs
24th January 2017, 12:36
Take a look at QRubberBand to see if that scratches your itch.

The Qt source code for QDockWidget and QMainWindow will (obviously) show you exactly how how this is achieved for dock drag and drop.

I did, but I need the exactly location of dock to be able to create QRubberBand. I also tried to find in qt source code, but I couldn`t find anything. Any help would be very helpful


You'll need to look into QMainWindow, it might have container widgets for each of its dock areas.

Cheers,
_


I couldn`t find anything in QMainWindow neither QDockWidget

anda_skoa
24th January 2017, 13:50
I couldn`t find anything in QMainWindow neither QDockWidget

What about this? https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qmainwindowlayout.cpp.html#_ZN17QMainWindowLayout1 8updateGapIndicatorEv

Cheers,
_

thibs
30th January 2017, 13:12
This code is not in qmainwindow. There is no qmainwindowlayout in msvc2013_64_opengl and I don't know how to implement this function in my code. Could you help me?

ChrisW67
31st January 2017, 08:29
This code is not in qmainwindow.
No, but it used by QMainWindow to layout the content area of the widget. This is the layout manager that stacks tool bars and dock widgets around the perimeter of the main content widget.

There is no qmainwindowlayout in ...
Sure it is: just not publicly exposed. There is only one set of source code for all platforms.

You do not have access directly to the layout and the dock areas do not have a size until you actually dock something or hover. I cannot see how to achieve what you ask without actually putting a dock widget in the area and then rubber-banding the QDockWidget.

thibs
1st February 2017, 12:21
What I'm trying to achieve is to have the same dockArrows that visual studio has. I have done everything, and I "hacked" this problem creating a QRubberBash, but i don't know the actual size of the dock area, so to the QRubberBash have the same size of the dockArea.12319