Continued refactoring, created private ContainerWidget class
This commit is contained in:
@@ -15,36 +15,13 @@ class QGridLayout;
|
||||
#include "ads/SectionContent.h"
|
||||
#include "ads/FloatingWidget.h"
|
||||
#include "ads/Serialization.h"
|
||||
#include "ContainerWidget_p.h"
|
||||
|
||||
ADS_NAMESPACE_BEGIN
|
||||
class SectionWidget;
|
||||
class DropOverlay;
|
||||
class InternalContentData;
|
||||
|
||||
struct ContainerWidgetPrivate
|
||||
{
|
||||
// Elements inside container.
|
||||
QList<SectionWidget*> sections;
|
||||
QList<FloatingWidget*> floatings;
|
||||
QHash<int, HiddenSectionItem> hiddenSectionContents;
|
||||
|
||||
|
||||
// Helper lookup maps, restricted to this container.
|
||||
QHash<int, SectionContent::WeakPtr> scLookupMapById;
|
||||
QHash<QString, SectionContent::WeakPtr> scLookupMapByName;
|
||||
QHash<int, SectionWidget*> swLookupMapById;
|
||||
|
||||
|
||||
// Layout stuff
|
||||
QGridLayout* mainLayout = nullptr;;
|
||||
Qt::Orientation orientation = Qt::Horizontal;
|
||||
QPointer<QSplitter> splitter; // $mfreiholz: I'd like to remove this variable entirely,
|
||||
// because it changes during user interaction anyway.
|
||||
|
||||
// Drop overlay stuff.
|
||||
QPointer<DropOverlay> dropOverlay;
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
* ContainerWidget is the main container to provide the docking
|
||||
@@ -130,13 +107,6 @@ public:
|
||||
// Advanced Public API
|
||||
// You usually should not need access to this methods
|
||||
//
|
||||
|
||||
// Outer DropAreas
|
||||
QRect outerTopDropRect() const;
|
||||
QRect outerRightDropRect() const;
|
||||
QRect outerBottomDropRect() const;
|
||||
QRect outerLeftDropRect() const;
|
||||
|
||||
/*!
|
||||
* \brief contents
|
||||
* \return List of known SectionContent for this ContainerWidget.
|
||||
|
||||
57
AdvancedDockingSystem/include/ads/ContainerWidget_p.h
Normal file
57
AdvancedDockingSystem/include/ads/ContainerWidget_p.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef ContainerWidget_pH
|
||||
#define ContainerWidget_pH
|
||||
//============================================================================
|
||||
/// \file ContainerWidget_p.h
|
||||
/// \author Uwe Kindler
|
||||
/// \date 21.01.2017
|
||||
/// \brief Declaration of
|
||||
//============================================================================
|
||||
|
||||
|
||||
//============================================================================
|
||||
// INCLUDES
|
||||
//============================================================================
|
||||
#include <QList>
|
||||
#include <QHash>
|
||||
#include <QPointer>
|
||||
#include <QGridLayout>
|
||||
#include <QSplitter>
|
||||
|
||||
#include "ads/DropOverlay.h"
|
||||
|
||||
namespace ads
|
||||
{
|
||||
|
||||
class SectionWidget;
|
||||
class FloatingWidget;
|
||||
class HiddenSectionItem;
|
||||
|
||||
|
||||
struct ContainerWidgetPrivate
|
||||
{
|
||||
// Elements inside container.
|
||||
QList<SectionWidget*> sections;
|
||||
QList<FloatingWidget*> floatings;
|
||||
QHash<int, HiddenSectionItem> hiddenSectionContents;
|
||||
|
||||
|
||||
// Helper lookup maps, restricted to this container.
|
||||
QHash<int, SectionContent::WeakPtr> SectionContentIdMap;
|
||||
QHash<QString, SectionContent::WeakPtr> SectionContentNameMap;
|
||||
QHash<int, SectionWidget*> SectionWidgetIdMap;
|
||||
|
||||
|
||||
// Layout stuff
|
||||
QGridLayout* mainLayout = nullptr;
|
||||
Qt::Orientation orientation = Qt::Horizontal;
|
||||
QPointer<QSplitter> splitter; // $mfreiholz: I'd like to remove this variable entirely,
|
||||
// because it changes during user interaction anyway.
|
||||
|
||||
// Drop overlay stuff.
|
||||
QPointer<DropOverlay> dropOverlay;
|
||||
QWidget* LeftBorderDropArea;
|
||||
};
|
||||
} // namespace ads
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#endif // ContainerWidget_pH
|
||||
@@ -27,9 +27,6 @@ public:
|
||||
|
||||
void setAllowedAreas(DropAreas areas);
|
||||
DropAreas allowedAreas() const;
|
||||
|
||||
void setAreaWidgets(const QHash<DropArea, QWidget*>& widgets);
|
||||
|
||||
DropArea cursorLocation() const;
|
||||
|
||||
DropArea showDropOverlay(QWidget* target);
|
||||
@@ -51,12 +48,9 @@ protected:
|
||||
private:
|
||||
DropAreas _allowedAreas;
|
||||
DropOverlayCross* _cross;
|
||||
|
||||
bool _fullAreaDrop;
|
||||
QPointer<QWidget> _target;
|
||||
QRect _targetRect;
|
||||
DropArea _lastLocation;
|
||||
QWidget* m_LeftBorderDropArea;
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user