KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
DropIndicatorOverlay.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#ifndef KD_DROPINDICATOROVERLAY_H
13#define KD_DROPINDICATOROVERLAY_H
14
15#include "kddockwidgets/docks_export.h"
16#include "kddockwidgets/KDDockWidgets.h"
17#include "Controller.h"
18
19namespace KDDockWidgets {
20
21namespace Core {
22
23class DropArea;
24class Group;
25
34
35class DOCKS_EXPORT DropIndicatorOverlay : public Controller
36{
37 Q_OBJECT
38public:
42 explicit DropIndicatorOverlay(DropArea *dropArea, View *view);
43
48 explicit DropIndicatorOverlay(DropArea *dropArea);
49
50 ~DropIndicatorOverlay() override;
51
52 void setHoveredGroup(Group *);
53 void setWindowBeingDragged(bool);
54 Rect hoveredGroupRect() const;
55 bool isHovered() const;
56 DropLocation currentDropLocation() const;
57 Group *hoveredGroup() const;
58
59 virtual void setCurrentDropLocation(DropLocation);
60
61 KDDockWidgets::DropLocation hover(Point globalPos);
62
64 void removeHover();
65
68 virtual Point posForIndicator(DropLocation) const = 0;
69
71 virtual bool dropIndicatorVisible(DropLocation) const;
72
73 static KDDockWidgets::Location multisplitterLocationFor(DropLocation);
74
75 class Private;
76 Private *dptr() const;
77
78private:
79 void onGroupDestroyed();
80 void setHoveredGroupRect(Rect);
81 Rect m_hoveredGroupRect;
82 DropLocation m_currentDropLocation = DropLocation_None;
83 Private *const d;
84
85protected:
86 virtual DropLocation hover_impl(Point globalPos) = 0;
87 virtual void onHoveredGroupChanged(Group *);
88 virtual void updateVisibility();
89
90 Group *m_hoveredGroup = nullptr;
92 bool m_draggedWindowIsHovering = false;
93};
94
95}
96
97}
98
99#endif
virtual DropLocation hover_impl(Point globalPos)=0
virtual Point posForIndicator(DropLocation) const =0
returns the position of the specified drop location The return is in global coordinates
Class to abstract QAction, so code still works with QtQuick and Flutter.
DropLocation
Enum describing the different drop indicator types.

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8