From aa6d69b7bc4cd2d5793d6e121aa0c295cfde5671 Mon Sep 17 00:00:00 2001 From: Jochen Becher Date: Thu, 12 Nov 2015 18:15:33 +0100 Subject: [PATCH] ModelEditor: Fix calls from derived classes Change-Id: I4f144bd925bd5f72272e50628d46996b0dba5369 Reviewed-by: Tobias Hunger --- .../qmt/diagram_controller/diagramcontroller.cpp | 14 +++++++------- .../qmt/diagram_scene/items/boundaryitem.cpp | 2 +- .../modeling/qmt/diagram_scene/items/classitem.cpp | 8 ++++---- .../qmt/diagram_scene/items/componentitem.cpp | 8 ++++---- .../qmt/diagram_scene/items/diagramitem.cpp | 8 ++++---- .../modeling/qmt/diagram_scene/items/itemitem.cpp | 8 ++++---- .../qmt/diagram_scene/items/packageitem.cpp | 10 +++++----- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/libs/3rdparty/modeling/qmt/diagram_controller/diagramcontroller.cpp b/src/libs/3rdparty/modeling/qmt/diagram_controller/diagramcontroller.cpp index 69dcb8a1986..1e92d94cad3 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_controller/diagramcontroller.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_controller/diagramcontroller.cpp @@ -166,8 +166,8 @@ public: private: void swap() { - DiagramController *diagramController = DiagramUndoCommand::diagramController(); - MDiagram *diagram = DiagramUndoCommand::diagram(); + DiagramController *diagramController = this->diagramController(); + MDiagram *diagram = this->diagram(); foreach (DElement *clonedElement, m_clonedElements) { DElement *activeElement = diagramController->findElement(clonedElement->uid(), diagram); QMT_CHECK(activeElement); @@ -215,8 +215,8 @@ protected: void remove() { - DiagramController *diagramController = DiagramUndoCommand::diagramController(); - MDiagram *diagram = DiagramUndoCommand::diagram(); + DiagramController *diagramController = this->diagramController(); + MDiagram *diagram = this->diagram(); bool removed = false; for (int i = 0; i < m_clonedElements.count(); ++i) { Clone &clone = m_clonedElements[i]; @@ -240,8 +240,8 @@ protected: void insert() { - DiagramController *diagramController = DiagramUndoCommand::diagramController(); - MDiagram *diagram = DiagramUndoCommand::diagram(); + DiagramController *diagramController = this->diagramController(); + MDiagram *diagram = this->diagram(); bool inserted = false; for (int i = m_clonedElements.count() - 1; i >= 0; --i) { Clone &clone = m_clonedElements[i]; @@ -310,7 +310,7 @@ public: { Clone clone; - MDiagram *diagram = DiagramUndoCommand::diagram(); + MDiagram *diagram = this->diagram(); clone.m_elementKey = element->uid(); clone.m_indexOfElement = diagram->diagramElements().indexOf(element); QMT_CHECK(clone.m_indexOfElement >= 0); diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/boundaryitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/boundaryitem.cpp index d9d2b63caf9..8e540856426 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/boundaryitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/boundaryitem.cpp @@ -199,7 +199,7 @@ void BoundaryItem::alignItemSizeToRaster(IResizable::Side adjustHorizontalSide, double vertDelta = rect.height() - qRound(rect.height() / rasterHeight) * rasterHeight; // make sure the new size is at least the minimum size - QSizeF minimumSize = BoundaryItem::minimumSize(); + QSizeF minimumSize = this->minimumSize(); while (rect.width() + horizDelta < minimumSize.width()) { horizDelta += rasterWidth; } diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/classitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/classitem.cpp index d3402964979..d43a513c065 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/classitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/classitem.cpp @@ -384,11 +384,11 @@ QSizeF ClassItem::calcMinimumGeometry() const } height += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { width = std::max(width, stereotypeIconItem->boundingRect().width() + 2 * BODY_HORIZ_BORDER); height += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { width = std::max(width, stereotypesItem->boundingRect().width() + 2 * BODY_HORIZ_BORDER); height += stereotypesItem->boundingRect().height(); } @@ -480,11 +480,11 @@ void ClassItem::updateGeometry() } y += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { stereotypeIconItem->setPos(right - stereotypeIconItem->boundingRect().width() - BODY_HORIZ_BORDER, y); y += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(-stereotypesItem->boundingRect().width() / 2.0, y); y += stereotypesItem->boundingRect().height(); } diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/componentitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/componentitem.cpp index 3423f446979..19ab491c72e 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/componentitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/componentitem.cpp @@ -294,11 +294,11 @@ QSizeF ComponentItem::calcMinimumGeometry() const } height += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { width = std::max(width, stereotypeIconItem->boundingRect().width()); height += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { width = std::max(width, stereotypesItem->boundingRect().width()); height += stereotypesItem->boundingRect().height(); } @@ -387,11 +387,11 @@ void ComponentItem::updateGeometry() } y += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { stereotypeIconItem->setPos(right - stereotypeIconItem->boundingRect().width() - BODY_HORIZ_BORDER, y); y += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(-stereotypesItem->boundingRect().width() / 2.0, y); y += stereotypesItem->boundingRect().height(); } diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/diagramitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/diagramitem.cpp index 1f98bbab41f..99ebe1db671 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/diagramitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/diagramitem.cpp @@ -172,13 +172,13 @@ QSizeF DiagramItem::calcMinimumGeometry() const } height += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { width = std::max(width, stereotypeIconItem->boundingRect().width() + 2 * BODY_HORIZ_BORDER); height += std::max(FOLD_HEIGHT, stereotypeIconItem->boundingRect().height()); } else { height += FOLD_HEIGHT; } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { width = std::max(width, stereotypesItem->boundingRect().width() + 2 * BODY_HORIZ_BORDER); height += stereotypesItem->boundingRect().height(); } @@ -265,14 +265,14 @@ void DiagramItem::updateGeometry() y += BODY_VERT_BORDER; if (!m_customIcon) { - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { stereotypeIconItem->setPos(left + BODY_HORIZ_BORDER, y); y += std::max(FOLD_HEIGHT, stereotypeIconItem->boundingRect().height()); } else { y += FOLD_HEIGHT; } } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(-stereotypesItem->boundingRect().width() / 2.0, y); y += stereotypesItem->boundingRect().height(); } diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/itemitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/itemitem.cpp index 326ffb46447..de1cae8ce43 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/itemitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/itemitem.cpp @@ -225,11 +225,11 @@ QSizeF ItemItem::calcMinimumGeometry() const } height += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { width = std::max(width, stereotypeIconItem->boundingRect().width()); height += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { width = std::max(width, stereotypesItem->boundingRect().width()); height += stereotypesItem->boundingRect().height(); } @@ -298,11 +298,11 @@ void ItemItem::updateGeometry() } y += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { stereotypeIconItem->setPos(right - stereotypeIconItem->boundingRect().width() - BODY_HORIZ_BORDER, y); y += stereotypeIconItem->boundingRect().height(); } - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(-stereotypesItem->boundingRect().width() / 2.0, y); y += stereotypesItem->boundingRect().height(); } diff --git a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/packageitem.cpp b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/packageitem.cpp index 10186720c0e..3e534ed5fb0 100644 --- a/src/libs/3rdparty/modeling/qmt/diagram_scene/items/packageitem.cpp +++ b/src/libs/3rdparty/modeling/qmt/diagram_scene/items/packageitem.cpp @@ -262,7 +262,7 @@ PackageItem::ShapeGeometry PackageItem::calcMinimumGeometry() const double bodyWidth = 0.0; tabHeight += TAB_VERT_BORDER; - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { tabWidth = std::max(tabWidth, stereotypesItem->boundingRect().width() + 2 * TAB_HORIZ_BORDER); tabHeight += stereotypesItem->boundingRect().height(); } @@ -275,7 +275,7 @@ PackageItem::ShapeGeometry PackageItem::calcMinimumGeometry() const height += tabHeight; bodyHeight = BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { bodyWidth = std::max(bodyWidth, stereotypeIconItem->boundingRect().width() + 2 * BODY_HORIZ_BORDER); bodyHeight += stereotypeIconItem->boundingRect().height(); } @@ -342,7 +342,7 @@ void PackageItem::updateGeometry() y += height; y += BODY_VERT_BORDER; - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(-stereotypesItem->boundingRect().width() / 2.0, y); y += stereotypesItem->boundingRect().height(); } @@ -366,7 +366,7 @@ void PackageItem::updateGeometry() m_shape->setPolygon(polygon); y += TAB_VERT_BORDER; - if (StereotypesItem *stereotypesItem = ObjectItem::stereotypesItem()) { + if (StereotypesItem *stereotypesItem = this->stereotypesItem()) { stereotypesItem->setPos(left + TAB_HORIZ_BORDER, y); y += stereotypesItem->boundingRect().height(); } @@ -376,7 +376,7 @@ void PackageItem::updateGeometry() } y += TAB_VERT_BORDER; y += BODY_VERT_BORDER; - if (CustomIconItem *stereotypeIconItem = ObjectItem::stereotypeIconItem()) { + if (CustomIconItem *stereotypeIconItem = this->stereotypeIconItem()) { stereotypeIconItem->setPos(right - stereotypeIconItem->boundingRect().width() - BODY_HORIZ_BORDER, y); y += stereotypeIconItem->boundingRect().height(); }