Skip to content

Commit 5af6b4e

Browse files
Improved source documentation and images
1 parent b47a777 commit 5af6b4e

8 files changed

+40
-7
lines changed

demo/MainWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ CMainWindow::CMainWindow(QWidget *parent) :
384384

385385
// uncomment the follwing line if you want to use non opaque undocking and splitter
386386
// moevements
387-
// CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
387+
CDockManager::setConfigFlags(CDockManager::DefaultNonOpaqueConfig);
388388

389389
// Now create the dock manager and its content
390390
d->DockManager = new CDockManager(this);

doc/floating-widget-dragndrop.png

-12 KB
Loading

doc/grouped-dragging.png

-611 Bytes
Loading

doc/linux_kubuntu_1804.png

-90.1 KB
Loading

doc/preview-dragndrop.png

-3.88 KB
Loading

src/FloatingDockContainer.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,33 @@ class CFloatingWidgetTitleBar;
6161
class CDockingStateReader;
6262

6363
/**
64-
* Pure virtual interface for floating widgets
64+
* Pure virtual interface for floating widgets.
65+
* This interface is used for opaque and non-opaque undocking. If opaque
66+
* undocking is used, the a real CFloatingDockContainer widget will be created
6567
*/
6668
class IFloatingWidget
6769
{
6870
public:
71+
/**
72+
* Starts floating.
73+
* This function should get called typically from a mouse press event
74+
* handler
75+
*/
6976
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
7077
eDragState DragState, QWidget* MouseEventHandler) = 0;
7178

7279
/**
7380
* Moves the widget to a new position relative to the position given when
74-
* startFloating() was called
81+
* startFloating() was called.
82+
* This function should be called from a mouse mouve event handler to
83+
* move the floating widget on mouse move events.
7584
*/
7685
virtual void moveFloating() = 0;
7786

7887
/**
79-
* Tells the widget that to finish dragging if the mouse is released
88+
* Tells the widget that to finish dragging if the mouse is released.
89+
* This function should be called from a mouse release event handler
90+
* to finish the dragging
8091
*/
8192
virtual void finishDragging() = 0;
8293
};

src/FloatingOverlay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void CFloatingOverlay::paintEvent(QPaintEvent* event)
316316
painter.drawPixmap(QPoint(0, 0), d->ContentPreviewPixmap);
317317
}
318318

319-
// If we do not have a window frame then we paint a QRubberBadn like
319+
// If we do not have a window frame then we paint a QRubberBand like
320320
// frameless window
321321
if (!CDockManager::configFlags().testFlag(CDockManager::DragPreviewHasWindowFrame))
322322
{

src/FloatingOverlay.h

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ struct FloatingOverlayPrivate;
2121

2222
/**
2323
* A floating overlay is a temporary floating widget that is just used to
24-
* indicate the floating widget movement
24+
* indicate the floating widget movement.
25+
* This widget is used as a placeholder for drag operations for non-opaque
26+
* docking
2527
*/
2628
class CFloatingOverlay : public QWidget, public IFloatingWidget
2729
{
@@ -30,7 +32,14 @@ class CFloatingOverlay : public QWidget, public IFloatingWidget
3032
friend class FloatingOverlayPrivate;
3133

3234
protected:
35+
/**
36+
* Updates the drop overlays
37+
*/
3338
virtual void moveEvent(QMoveEvent *event) override;
39+
40+
/**
41+
* Cares about painting the
42+
*/
3443
virtual void paintEvent(QPaintEvent *e) override;
3544

3645
/**
@@ -40,14 +49,25 @@ class CFloatingOverlay : public QWidget, public IFloatingWidget
4049

4150
public:
4251
using Super = QWidget;
52+
53+
/**
54+
* Creates an instance for undocking the DockWidget in Content parameter
55+
*/
4356
CFloatingOverlay(CDockWidget* Content);
57+
58+
/**
59+
* Creates an instance for undocking the DockArea given in Content
60+
* parameters
61+
*/
4462
CFloatingOverlay(CDockAreaWidget* Content);
4563

4664
/**
4765
* Delete private data
4866
*/
4967
~CFloatingOverlay();
5068

69+
70+
public: // implements IFloatingWidget -----------------------------------------
5171
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
5272
eDragState DragState, QWidget* MouseEventHandler) override;
5373

@@ -58,7 +78,9 @@ class CFloatingOverlay : public QWidget, public IFloatingWidget
5878
virtual void moveFloating() override;
5979

6080
/**
61-
* Finishes dragging
81+
* Finishes dragging.
82+
* Hides the dock overlays and executes the real undocking and docking
83+
* of the assigned Content widget
6284
*/
6385
virtual void finishDragging() override;
6486
};

0 commit comments

Comments
 (0)