Commit adb24b74 authored by Jochen Becher's avatar Jochen Becher

ModelEditor: rename a lot of boolean attributes to m_is...

Change-Id: I4e4711d480de37b85870e18b89b035ba05be3ddd
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 356de5e2
......@@ -38,7 +38,7 @@ namespace qmt {
DAnnotation::DAnnotation()
: DElement(),
m_visualRole(RoleNormal),
m_autoSized(true)
m_isAutoSized(true)
{
}
......@@ -48,7 +48,7 @@ DAnnotation::DAnnotation(const DAnnotation &rhs)
m_pos(rhs.m_pos),
m_rect(rhs.m_rect),
m_visualRole(rhs.m_visualRole),
m_autoSized(rhs.m_autoSized)
m_isAutoSized(rhs.m_isAutoSized)
{
}
......@@ -64,7 +64,7 @@ DAnnotation &DAnnotation::operator=(const DAnnotation &rhs)
m_pos = rhs.m_pos;
m_rect = rhs.m_rect;
m_visualRole = rhs.m_visualRole;
m_autoSized = rhs.m_autoSized;
m_isAutoSized = rhs.m_isAutoSized;
}
return *this;
}
......@@ -89,9 +89,9 @@ void DAnnotation::setVisualRole(DAnnotation::VisualRole visualRole)
m_visualRole = visualRole;
}
void DAnnotation::setAutoSize(bool autoSized)
void DAnnotation::setAutoSized(bool autoSized)
{
m_autoSized = autoSized;
m_isAutoSized = autoSized;
}
void DAnnotation::accept(DVisitor *visitor)
......
......@@ -84,9 +84,9 @@ public:
void setVisualRole(VisualRole visualRole);
bool hasAutoSize() const { return m_autoSized; }
bool isAutoSized() const { return m_isAutoSized; }
void setAutoSize(bool autoSized);
void setAutoSized(bool autoSized);
public:
......@@ -104,7 +104,7 @@ private:
VisualRole m_visualRole;
bool m_autoSized;
bool m_isAutoSized;
};
......
......@@ -38,7 +38,7 @@ namespace qmt {
DAssociationEnd::DAssociationEnd()
: m_kind(MAssociationEnd::Association),
m_navigable(false)
m_isNavigable(false)
{
}
......@@ -58,7 +58,7 @@ void DAssociationEnd::setCardinatlity(const QString &cardinality)
void DAssociationEnd::setNavigable(bool navigable)
{
m_navigable = navigable;
m_isNavigable = navigable;
}
void DAssociationEnd::setKind(MAssociationEnd::Kind kind)
......
......@@ -59,7 +59,7 @@ public:
void setKind(MAssociationEnd::Kind kind);
bool isNavigable() const { return m_navigable; }
bool isNavigable() const { return m_isNavigable; }
void setNavigable(bool navigable);
......@@ -71,7 +71,7 @@ private:
MAssociationEnd::Kind m_kind;
bool m_navigable;
bool m_isNavigable;
};
......
......@@ -38,13 +38,13 @@ namespace qmt {
DComponent::DComponent()
: DObject(),
m_plainShape(false)
m_isPlainShape(false)
{
}
void DComponent::setPlainShape(bool planeShape)
{
m_plainShape = planeShape;
m_isPlainShape = planeShape;
}
void DComponent::accept(DVisitor *visitor)
......
......@@ -44,7 +44,7 @@ public:
public:
bool plainShape() const { return m_plainShape; }
bool isPlainShape() const { return m_isPlainShape; }
void setPlainShape(bool planeShape);
......@@ -56,7 +56,7 @@ public:
private:
bool m_plainShape;
bool m_isPlainShape;
};
}
......
......@@ -38,7 +38,7 @@ namespace qmt {
DItem::DItem()
: DObject(),
m_shapeEditable(true)
m_isShapeEditable(true)
{
}
......@@ -58,7 +58,7 @@ void DItem::setShape(const QString &shape)
void DItem::setShapeEditable(bool shapeEditable)
{
m_shapeEditable = shapeEditable;
m_isShapeEditable = shapeEditable;
}
void DItem::accept(DVisitor *visitor)
......
......@@ -55,7 +55,7 @@ public:
void setShape(const QString &shape);
bool isShapeEditable() const { return m_shapeEditable; }
bool isShapeEditable() const { return m_isShapeEditable; }
void setShapeEditable(bool shapeEditable);
......@@ -71,7 +71,7 @@ private:
QString m_shape;
bool m_shapeEditable;
bool m_isShapeEditable;
};
......
......@@ -42,8 +42,8 @@ DObject::DObject()
m_visualPrimaryRole(PrimaryRoleNormal),
m_visualSecondaryRole(SecondaryRoleNone),
m_stereotypeDisplay(StereotypeSmart),
m_autoSized(true),
m_visualEmphasized(false)
m_isAutoSized(true),
m_isVisualEmphasized(false)
{
}
......@@ -59,8 +59,8 @@ DObject::DObject(const DObject &rhs)
m_visualPrimaryRole(rhs.m_visualPrimaryRole),
m_visualSecondaryRole(rhs.m_visualSecondaryRole),
m_stereotypeDisplay(rhs.m_stereotypeDisplay),
m_autoSized(rhs.m_autoSized),
m_visualEmphasized(rhs.m_visualEmphasized)
m_isAutoSized(rhs.m_isAutoSized),
m_isVisualEmphasized(rhs.m_isVisualEmphasized)
{
}
......@@ -82,8 +82,8 @@ DObject &DObject::operator =(const DObject &rhs)
m_visualPrimaryRole = rhs.m_visualPrimaryRole;
m_visualSecondaryRole = rhs.m_visualSecondaryRole;
m_stereotypeDisplay = rhs.m_stereotypeDisplay;
m_autoSized = rhs.m_autoSized;
m_visualEmphasized = rhs.m_visualEmphasized;
m_isAutoSized = rhs.m_isAutoSized;
m_isVisualEmphasized = rhs.m_isVisualEmphasized;
}
return *this;
}
......@@ -138,14 +138,14 @@ void DObject::setStereotypeDisplay(DObject::StereotypeDisplay stereotypeDisplay)
m_stereotypeDisplay = stereotypeDisplay;
}
void DObject::setAutoSize(bool autoSized)
void DObject::setAutoSized(bool autoSized)
{
m_autoSized = autoSized;
m_isAutoSized = autoSized;
}
void DObject::setVisualEmphasized(bool visualEmphasized)
{
m_visualEmphasized = visualEmphasized;
m_isVisualEmphasized = visualEmphasized;
}
void DObject::accept(DVisitor *visitor)
......
......@@ -132,11 +132,11 @@ public:
void setStereotypeDisplay(StereotypeDisplay stereotypeDisplay);
bool hasAutoSize() const { return m_autoSized; }
bool isAutoSized() const { return m_isAutoSized; }
void setAutoSize(bool autoSized);
void setAutoSized(bool autoSized);
bool isVisualEmphasized() const { return m_visualEmphasized; }
bool isVisualEmphasized() const { return m_isVisualEmphasized; }
void setVisualEmphasized(bool visualEmphasized);
......@@ -168,9 +168,9 @@ private:
StereotypeDisplay m_stereotypeDisplay;
bool m_autoSized;
bool m_isAutoSized;
bool m_visualEmphasized;
bool m_isVisualEmphasized;
};
}
......
......@@ -69,7 +69,7 @@ void DFlatAssignmentVisitor::visitDObject(const DObject *object)
target->setName(object->name());
target->setPos(object->pos());
target->setRect(object->rect());
target->setAutoSize(object->hasAutoSize());
target->setAutoSized(object->isAutoSized());
target->setDepth(object->depth());
target->setVisualPrimaryRole(object->visualPrimaryRole());
target->setVisualSecondaryRole(object->visualSecondaryRole());
......@@ -100,7 +100,7 @@ void DFlatAssignmentVisitor::visitDComponent(const DComponent *component)
visitDObject(component);
DComponent *target = dynamic_cast<DComponent *>(m_target);
QMT_CHECK(target);
target->setPlainShape(component->plainShape());
target->setPlainShape(component->isPlainShape());
}
void DFlatAssignmentVisitor::visitDDiagram(const DDiagram *diagram)
......@@ -156,7 +156,7 @@ void DFlatAssignmentVisitor::visitDAnnotation(const DAnnotation *annotation)
target->setText(annotation->text());
target->setPos(annotation->pos());
target->setRect(annotation->rect());
target->setAutoSize(annotation->hasAutoSize());
target->setAutoSized(annotation->isAutoSized());
target->setVisualRole(annotation->visualRole());
}
......
......@@ -885,7 +885,7 @@ void DiagramController::updateElementFromModel(DElement *element, const MDiagram
if (emitUpdateSignal) {
visitor.setCheckNeedsUpdate(true);
melement->accept(&visitor);
if (visitor.updateNeeded()) {
if (visitor.isUpdateNeeded()) {
int row = diagram->diagramElements().indexOf(element);
emit beginUpdateElement(row, diagram);
visitor.setCheckNeedsUpdate(false);
......
......@@ -58,14 +58,14 @@ DUpdateVisitor::DUpdateVisitor(DElement *target, const MDiagram *diagram, bool c
: m_target(target),
m_diagram(diagram),
m_checkNeedsUpdate(checkNeedsUpdate),
m_updateNeeded(!checkNeedsUpdate)
m_isUpdateNeeded(!checkNeedsUpdate)
{
}
void DUpdateVisitor::setCheckNeedsUpdate(bool checkNeedsUpdate)
{
m_checkNeedsUpdate = checkNeedsUpdate;
m_updateNeeded = !checkNeedsUpdate;
m_isUpdateNeeded = !checkNeedsUpdate;
}
void DUpdateVisitor::visitMElement(const MElement *element)
......@@ -214,7 +214,7 @@ bool DUpdateVisitor::isUpdating(bool valueChanged)
{
if (m_checkNeedsUpdate) {
if (valueChanged) {
m_updateNeeded = true;
m_isUpdateNeeded = true;
}
return false;
}
......
......@@ -48,7 +48,7 @@ public:
public:
bool updateNeeded() const { return m_updateNeeded; }
bool isUpdateNeeded() const { return m_isUpdateNeeded; }
void setCheckNeedsUpdate(bool checkNeedsUpdate);
......@@ -88,7 +88,7 @@ private:
bool m_checkNeedsUpdate;
bool m_updateNeeded;
bool m_isUpdateNeeded;
};
}
......
......@@ -81,13 +81,13 @@ AnnotationItem::AnnotationItem(DAnnotation *annotation, DiagramSceneModel *diagr
: QGraphicsItem(parent),
m_annotation(annotation),
m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false),
m_focusSelected(false),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_selectionMarker(0),
m_noTextItem(0),
m_textItem(0),
m_onUpdate(false),
m_onChanged(false)
m_isUpdating(false),
m_isChanged(false)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......@@ -110,8 +110,8 @@ void AnnotationItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
void AnnotationItem::update()
{
QMT_CHECK(!m_onUpdate);
m_onUpdate = true;
QMT_CHECK(!m_isUpdating);
m_isUpdating = true;
prepareGeometryChange();
......@@ -127,7 +127,7 @@ void AnnotationItem::update()
}
m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color());
if (!m_onChanged) {
if (!m_isChanged) {
m_textItem->setPlainText(annotation()->text());
}
......@@ -144,7 +144,7 @@ void AnnotationItem::update()
setZValue(ANNOTATION_ITEMS_ZVALUE);
m_onUpdate = false;
m_isUpdating = false;
}
QPointF AnnotationItem::pos() const
......@@ -171,7 +171,7 @@ void AnnotationItem::setPosAndRect(const QPointF &originalPos, const QRectF &ori
m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry);
m_annotation->setPos(newPos);
if (newRect.size() != m_annotation->rect().size()) {
m_annotation->setAutoSize(false);
m_annotation->setAutoSized(false);
}
m_annotation->setRect(newRect);
m_diagramSceneModel->diagramController()->finishUpdateElement(m_annotation, m_diagramSceneModel->diagram(), false);
......@@ -208,26 +208,26 @@ void AnnotationItem::alignItemPositionToRaster(double rasterWidth, double raster
bool AnnotationItem::isSecondarySelected() const
{
return m_secondarySelected;
return m_isSecondarySelected;
}
void AnnotationItem::setSecondarySelected(bool secondarySelected)
{
if (m_secondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected;
if (m_isSecondarySelected != secondarySelected) {
m_isSecondarySelected = secondarySelected;
update();
}
}
bool AnnotationItem::isFocusSelected() const
{
return m_focusSelected;
return m_isFocusSelected;
}
void AnnotationItem::setFocusSelected(bool focusSelected)
{
if (m_focusSelected != focusSelected) {
m_focusSelected = focusSelected;
if (m_isFocusSelected != focusSelected) {
m_isFocusSelected = focusSelected;
update();
}
}
......@@ -273,13 +273,13 @@ void AnnotationItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void AnnotationItem::updateSelectionMarker()
{
if (isSelected() || m_secondarySelected) {
if (isSelected() || m_isSecondarySelected) {
if (!m_selectionMarker) {
m_selectionMarker = new RectangularSelectionItem(this, this);
m_selectionMarker->setShowBorder(true);
m_selectionMarker->setFreedom(RectangularSelectionItem::FreedomHorizontalOnly);
}
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_secondarySelected);
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_isSecondarySelected);
} else if (m_selectionMarker) {
if (m_selectionMarker->scene()) {
m_selectionMarker->scene()->removeItem(m_selectionMarker);
......@@ -314,10 +314,10 @@ bool AnnotationItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
void AnnotationItem::onContentsChanged()
{
QMT_CHECK(!m_onChanged);
m_onChanged = true;
QMT_CHECK(!m_isChanged);
m_isChanged = true;
if (!m_onUpdate) {
if (!m_isUpdating) {
QString plainText = m_textItem->toPlainText();
if (m_annotation->text() != plainText) {
m_diagramSceneModel->diagramController()->startUpdateElement(m_annotation, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor);
......@@ -326,7 +326,7 @@ void AnnotationItem::onContentsChanged()
}
}
m_onChanged = false;
m_isChanged = false;
}
QSizeF AnnotationItem::calcMinimumGeometry() const
......@@ -334,7 +334,7 @@ QSizeF AnnotationItem::calcMinimumGeometry() const
qreal width = MINIMUM_TEXT_WIDTH + 2 * CONTENTS_BORDER_HORIZONTAL;
qreal height = 0.0; // irrelevant; cannot be modified by user and will always be overwritten
if (annotation()->hasAutoSize()) {
if (annotation()->isAutoSized()) {
if (m_textItem) {
m_textItem->setTextWidth(-1);
QSizeF textSize = m_textItem->document()->size();
......@@ -352,7 +352,7 @@ void AnnotationItem::updateGeometry()
qreal width = geometry.width();
qreal height = geometry.height();
if (annotation()->hasAutoSize()) {
if (annotation()->isAutoSized()) {
if (m_textItem) {
m_textItem->setTextWidth(-1);
QSizeF textSize = m_textItem->document()->size();
......
......@@ -146,9 +146,9 @@ private:
DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected;
bool m_isSecondarySelected;
bool m_focusSelected;
bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker;
......@@ -156,9 +156,9 @@ private:
AnnotationTextItem *m_textItem;
bool m_onUpdate;
bool m_isUpdating;
bool m_onChanged;
bool m_isChanged;
};
}
......
......@@ -83,14 +83,14 @@ BoundaryItem::BoundaryItem(DBoundary *boundary, DiagramSceneModel *diagramSceneM
: QGraphicsItem(parent),
m_boundary(boundary),
m_diagramSceneModel(diagramSceneModel),
m_secondarySelected(false),
m_focusSelected(false),
m_isSecondarySelected(false),
m_isFocusSelected(false),
m_selectionMarker(0),
m_borderItem(0),
m_noTextItem(0),
m_textItem(0),
m_onUpdate(false),
m_onChanged(false)
m_isUpdating(false),
m_isChanged(false)
{
setFlags(QGraphicsItem::ItemIsSelectable);
}
......@@ -113,8 +113,8 @@ void BoundaryItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
void BoundaryItem::update()
{
QMT_CHECK(!m_onUpdate);
m_onUpdate = true;
QMT_CHECK(!m_isUpdating);
m_isUpdating = true;
prepareGeometryChange();
......@@ -130,7 +130,7 @@ void BoundaryItem::update()
}
m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color());
if (!m_onChanged) {
if (!m_isChanged) {
m_textItem->setTextWidth(-1);
m_textItem->setPlainText(m_boundary->text());
}
......@@ -159,7 +159,7 @@ void BoundaryItem::update()
setZValue(BOUNDARY_ITEMS_ZVALUE);
m_onUpdate = false;
m_isUpdating = false;
}
QPointF BoundaryItem::pos() const
......@@ -261,26 +261,26 @@ void BoundaryItem::alignItemPositionToRaster(double rasterWidth, double rasterHe
bool BoundaryItem::isSecondarySelected() const
{
return m_secondarySelected;
return m_isSecondarySelected;
}
void BoundaryItem::setSecondarySelected(bool secondarySelected)
{
if (m_secondarySelected != secondarySelected) {
m_secondarySelected = secondarySelected;
if (m_isSecondarySelected != secondarySelected) {
m_isSecondarySelected = secondarySelected;
update();
}
}
bool BoundaryItem::isFocusSelected() const
{
return m_focusSelected;
return m_isFocusSelected;
}
void BoundaryItem::setFocusSelected(bool focusSelected)
{
if (m_focusSelected != focusSelected) {
m_focusSelected = focusSelected;
if (m_isFocusSelected != focusSelected) {
m_isFocusSelected = focusSelected;
update();
}
}
......@@ -326,11 +326,11 @@ void BoundaryItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
void BoundaryItem::updateSelectionMarker()
{
if (isSelected() || m_secondarySelected) {
if (isSelected() || m_isSecondarySelected) {
if (!m_selectionMarker) {
m_selectionMarker = new RectangularSelectionItem(this, this);
}
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_secondarySelected);
m_selectionMarker->setSecondarySelected(isSelected() ? false : m_isSecondarySelected);
} else if (m_selectionMarker) {
if (m_selectionMarker->scene()) {
m_selectionMarker->scene()->removeItem(m_selectionMarker);
......@@ -365,10 +365,10 @@ bool BoundaryItem::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
void BoundaryItem::onContentsChanged()
{
QMT_CHECK(!m_onChanged);
m_onChanged = true;
QMT_CHECK(!m_isChanged);
m_isChanged = true;
if (!m_onUpdate) {
if (!m_isUpdating) {
QString plainText = m_textItem->toPlainText();
if (m_boundary->text() != plainText) {
m_diagramSceneModel->diagramController()->startUpdateElement(m_boundary, m_diagramSceneModel->diagram(), DiagramController::UpdateMinor);
......@@ -377,7 +377,7 @@ void BoundaryItem::onContentsChanged()
}
}
m_onChanged = false;
m_isChanged = false;
}
QSizeF BoundaryItem::calcMinimumGeometry() const
......
......@@ -145,9 +145,9 @@ private:
DiagramSceneModel *m_diagramSceneModel;
bool m_secondarySelected;
bool m_isSecondarySelected;
bool m_focusSelected;
bool m_isFocusSelected;
RectangularSelectionItem *m_selectionMarker;
......@@ -157,9 +157,9 @@ private:
BoundaryTextItem *m_textItem;
bool m_onUpdate;
bool m_isUpdating;
bool m_onChanged;
bool m_isChanged;
};
}
......
......@@ -434,7 +434,7 @@ void ClassItem::updateGeometry()
width = geometry.width();
height = geometry.height();
if (object()->hasAutoSize()) {
if (object()->isAutoSized()) {
if (!m_customIcon) {
if (width < MINIMUM_AUTO_WIDTH) {
width = MINIMUM_AUTO_WIDTH;
......
......@@ -281,7 +281,7 @@ bool ComponentItem::hasPlainShape() const
{
DComponent *diagramComponent = dynamic_cast<DComponent *>(object());
QMT_CHECK(diagramComponent);
return diagramComponent->plainShape();
return diagramComponent->isPlainShape();
}
QSizeF ComponentItem::calcMinimumGeometry() const
......@@ -336,7 +336,7 @@ void ComponentItem::updateGeometry()
width = geometry.width();
height = geometry.height();
if (object()->hasAutoSize()) {
if (object()->isAutoSized()) {
// nothing
} else {
QRectF rect = object()->rect();
......
......@@ -203,7 +203,7 @@ void DiagramItem::updateGeometry()
width = geometry.width();
height = geometry.height();
if (object()->hasAutoSize()) {
if (object()->isAutoSized()) {
if (!m_customIcon) {
if (width < MINIMUM_AUTO_WIDTH) {
width = MINIMUM_AUTO_WIDTH;
......
......@@ -259,7 +259,7 @@ void ItemItem::updateGeometry()
width = geometry.width();
height = geometry.height();
if (object()->hasAutoSize()) {
if (object()->isAutoSized()) {