diff --git a/AdvancedDockingSystem/include/ads/ContainerWidget.h b/AdvancedDockingSystem/include/ads/ContainerWidget.h index a08cf54..00048ea 100644 --- a/AdvancedDockingSystem/include/ads/ContainerWidget.h +++ b/AdvancedDockingSystem/include/ads/ContainerWidget.h @@ -29,7 +29,6 @@ class InternalContentData; class ADS_EXPORT_API ContainerWidget : public QFrame { Q_OBJECT - Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged) friend class SectionContent; friend class SectionWidget; @@ -45,9 +44,6 @@ public: // Public API // - Qt::Orientation orientation() const; - void setOrientation(Qt::Orientation orientation); - /*! * Adds the section-content sc to this container-widget into the section-widget sw. * If sw is not NULL, the area is used to indicate how the content should be arranged. diff --git a/AdvancedDockingSystem/include/ads/DropOverlay.h b/AdvancedDockingSystem/include/ads/DropOverlay.h index 9754a95..dcdb495 100644 --- a/AdvancedDockingSystem/include/ads/DropOverlay.h +++ b/AdvancedDockingSystem/include/ads/DropOverlay.h @@ -12,8 +12,10 @@ class QGridLayout; ADS_NAMESPACE_BEGIN class DropOverlayCross; -// DropOverlay paints a translucent rectangle over another widget. -// It can also show different types of drop area indicators. +/*! + * DropOverlay paints a translucent rectangle over another widget. The geometry + * of the rectangle is based on the mouse location. + */ class DropOverlay : public QFrame { Q_OBJECT @@ -41,7 +43,7 @@ protected: private: DropAreas _allowedAreas; - DropOverlayCross* _splitAreas; + DropOverlayCross* _cross; bool _fullAreaDrop; QPointer _target; @@ -49,7 +51,7 @@ private: DropArea _lastLocation; }; -// DropSplitAreas shows a cross with 5 different drop area possibilities. +// DropOverlayCross shows a cross with 5 different drop area possibilities. class DropOverlayCross : public QWidget { Q_OBJECT diff --git a/AdvancedDockingSystem/src/ContainerWidget.cpp b/AdvancedDockingSystem/src/ContainerWidget.cpp index 61cdd0f..8447292 100644 --- a/AdvancedDockingSystem/src/ContainerWidget.cpp +++ b/AdvancedDockingSystem/src/ContainerWidget.cpp @@ -67,20 +67,6 @@ ContainerWidget::~ContainerWidget() _swLookupMapById.clear(); } -Qt::Orientation ContainerWidget::orientation() const -{ - return _orientation; -} - -void ContainerWidget::setOrientation(Qt::Orientation orientation) -{ - if (_orientation != orientation) - { - _orientation = orientation; - emit orientationChanged(); - } -} - SectionWidget* ContainerWidget::addSectionContent(const SectionContent::RefPtr& sc, SectionWidget* sw, DropArea area) { if (!sw) diff --git a/AdvancedDockingSystem/src/DropOverlay.cpp b/AdvancedDockingSystem/src/DropOverlay.cpp index 8d270b1..701ea90 100644 --- a/AdvancedDockingSystem/src/DropOverlay.cpp +++ b/AdvancedDockingSystem/src/DropOverlay.cpp @@ -27,7 +27,7 @@ static QWidget* createDropWidget(const QString& img) DropOverlay::DropOverlay(QWidget* parent) : QFrame(parent), _allowedAreas(InvalidDropArea), - _splitAreas(new DropOverlayCross(this)), + _cross(new DropOverlayCross(this)), _fullAreaDrop(false), _lastLocation(InvalidDropArea) { @@ -40,7 +40,7 @@ DropOverlay::DropOverlay(QWidget* parent) : l->setSpacing(0); setLayout(l); - _splitAreas->setVisible(false); + _cross->setVisible(false); setVisible(false); } @@ -54,9 +54,9 @@ void DropOverlay::setAllowedAreas(DropAreas areas) return; _allowedAreas = areas; - _splitAreas->reset(); - _splitAreas->move(pos()); - _splitAreas->resize(size()); + _cross->reset(); + _cross->move(pos()); + _cross->resize(size()); } DropAreas DropOverlay::allowedAreas() const @@ -67,9 +67,9 @@ DropAreas DropOverlay::allowedAreas() const DropArea DropOverlay::cursorLocation() const { DropArea loc = InvalidDropArea; - if (_splitAreas) + if (_cross) { - loc = _splitAreas->cursorLocation(); + loc = _cross->cursorLocation(); } return loc; } @@ -195,22 +195,22 @@ void DropOverlay::paintEvent(QPaintEvent*) void DropOverlay::showEvent(QShowEvent*) { - _splitAreas->show(); + _cross->show(); } void DropOverlay::hideEvent(QHideEvent*) { - _splitAreas->hide(); + _cross->hide(); } void DropOverlay::resizeEvent(QResizeEvent* e) { - _splitAreas->resize(e->size()); + _cross->resize(e->size()); } void DropOverlay::moveEvent(QMoveEvent* e) { - _splitAreas->move(e->pos()); + _cross->move(e->pos()); } /////////////////////////////////////////////////////////////////////// diff --git a/AdvancedDockingSystemDemo/src/mainwindow.cpp b/AdvancedDockingSystemDemo/src/mainwindow.cpp index 95fdb83..56b0b29 100644 --- a/AdvancedDockingSystemDemo/src/mainwindow.cpp +++ b/AdvancedDockingSystemDemo/src/mainwindow.cpp @@ -93,7 +93,6 @@ MainWindow::MainWindow(QWidget *parent) : // ADS - Create main container (ContainerWidget). _container = new ADS_NS::ContainerWidget(); - _container->setOrientation(Qt::Vertical); #if QT_VERSION >= 0x050000 QObject::connect(_container, &ADS_NS::ContainerWidget::activeTabChanged, this, &MainWindow::onActiveTabChanged); QObject::connect(_container, &ADS_NS::ContainerWidget::sectionContentVisibilityChanged, this, &MainWindow::onSectionContentVisibilityChanged);