forked from qt-creator/qt-creator
ModelEditor: rename a lot of boolean attributes to m_is...
Change-Id: I4e4711d480de37b85870e18b89b035ba05be3ddd Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
10
src/libs/3rdparty/modeling/qmt/diagram/dobject.h
vendored
10
src/libs/3rdparty/modeling/qmt/diagram/dobject.h
vendored
@@ -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()) {
|
||||
// nothing
|
||||
} else {
|
||||
QRectF rect = object()->rect();
|
||||
|
||||
@@ -66,8 +66,8 @@ ObjectItem::ObjectItem(DObject *object, DiagramSceneModel *diagramSceneModel, QG
|
||||
: QGraphicsItem(parent),
|
||||
m_object(object),
|
||||
m_diagramSceneModel(diagramSceneModel),
|
||||
m_secondarySelected(false),
|
||||
m_focusSelected(false),
|
||||
m_isSecondarySelected(false),
|
||||
m_isFocusSelected(false),
|
||||
m_stereotypeIconDisplay(StereotypeIcon::DisplayLabel),
|
||||
m_stereotypes(0),
|
||||
m_stereotypeIcon(0),
|
||||
@@ -113,7 +113,7 @@ void ObjectItem::setPosAndRect(const QPointF &originalPos, const QRectF &origina
|
||||
m_diagramSceneModel->diagramController()->startUpdateElement(m_object, m_diagramSceneModel->diagram(), DiagramController::UpdateGeometry);
|
||||
m_object->setPos(newPos);
|
||||
if (newRect.size() != m_object->rect().size()) {
|
||||
m_object->setAutoSize(false);
|
||||
m_object->setAutoSized(false);
|
||||
}
|
||||
m_object->setRect(newRect);
|
||||
m_diagramSceneModel->diagramController()->finishUpdateElement(m_object, m_diagramSceneModel->diagram(), false);
|
||||
@@ -191,26 +191,26 @@ void ObjectItem::alignItemPositionToRaster(double rasterWidth, double rasterHeig
|
||||
|
||||
bool ObjectItem::isSecondarySelected() const
|
||||
{
|
||||
return m_secondarySelected;
|
||||
return m_isSecondarySelected;
|
||||
}
|
||||
|
||||
void ObjectItem::setSecondarySelected(bool secondarySelected)
|
||||
{
|
||||
if (m_secondarySelected != secondarySelected) {
|
||||
m_secondarySelected = secondarySelected;
|
||||
if (m_isSecondarySelected != secondarySelected) {
|
||||
m_isSecondarySelected = secondarySelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
bool ObjectItem::isFocusSelected() const
|
||||
{
|
||||
return m_focusSelected;
|
||||
return m_isFocusSelected;
|
||||
}
|
||||
|
||||
void ObjectItem::setFocusSelected(bool focusSelected)
|
||||
{
|
||||
if (m_focusSelected != focusSelected) {
|
||||
m_focusSelected = focusSelected;
|
||||
if (m_isFocusSelected != focusSelected) {
|
||||
m_isFocusSelected = focusSelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,9 +208,9 @@ private:
|
||||
|
||||
DiagramSceneModel *m_diagramSceneModel;
|
||||
|
||||
bool m_secondarySelected;
|
||||
bool m_isSecondarySelected;
|
||||
|
||||
bool m_focusSelected;
|
||||
bool m_isFocusSelected;
|
||||
|
||||
QString m_stereotypeIconId;
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ void PackageItem::updateGeometry()
|
||||
double tabHeight = geometry.m_minimumTabSize.height();
|
||||
|
||||
// calc width and height
|
||||
if (object()->hasAutoSize()) {
|
||||
if (object()->isAutoSized()) {
|
||||
if (!m_customIcon) {
|
||||
if (width < MINIMUM_AUTO_WIDTH) {
|
||||
width = MINIMUM_AUTO_WIDTH;
|
||||
|
||||
@@ -190,8 +190,8 @@ RelationItem::RelationItem(DRelation *relation, DiagramSceneModel *diagramSceneM
|
||||
: QGraphicsItem(parent),
|
||||
m_relation(relation),
|
||||
m_diagramSceneModel(diagramSceneModel),
|
||||
m_secondarySelected(false),
|
||||
m_focusSelected(false),
|
||||
m_isSecondarySelected(false),
|
||||
m_isFocusSelected(false),
|
||||
m_arrow(0),
|
||||
m_name(0),
|
||||
m_stereotypes(0),
|
||||
@@ -270,26 +270,26 @@ void RelationItem::alignItemPositionToRaster(double rasterWidth, double rasterHe
|
||||
|
||||
bool RelationItem::isSecondarySelected() const
|
||||
{
|
||||
return m_secondarySelected;
|
||||
return m_isSecondarySelected;
|
||||
}
|
||||
|
||||
void RelationItem::setSecondarySelected(bool secondarySelected)
|
||||
{
|
||||
if (m_secondarySelected != secondarySelected) {
|
||||
m_secondarySelected = secondarySelected;
|
||||
if (m_isSecondarySelected != secondarySelected) {
|
||||
m_isSecondarySelected = secondarySelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
bool RelationItem::isFocusSelected() const
|
||||
{
|
||||
return m_focusSelected;
|
||||
return m_isFocusSelected;
|
||||
}
|
||||
|
||||
void RelationItem::setFocusSelected(bool focusSelected)
|
||||
{
|
||||
if (m_focusSelected != focusSelected) {
|
||||
m_focusSelected = focusSelected;
|
||||
if (m_isFocusSelected != focusSelected) {
|
||||
m_isFocusSelected = focusSelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,9 +137,9 @@ protected:
|
||||
|
||||
DiagramSceneModel *m_diagramSceneModel;
|
||||
|
||||
bool m_secondarySelected;
|
||||
bool m_isSecondarySelected;
|
||||
|
||||
bool m_focusSelected;
|
||||
bool m_isFocusSelected;
|
||||
|
||||
ArrowItem *m_arrow;
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ PathSelectionItem::PathSelectionItem(IWindable *windable, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent),
|
||||
m_windable(windable),
|
||||
m_pointSize(QSizeF(8.0, 8.0)),
|
||||
m_secondarySelected(false)
|
||||
m_isSecondarySelected(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -244,8 +244,8 @@ void PathSelectionItem::setPoints(const QList<QPointF> &points)
|
||||
|
||||
void PathSelectionItem::setSecondarySelected(bool secondarySelected)
|
||||
{
|
||||
if (m_secondarySelected != secondarySelected) {
|
||||
m_secondarySelected = secondarySelected;
|
||||
if (m_isSecondarySelected != secondarySelected) {
|
||||
m_isSecondarySelected = secondarySelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ void PathSelectionItem::update()
|
||||
foreach (GraphicsHandleItem *handle, m_handles) {
|
||||
handle->setPointSize(m_pointSize);
|
||||
bool isEndPoint = (i == 0 || i == m_handles.size() - 1);
|
||||
handle->setSelection(m_secondarySelected
|
||||
handle->setSelection(m_isSecondarySelected
|
||||
? (isEndPoint ? GraphicsHandleItem::NotSelected : GraphicsHandleItem::SecondarySelected)
|
||||
: GraphicsHandleItem::Selected);
|
||||
++i;
|
||||
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
|
||||
QSizeF m_pointSize;
|
||||
|
||||
bool m_secondarySelected;
|
||||
bool m_isSecondarySelected;
|
||||
|
||||
QList<GraphicsHandleItem *> m_handles;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
: QGraphicsRectItem(parent),
|
||||
m_owner(parent),
|
||||
m_handle(handle),
|
||||
m_secondarySelected(false)
|
||||
m_isSecondarySelected(false)
|
||||
{
|
||||
setPen(QPen(Qt::black));
|
||||
setBrush(QBrush(Qt::black));
|
||||
@@ -60,8 +60,8 @@ public:
|
||||
|
||||
void setSecondarySelected(bool secondarySelected)
|
||||
{
|
||||
if (secondarySelected != m_secondarySelected) {
|
||||
m_secondarySelected = secondarySelected;
|
||||
if (secondarySelected != m_isSecondarySelected) {
|
||||
m_isSecondarySelected = secondarySelected;
|
||||
if (secondarySelected) {
|
||||
setPen(QPen(Qt::lightGray));
|
||||
setBrush(Qt::NoBrush);
|
||||
@@ -78,7 +78,7 @@ protected:
|
||||
void mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
m_startPos = mapToScene(event->pos());
|
||||
if (!m_secondarySelected) {
|
||||
if (!m_isSecondarySelected) {
|
||||
m_owner->moveHandle(m_handle, QPointF(0.0, 0.0), Press, None);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ protected:
|
||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QPointF pos = mapToScene(event->pos()) - m_startPos;
|
||||
if (!m_secondarySelected) {
|
||||
if (!m_isSecondarySelected) {
|
||||
m_owner->moveHandle(m_handle, pos, Move, None);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ protected:
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QPointF pos = mapToScene(event->pos()) - m_startPos;
|
||||
if (!m_secondarySelected) {
|
||||
if (!m_isSecondarySelected) {
|
||||
m_owner->moveHandle(m_handle, pos, Release, None);
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ private:
|
||||
|
||||
Handle m_handle;
|
||||
|
||||
bool m_secondarySelected;
|
||||
bool m_isSecondarySelected;
|
||||
|
||||
QPointF m_startPos;
|
||||
};
|
||||
@@ -120,7 +120,7 @@ RectangularSelectionItem::RectangularSelectionItem(IResizable *itemResizer, QGra
|
||||
m_showBorder(false),
|
||||
m_borderItem(0),
|
||||
m_freedom(FreedomAny),
|
||||
m_secondarySelected(false)
|
||||
m_isSecondarySelected(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ void RectangularSelectionItem::setFreedom(Freedom freedom)
|
||||
|
||||
void RectangularSelectionItem::setSecondarySelected(bool secondarySelected)
|
||||
{
|
||||
if (secondarySelected != m_secondarySelected) {
|
||||
m_secondarySelected = secondarySelected;
|
||||
if (secondarySelected != m_isSecondarySelected) {
|
||||
m_isSecondarySelected = secondarySelected;
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void RectangularSelectionItem::update()
|
||||
visible = m_freedom == FreedomAny || m_freedom == FreedomKeepRatio;
|
||||
break;
|
||||
}
|
||||
m_points[i]->setSecondarySelected(m_secondarySelected);
|
||||
m_points[i]->setSecondarySelected(m_isSecondarySelected);
|
||||
m_points[i]->setVisible(visible);
|
||||
}
|
||||
double horizCenter = (m_rect.left() + m_rect.right()) * 0.5;
|
||||
@@ -235,7 +235,7 @@ void RectangularSelectionItem::update()
|
||||
m_borderItem = new QGraphicsRectItem(this);
|
||||
}
|
||||
m_borderItem->setRect(m_rect);
|
||||
if (m_secondarySelected) {
|
||||
if (m_isSecondarySelected) {
|
||||
m_borderItem->setPen(QPen(QBrush(Qt::lightGray), 0.0, Qt::DashDotLine));
|
||||
} else {
|
||||
m_borderItem->setPen(QPen(QBrush(Qt::black), 0.0, Qt::DashDotLine));
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
|
||||
void setFreedom(Freedom freedom);
|
||||
|
||||
bool isSecondarySelected() const { return m_secondarySelected; }
|
||||
bool isSecondarySelected() const { return m_isSecondarySelected; }
|
||||
|
||||
void setSecondarySelected(bool secondarySelected);
|
||||
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
|
||||
Freedom m_freedom;
|
||||
|
||||
bool m_secondarySelected;
|
||||
bool m_isSecondarySelected;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -53,19 +53,19 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
explicit Handles(bool takeOwnership = false) : m_takeOwnership(takeOwnership) { }
|
||||
explicit Handles(bool takeOwnership = false) : m_takesOwnership(takeOwnership) { }
|
||||
|
||||
Handles(const Handles<T> &rhs)
|
||||
: m_handleList(rhs.m_handleList),
|
||||
m_takeOwnership(false)
|
||||
m_takesOwnership(false)
|
||||
{
|
||||
}
|
||||
|
||||
Handles(const Handles<T> &rhs, bool takeOwnership)
|
||||
: m_handleList(rhs.m_handleList),
|
||||
m_takeOwnership(takeOwnership)
|
||||
m_takesOwnership(takeOwnership)
|
||||
{
|
||||
if (m_takeOwnership && rhs.m_takeOwnership) {
|
||||
if (m_takesOwnership && rhs.m_takesOwnership) {
|
||||
const_cast<Handles<T> &>(rhs).m_handleList.clear();
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
{
|
||||
if (this != &rhs) {
|
||||
m_handleList = rhs.m_handleList;
|
||||
if (m_takeOwnership && rhs.m_takeOwnership) {
|
||||
if (m_takesOwnership && rhs.m_takesOwnership) {
|
||||
const_cast<Handles<T> &>(rhs).m_handleList.clear();
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
bool takesOwnership() const { return m_takeOwnership; }
|
||||
bool takesOwnership() const { return m_takesOwnership; }
|
||||
|
||||
bool isEmpty() const { return m_handleList.empty(); }
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
|
||||
void reset()
|
||||
{
|
||||
if (m_takeOwnership) {
|
||||
if (m_takesOwnership) {
|
||||
foreach (const Handle<T> &handle, m_handleList) {
|
||||
delete handle.target();
|
||||
}
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
void remove(int index)
|
||||
{
|
||||
QMT_CHECK(index >= 0 && index < size());
|
||||
if (m_takeOwnership) {
|
||||
if (m_takesOwnership) {
|
||||
T *t = m_handleList.at(index).target();
|
||||
m_handleList.removeAt(index);
|
||||
delete t;
|
||||
@@ -261,7 +261,7 @@ private:
|
||||
|
||||
value_type m_handleList;
|
||||
|
||||
bool m_takeOwnership;
|
||||
bool m_takesOwnership;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace qmt {
|
||||
|
||||
MAssociationEnd::MAssociationEnd()
|
||||
: m_kind(Association),
|
||||
m_navigable(false)
|
||||
m_isNavigable(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ MAssociationEnd::MAssociationEnd(const MAssociationEnd &rhs)
|
||||
: m_name(rhs.m_name),
|
||||
m_cardinality(rhs.m_cardinality),
|
||||
m_kind(rhs.m_kind),
|
||||
m_navigable(rhs.m_navigable)
|
||||
m_isNavigable(rhs.m_isNavigable)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ MAssociationEnd &MAssociationEnd::operator =(const MAssociationEnd &rhs)
|
||||
m_name = rhs.m_name;
|
||||
m_cardinality = rhs.m_cardinality;
|
||||
m_kind = rhs.m_kind;
|
||||
m_navigable = rhs.m_navigable;
|
||||
m_isNavigable = rhs.m_isNavigable;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ void MAssociationEnd::setKind(MAssociationEnd::Kind kind)
|
||||
|
||||
void MAssociationEnd::setNavigable(bool navigable)
|
||||
{
|
||||
m_navigable = navigable;
|
||||
m_isNavigable = navigable;
|
||||
}
|
||||
|
||||
bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs)
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
|
||||
void setKind(Kind kind);
|
||||
|
||||
bool isNavigable() const { return m_navigable; }
|
||||
bool isNavigable() const { return m_isNavigable; }
|
||||
|
||||
void setNavigable(bool navigable);
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
|
||||
Kind m_kind;
|
||||
|
||||
bool m_navigable;
|
||||
bool m_isNavigable;
|
||||
};
|
||||
|
||||
bool operator==(const MAssociationEnd &lhs, const MAssociationEnd &rhs);
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace qmt {
|
||||
|
||||
MItem::MItem()
|
||||
: MObject(),
|
||||
m_varietyEditable(true),
|
||||
m_shapeEditable(false)
|
||||
m_isVarietyEditable(true),
|
||||
m_isShapeEditable(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ void MItem::setVariety(const QString &variety)
|
||||
|
||||
void MItem::setVarietyEditable(bool varietyEditable)
|
||||
{
|
||||
m_varietyEditable = varietyEditable;
|
||||
m_isVarietyEditable = varietyEditable;
|
||||
}
|
||||
|
||||
void MItem::setShapeEditable(bool shapeEditable)
|
||||
{
|
||||
m_shapeEditable = shapeEditable;
|
||||
m_isShapeEditable = shapeEditable;
|
||||
}
|
||||
|
||||
void MItem::accept(MVisitor *visitor)
|
||||
|
||||
8
src/libs/3rdparty/modeling/qmt/model/mitem.h
vendored
8
src/libs/3rdparty/modeling/qmt/model/mitem.h
vendored
@@ -51,11 +51,11 @@ public:
|
||||
|
||||
void setVariety(const QString &variety);
|
||||
|
||||
bool isVarietyEditable() const { return m_varietyEditable; }
|
||||
bool isVarietyEditable() const { return m_isVarietyEditable; }
|
||||
|
||||
void setVarietyEditable(bool varietyEditable);
|
||||
|
||||
bool isShapeEditable() const { return m_shapeEditable; }
|
||||
bool isShapeEditable() const { return m_isShapeEditable; }
|
||||
|
||||
void setShapeEditable(bool shapeEditable);
|
||||
|
||||
@@ -69,9 +69,9 @@ private:
|
||||
|
||||
QString m_variety;
|
||||
|
||||
bool m_varietyEditable;
|
||||
bool m_isVarietyEditable;
|
||||
|
||||
bool m_shapeEditable;
|
||||
bool m_isShapeEditable;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace qmt {
|
||||
|
||||
MSourceExpansion::MSourceExpansion()
|
||||
: MExpansion(),
|
||||
m_transient(false)
|
||||
m_isTransient(false)
|
||||
{
|
||||
}
|
||||
|
||||
MSourceExpansion::MSourceExpansion(const MSourceExpansion &rhs)
|
||||
: MExpansion(rhs),
|
||||
m_sourceId(rhs.m_sourceId),
|
||||
m_transient(rhs.m_transient)
|
||||
m_isTransient(rhs.m_isTransient)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ MSourceExpansion &MSourceExpansion::operator=(const MSourceExpansion &rhs)
|
||||
{
|
||||
if (this != &rhs) {
|
||||
m_sourceId = rhs.m_sourceId;
|
||||
m_transient = rhs.m_transient;
|
||||
m_isTransient = rhs.m_isTransient;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ void MSourceExpansion::setSourceId(const QString &sourceId)
|
||||
|
||||
void MSourceExpansion::setTransient(bool transient)
|
||||
{
|
||||
m_transient = transient;
|
||||
m_isTransient = transient;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
void setSourceId(const QString &sourceId);
|
||||
|
||||
bool isTransient() const { return m_transient; }
|
||||
bool isTransient() const { return m_isTransient; }
|
||||
|
||||
void setTransient(bool transient);
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
|
||||
QString m_sourceId;
|
||||
|
||||
bool m_transient;
|
||||
bool m_isTransient;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ ModelController::ModelController(QObject *parent)
|
||||
: QObject(parent),
|
||||
m_rootPackage(0),
|
||||
m_undoController(0),
|
||||
m_resettingModel(false)
|
||||
m_isResettingModel(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -689,21 +689,21 @@ MElement *ModelController::findElement(const Uid &key)
|
||||
|
||||
void ModelController::startResetModel()
|
||||
{
|
||||
QMT_CHECK(!m_resettingModel);
|
||||
m_resettingModel = true;
|
||||
QMT_CHECK(!m_isResettingModel);
|
||||
m_isResettingModel = true;
|
||||
emit beginResetModel();
|
||||
QMT_CHECK(m_resettingModel);
|
||||
QMT_CHECK(m_isResettingModel);
|
||||
}
|
||||
|
||||
void ModelController::finishResetModel(bool modified)
|
||||
{
|
||||
QMT_CHECK(m_resettingModel);
|
||||
QMT_CHECK(m_isResettingModel);
|
||||
emit endResetModel();
|
||||
if (modified) {
|
||||
emit this->modified();
|
||||
}
|
||||
QMT_CHECK(m_resettingModel);
|
||||
m_resettingModel = false;
|
||||
QMT_CHECK(m_isResettingModel);
|
||||
m_isResettingModel = false;
|
||||
}
|
||||
|
||||
MObject *ModelController::object(int row, const MObject *owner) const
|
||||
@@ -726,7 +726,7 @@ void ModelController::addObject(MPackage *parentPackage, MObject *object)
|
||||
QMT_CHECK(parentPackage);
|
||||
QMT_CHECK(object);
|
||||
int row = parentPackage->children().size();
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginInsertObject(row, parentPackage);
|
||||
}
|
||||
mapObject(object);
|
||||
@@ -736,7 +736,7 @@ void ModelController::addObject(MPackage *parentPackage, MObject *object)
|
||||
undoCommand->add(TypeObject, object->uid(), parentPackage->uid());
|
||||
}
|
||||
parentPackage->addChild(object);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endInsertObject(row, parentPackage);
|
||||
emit modified();
|
||||
}
|
||||
@@ -754,7 +754,7 @@ void ModelController::removeObject(MObject *object)
|
||||
QMT_CHECK(object->owner());
|
||||
int row = object->owner()->children().indexOf(object);
|
||||
MObject *owner = object->owner();
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginRemoveObject(row, owner);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -764,7 +764,7 @@ void ModelController::removeObject(MObject *object)
|
||||
}
|
||||
unmapObject(object);
|
||||
owner->removeChild(object);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endRemoveObject(row, owner);
|
||||
emit modified();
|
||||
}
|
||||
@@ -787,7 +787,7 @@ void ModelController::startUpdateObject(MObject *object)
|
||||
if (MPackage *package = dynamic_cast<MPackage *>(object)) {
|
||||
m_oldPackageName = package->name();
|
||||
}
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginUpdateObject(row, parent);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -806,7 +806,7 @@ void ModelController::finishUpdateObject(MObject *object, bool cancelled)
|
||||
} else {
|
||||
row = parent->children().indexOf(object);
|
||||
}
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endUpdateObject(row, parent);
|
||||
if (!cancelled) {
|
||||
QList<MRelation *> relations = findRelationsOfObject(object);
|
||||
@@ -835,7 +835,7 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
|
||||
MObject *formerOwner = object->owner();
|
||||
QMT_CHECK(formerOwner);
|
||||
formerRow = formerOwner->children().indexOf(object);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginMoveObject(formerRow, formerOwner);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -845,7 +845,7 @@ void ModelController::moveObject(MPackage *newOwner, MObject *object)
|
||||
formerOwner->decontrolChild(object);
|
||||
newOwner->addChild(object);
|
||||
int row = newOwner->children().indexOf(object);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endMoveObject(row, newOwner);
|
||||
emit modified();
|
||||
}
|
||||
@@ -866,7 +866,7 @@ void ModelController::addRelation(MObject *owner, MRelation *relation)
|
||||
QMT_CHECK(findObject(relation->endBUid()));
|
||||
|
||||
int row = owner->relations().size();
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginInsertRelation(row, owner);
|
||||
}
|
||||
mapRelation(relation);
|
||||
@@ -876,7 +876,7 @@ void ModelController::addRelation(MObject *owner, MRelation *relation)
|
||||
undoCommand->add(TypeRelation, relation->uid(), owner->uid());
|
||||
}
|
||||
owner->addRelation(relation);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endInsertRelation(row, owner);
|
||||
emit modified();
|
||||
}
|
||||
@@ -889,7 +889,7 @@ void ModelController::removeRelation(MRelation *relation)
|
||||
MObject *owner = relation->owner();
|
||||
QMT_CHECK(owner);
|
||||
int row = owner->relations().indexOf(relation);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginRemoveRelation(row, owner);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -899,7 +899,7 @@ void ModelController::removeRelation(MRelation *relation)
|
||||
}
|
||||
unmapRelation(relation);
|
||||
owner->removeRelation(relation);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endRemoveRelation(row, owner);
|
||||
emit modified();
|
||||
}
|
||||
@@ -911,7 +911,7 @@ void ModelController::startUpdateRelation(MRelation *relation)
|
||||
QMT_CHECK(relation);
|
||||
MObject *owner = relation->owner();
|
||||
QMT_CHECK(owner);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginUpdateRelation(owner->relations().indexOf(relation), owner);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -926,7 +926,7 @@ void ModelController::finishUpdateRelation(MRelation *relation, bool cancelled)
|
||||
QMT_CHECK(findObject(relation->endBUid()));
|
||||
MObject *owner = relation->owner();
|
||||
QMT_CHECK(owner);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endUpdateRelation(owner->relations().indexOf(relation), owner);
|
||||
if (!cancelled) {
|
||||
emit modified();
|
||||
@@ -945,7 +945,7 @@ void ModelController::moveRelation(MObject *newOwner, MRelation *relation)
|
||||
MObject *formerOwner = relation->owner();
|
||||
QMT_CHECK(formerOwner);
|
||||
formerRow = formerOwner->relations().indexOf(relation);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit beginMoveRelation(formerRow, formerOwner);
|
||||
}
|
||||
if (m_undoController) {
|
||||
@@ -955,7 +955,7 @@ void ModelController::moveRelation(MObject *newOwner, MRelation *relation)
|
||||
formerOwner->decontrolRelation(relation);
|
||||
newOwner->addRelation(relation);
|
||||
int row = newOwner->relations().indexOf(relation);
|
||||
if (!m_resettingModel) {
|
||||
if (!m_isResettingModel) {
|
||||
emit endMoveRelation(row, newOwner);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ private:
|
||||
|
||||
QMultiHash<Uid, MRelation *> m_objectRelationsMap;
|
||||
|
||||
bool m_resettingModel;
|
||||
bool m_isResettingModel;
|
||||
|
||||
QString m_oldPackageName;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
bool isValid() const { return m_valid; }
|
||||
bool isValid() const { return m_isValid; }
|
||||
|
||||
bool atEnd() const { return m_pos == m_text.length(); }
|
||||
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
|
||||
QString m_text;
|
||||
|
||||
bool m_valid;
|
||||
bool m_isValid;
|
||||
|
||||
int m_pos;
|
||||
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
|
||||
ClassMembersEdit::Cursor::Cursor(const QString &text)
|
||||
: m_text(preparse(text)),
|
||||
m_valid(true),
|
||||
m_isValid(true),
|
||||
m_pos(0),
|
||||
m_lastPos(-1)
|
||||
{
|
||||
@@ -105,7 +105,7 @@ ClassMembersEdit::Cursor::Cursor(const QString &text)
|
||||
|
||||
void ClassMembersEdit::Cursor::setPosition(int pos)
|
||||
{
|
||||
if (m_valid) {
|
||||
if (m_isValid) {
|
||||
m_pos = pos;
|
||||
}
|
||||
}
|
||||
@@ -114,13 +114,13 @@ QString ClassMembersEdit::Cursor::readWord()
|
||||
{
|
||||
skipWhitespaces();
|
||||
QString word;
|
||||
if (m_valid && m_pos < m_text.length()) {
|
||||
if (m_isValid && m_pos < m_text.length()) {
|
||||
m_lastPos = m_pos;
|
||||
QChar c = m_text.at(m_pos);
|
||||
++m_pos;
|
||||
if (c.isLetterOrNumber() ||c == QLatin1Char('_')) {
|
||||
word = c;
|
||||
while (m_valid && m_pos < m_text.length() && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
|
||||
while (m_isValid && m_pos < m_text.length() && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
|
||||
word += m_text.at(m_pos);
|
||||
++m_pos;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ QString ClassMembersEdit::Cursor::readWord()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
}
|
||||
return word;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ QString ClassMembersEdit::Cursor::readWord()
|
||||
bool ClassMembersEdit::Cursor::skip(const QString &s)
|
||||
{
|
||||
skipWhitespaces();
|
||||
if (m_valid && m_pos + s.length() <= m_text.length() && s.compare(m_text.mid(m_pos, s.length()), s, Qt::CaseInsensitive) == 0) {
|
||||
if (m_isValid && m_pos + s.length() <= m_text.length() && s.compare(m_text.mid(m_pos, s.length()), s, Qt::CaseInsensitive) == 0) {
|
||||
m_pos += s.length();
|
||||
return true;
|
||||
}
|
||||
@@ -154,9 +154,9 @@ bool ClassMembersEdit::Cursor::skip(const QString &s)
|
||||
QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
|
||||
{
|
||||
QString s;
|
||||
while (m_valid) {
|
||||
while (m_isValid) {
|
||||
if (m_pos >= m_text.length() || m_text.at(m_pos) == QStringLiteral("\n")) {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
return s;
|
||||
}
|
||||
if (m_pos + delimiter.length() <= m_text.length() && s.compare(m_text.mid(m_pos, delimiter.length()), delimiter, Qt::CaseInsensitive) == 0) {
|
||||
@@ -171,11 +171,11 @@ QString ClassMembersEdit::Cursor::readUntil(const QString &delimiter)
|
||||
|
||||
void ClassMembersEdit::Cursor::unreadWord()
|
||||
{
|
||||
if (!m_valid) {
|
||||
if (!m_isValid) {
|
||||
return;
|
||||
}
|
||||
if (m_lastPos < 0) {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
return;
|
||||
}
|
||||
m_pos = m_lastPos;
|
||||
@@ -183,7 +183,7 @@ void ClassMembersEdit::Cursor::unreadWord()
|
||||
|
||||
void ClassMembersEdit::Cursor::skipUntilOrNewline(const QString &delimiter)
|
||||
{
|
||||
while (m_valid) {
|
||||
while (m_isValid) {
|
||||
if (m_pos >= m_text.length()) {
|
||||
return;
|
||||
}
|
||||
@@ -202,13 +202,13 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
|
||||
{
|
||||
skipWhitespacesFromRight();
|
||||
QString word;
|
||||
if (m_valid && m_pos >= 0) {
|
||||
if (m_isValid && m_pos >= 0) {
|
||||
m_lastPos = m_pos;
|
||||
QChar c = m_text.at(m_pos);
|
||||
--m_pos;
|
||||
if (c.isLetterOrNumber() || c == QLatin1Char('_')) {
|
||||
word = c;
|
||||
while (m_valid && m_pos >= 0 && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
|
||||
while (m_isValid && m_pos >= 0 && (m_text.at(m_pos).isLetterOrNumber() || m_text.at(m_pos) == QLatin1Char('_'))) {
|
||||
word = m_text.at(m_pos) + word;
|
||||
--m_pos;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
}
|
||||
return word;
|
||||
|
||||
@@ -233,7 +233,7 @@ QString ClassMembersEdit::Cursor::readWordFromRight()
|
||||
bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
|
||||
{
|
||||
skipWhitespacesFromRight();
|
||||
if (m_valid && m_pos - s.length() >= 0
|
||||
if (m_isValid && m_pos - s.length() >= 0
|
||||
&& s.compare(m_text.mid(m_pos - s.length() + 1, s.length()), s, Qt::CaseInsensitive) == 0) {
|
||||
m_pos -= s.length();
|
||||
return true;
|
||||
@@ -243,30 +243,30 @@ bool ClassMembersEdit::Cursor::skipFromRight(const QString &s)
|
||||
|
||||
QString ClassMembersEdit::Cursor::extractSubstr(int start, int stop)
|
||||
{
|
||||
if (m_valid && start >= 0 && start < m_text.length() && stop >= start && stop < m_text.length()) {
|
||||
if (m_isValid && start >= 0 && start < m_text.length() && stop >= start && stop < m_text.length()) {
|
||||
return m_text.mid(start, stop - start + 1);
|
||||
}
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
return QStringLiteral("");
|
||||
}
|
||||
|
||||
void ClassMembersEdit::Cursor::skipWhitespaces()
|
||||
{
|
||||
while (m_valid && m_pos < m_text.length() && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
|
||||
while (m_isValid && m_pos < m_text.length() && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
|
||||
++m_pos;
|
||||
}
|
||||
if (m_pos >= m_text.length()) {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
void ClassMembersEdit::Cursor::skipWhitespacesFromRight()
|
||||
{
|
||||
while (m_valid && m_pos >= 0 && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
|
||||
while (m_isValid && m_pos >= 0 && m_text.at(m_pos).isSpace() && m_text.at(m_pos) != QStringLiteral("\n")) {
|
||||
--m_pos;
|
||||
}
|
||||
if (m_pos < 0) {
|
||||
m_valid = false;
|
||||
m_isValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,11 +305,11 @@ class ClassMembersEdit::ClassMembersEditPrivate
|
||||
{
|
||||
public:
|
||||
ClassMembersEditPrivate()
|
||||
: m_valid(true)
|
||||
: m_isValid(true)
|
||||
{
|
||||
}
|
||||
|
||||
bool m_valid;
|
||||
bool m_isValid;
|
||||
QList<MClassMember> m_members;
|
||||
};
|
||||
|
||||
@@ -342,9 +342,9 @@ void ClassMembersEdit::reparse()
|
||||
{
|
||||
bool ok = false;
|
||||
QList<MClassMember> members = parse(toPlainText(), &ok);
|
||||
if (ok != d->m_valid) {
|
||||
d->m_valid = ok;
|
||||
emit statusChanged(d->m_valid);
|
||||
if (ok != d->m_isValid) {
|
||||
d->m_isValid = ok;
|
||||
emit statusChanged(d->m_isValid);
|
||||
}
|
||||
if (ok) {
|
||||
if (members != d->m_members) {
|
||||
@@ -359,9 +359,9 @@ void ClassMembersEdit::onTextChanged()
|
||||
{
|
||||
bool ok = false;
|
||||
QList<MClassMember> members = parse(toPlainText(), &ok);
|
||||
if (ok != d->m_valid) {
|
||||
d->m_valid = ok;
|
||||
emit statusChanged(d->m_valid);
|
||||
if (ok != d->m_isValid) {
|
||||
d->m_isValid = ok;
|
||||
emit statusChanged(d->m_isValid);
|
||||
}
|
||||
if (ok) {
|
||||
if (members != d->m_members) {
|
||||
|
||||
@@ -840,7 +840,7 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
}
|
||||
if (!m_autoSizedCheckbox->hasFocus()) {
|
||||
bool autoSized;
|
||||
if (haveSameValue(m_diagramElements, &DObject::hasAutoSize, &autoSized)) {
|
||||
if (haveSameValue(m_diagramElements, &DObject::isAutoSized, &autoSized)) {
|
||||
m_autoSizedCheckbox->setChecked(autoSized);
|
||||
} else {
|
||||
m_autoSizedCheckbox->setChecked(false);
|
||||
@@ -984,7 +984,7 @@ void PropertiesView::MView::visitDComponent(const DComponent *component)
|
||||
}
|
||||
if (!m_plainShapeCheckbox->hasFocus()) {
|
||||
bool plainShape;
|
||||
if (haveSameValue(m_diagramElements, &DComponent::plainShape, &plainShape)) {
|
||||
if (haveSameValue(m_diagramElements, &DComponent::isPlainShape, &plainShape)) {
|
||||
m_plainShapeCheckbox->setChecked(plainShape);
|
||||
} else {
|
||||
m_plainShapeCheckbox->setChecked(false);
|
||||
@@ -1060,7 +1060,7 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation)
|
||||
}
|
||||
if (!m_annotationAutoWidthCheckbox->hasFocus()) {
|
||||
bool autoSized;
|
||||
if (haveSameValue(m_diagramElements, &DAnnotation::hasAutoSize, &autoSized)) {
|
||||
if (haveSameValue(m_diagramElements, &DAnnotation::isAutoSized, &autoSized)) {
|
||||
m_annotationAutoWidthCheckbox->setChecked(autoSized);
|
||||
} else {
|
||||
m_annotationAutoWidthCheckbox->setChecked(false);
|
||||
@@ -1189,7 +1189,7 @@ void PropertiesView::MView::onAssociationEndBKindChanged(int kindIndex)
|
||||
|
||||
void PropertiesView::MView::onAutoSizedChanged(bool autoSized)
|
||||
{
|
||||
assignModelElement<DObject, bool>(m_diagramElements, SelectionMulti, autoSized, &DObject::hasAutoSize, &DObject::setAutoSize);
|
||||
assignModelElement<DObject, bool>(m_diagramElements, SelectionMulti, autoSized, &DObject::isAutoSized, &DObject::setAutoSized);
|
||||
}
|
||||
|
||||
void PropertiesView::MView::onVisualPrimaryRoleChanged(int visualRoleIndex)
|
||||
@@ -1228,7 +1228,7 @@ void PropertiesView::MView::onShowAllMembersChanged(bool showAllMembers)
|
||||
|
||||
void PropertiesView::MView::onPlainShapeChanged(bool plainShape)
|
||||
{
|
||||
assignModelElement<DComponent, bool>(m_diagramElements, SelectionMulti, plainShape, &DComponent::plainShape, &DComponent::setPlainShape);
|
||||
assignModelElement<DComponent, bool>(m_diagramElements, SelectionMulti, plainShape, &DComponent::isPlainShape, &DComponent::setPlainShape);
|
||||
}
|
||||
|
||||
void PropertiesView::MView::onItemShapeChanged(const QString &shape)
|
||||
@@ -1238,7 +1238,7 @@ void PropertiesView::MView::onItemShapeChanged(const QString &shape)
|
||||
|
||||
void PropertiesView::MView::onAutoWidthChanged(bool autoWidthed)
|
||||
{
|
||||
assignModelElement<DAnnotation, bool>(m_diagramElements, SelectionMulti, autoWidthed, &DAnnotation::hasAutoSize, &DAnnotation::setAutoSize);
|
||||
assignModelElement<DAnnotation, bool>(m_diagramElements, SelectionMulti, autoWidthed, &DAnnotation::isAutoSized, &DAnnotation::setAutoSized);
|
||||
}
|
||||
|
||||
void PropertiesView::MView::onAnnotationVisualRoleChanged(int visualRoleIndex)
|
||||
|
||||
@@ -126,7 +126,7 @@ inline void Access<Archive, DObject>::serialize(Archive &archive, DObject &objec
|
||||
|| attr(QStringLiteral("name"), object, &DObject::name, &DObject::setName)
|
||||
|| attr(QStringLiteral("pos"), object, &DObject::pos, &DObject::setPos)
|
||||
|| attr(QStringLiteral("rect"), object, &DObject::rect, &DObject::setRect)
|
||||
|| attr(QStringLiteral("auto-sized"), object, &DObject::hasAutoSize, &DObject::setAutoSize)
|
||||
|| attr(QStringLiteral("auto-sized"), object, &DObject::isAutoSized, &DObject::setAutoSized)
|
||||
|| attr(QStringLiteral("visual-role"), object, &visualRole, &setVisualRole)
|
||||
|| attr(QStringLiteral("visual-role2"), object, &DObject::visualSecondaryRole, &DObject::setVisualSecondaryRole)
|
||||
|| attr(QStringLiteral("visual-emphasized"), object, &DObject::isVisualEmphasized, &DObject::setVisualEmphasized)
|
||||
@@ -191,7 +191,7 @@ inline void Access<Archive, DComponent>::serialize(Archive &archive, DComponent
|
||||
{
|
||||
archive || tag(component)
|
||||
|| base<DObject>(component)
|
||||
|| attr(QStringLiteral("plain-shape"), component, &DComponent::plainShape, &DComponent::setPlainShape)
|
||||
|| attr(QStringLiteral("plain-shape"), component, &DComponent::isPlainShape, &DComponent::setPlainShape)
|
||||
|| end;
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ inline void Access<Archive, DAnnotation>::serialize(Archive &archive, DAnnotatio
|
||||
|| attr(QStringLiteral("text"), annotation, &DAnnotation::text, &DAnnotation::setText)
|
||||
|| attr(QStringLiteral("pos"), annotation, &DAnnotation::pos, &DAnnotation::setPos)
|
||||
|| attr(QStringLiteral("rect"), annotation, &DAnnotation::rect, &DAnnotation::setRect)
|
||||
|| attr(QStringLiteral("auto-sized"), annotation, &DAnnotation::hasAutoSize, &DAnnotation::setAutoSize)
|
||||
|| attr(QStringLiteral("auto-sized"), annotation, &DAnnotation::isAutoSized, &DAnnotation::setAutoSized)
|
||||
|| attr(QStringLiteral("visual-role"), annotation, &DAnnotation::visualRole, &DAnnotation::setVisualRole)
|
||||
|| end;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace qmt {
|
||||
ObjectVisuals::ObjectVisuals()
|
||||
: m_visualPrimaryRole(DObject::PrimaryRoleNormal),
|
||||
m_visualSecondaryRole(DObject::SecondaryRoleNone),
|
||||
m_emphasized(false),
|
||||
m_isEmphasized(false),
|
||||
m_depth(0)
|
||||
{
|
||||
}
|
||||
@@ -47,7 +47,7 @@ ObjectVisuals::ObjectVisuals(DObject::VisualPrimaryRole visualPrimaryRole,
|
||||
bool emphasized, const QColor &baseColor, int depth)
|
||||
: m_visualPrimaryRole(visualPrimaryRole),
|
||||
m_visualSecondaryRole(visualSecondaryRole),
|
||||
m_emphasized(emphasized),
|
||||
m_isEmphasized(emphasized),
|
||||
m_baseColor(baseColor),
|
||||
m_depth(depth)
|
||||
{
|
||||
@@ -69,7 +69,7 @@ void ObjectVisuals::setVisualSecondaryRole(DObject::VisualSecondaryRole visualSe
|
||||
|
||||
void ObjectVisuals::setEmphasized(bool emphasized)
|
||||
{
|
||||
m_emphasized = emphasized;
|
||||
m_isEmphasized = emphasized;
|
||||
}
|
||||
|
||||
void ObjectVisuals::setBaseColor(const QColor &baseColor)
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
void setVisualSecondaryRole(DObject::VisualSecondaryRole visualSecondaryRole);
|
||||
|
||||
bool isEmphasized() const { return m_emphasized; }
|
||||
bool isEmphasized() const { return m_isEmphasized; }
|
||||
|
||||
void setEmphasized(bool emphasized);
|
||||
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
|
||||
DObject::VisualSecondaryRole m_visualSecondaryRole;
|
||||
|
||||
bool m_emphasized;
|
||||
bool m_isEmphasized;
|
||||
|
||||
QColor m_baseColor;
|
||||
|
||||
|
||||
@@ -547,7 +547,7 @@ void DiagramSceneController::alignSize(DObject *object, const DSelection &select
|
||||
QRectF newRect = aligner(selectedObject, size);
|
||||
if (newRect != selectedObject->rect()) {
|
||||
m_diagramController->startUpdateElement(selectedObject, diagram, DiagramController::UpdateGeometry);
|
||||
selectedObject->setAutoSize(false);
|
||||
selectedObject->setAutoSized(false);
|
||||
selectedObject->setRect(newRect);
|
||||
m_diagramController->finishUpdateElement(selectedObject, diagram, false);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ QStringParser::Parser QStringParser::parse(const QString &pattern)
|
||||
QStringParser::Parser::Parser(const QString &source, const QString &pattern)
|
||||
: m_source(source),
|
||||
m_pattern(pattern),
|
||||
m_evaluated(false),
|
||||
m_isEvaluated(false),
|
||||
m_evaluationFailed(false)
|
||||
{
|
||||
}
|
||||
@@ -151,8 +151,8 @@ bool QStringParser::Parser::scan(double *d, int *index)
|
||||
|
||||
void QStringParser::Parser::evaluate()
|
||||
{
|
||||
if (!m_evaluated) {
|
||||
m_evaluated = true;
|
||||
if (!m_isEvaluated) {
|
||||
m_isEvaluated = true;
|
||||
m_evaluationFailed = false;
|
||||
|
||||
int p = 0;
|
||||
|
||||
@@ -143,7 +143,7 @@ private:
|
||||
|
||||
const QString m_source;
|
||||
const QString m_pattern;
|
||||
bool m_evaluated;
|
||||
bool m_isEvaluated;
|
||||
bool m_evaluationFailed;
|
||||
QList<Node *> m_nodes;
|
||||
};
|
||||
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
Node *node = m_nodeStack.pop();
|
||||
if (m_nodeStack.empty()) {
|
||||
XmlTag xmlTag = readTag();
|
||||
if (xmlTag.m_tagName != node->qualifiedName() || xmlTag.m_endTag) {
|
||||
if (xmlTag.m_tagName != node->qualifiedName() || xmlTag.m_isEndTag) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
node->accept(*this, xmlTag);
|
||||
@@ -543,7 +543,7 @@ public:
|
||||
void readReferenceEndTag(ReferenceKind kind)
|
||||
{
|
||||
XmlTag tag = readTag();
|
||||
if (!tag.m_endTag) {
|
||||
if (!tag.m_isEndTag) {
|
||||
throw FileFormatException();
|
||||
} else if (tag.m_tagName == QLatin1String("null") && kind != Nullpointer) {
|
||||
throw FileFormatException();
|
||||
@@ -573,9 +573,9 @@ private:
|
||||
class XmlTag
|
||||
{
|
||||
public:
|
||||
XmlTag() : m_endTag(false) { }
|
||||
XmlTag() : m_isEndTag(false) { }
|
||||
QString m_tagName;
|
||||
bool m_endTag;
|
||||
bool m_isEndTag;
|
||||
impl::ObjectId m_id;
|
||||
QHash<QString, QString> m_attributes;
|
||||
};
|
||||
@@ -583,7 +583,7 @@ private:
|
||||
void readChildren(Node *node) {
|
||||
for (;;) {
|
||||
XmlTag xmlTag = readTag();
|
||||
if (xmlTag.m_endTag) {
|
||||
if (xmlTag.m_isEndTag) {
|
||||
if (xmlTag.m_tagName != node->qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
@@ -627,7 +627,7 @@ private:
|
||||
{
|
||||
load(*this, node->base().base(), node->base().parameters());
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->base().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->base().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -637,7 +637,7 @@ private:
|
||||
{
|
||||
load(*this, *node->attribute().value(), node->attribute().parameters());
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -649,7 +649,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().object().*(node->attribute().setter()))(value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -661,7 +661,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().object().*(node->attribute().setter()))(value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -673,7 +673,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().object().*(node->attribute().setter()))(value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -685,7 +685,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().object().*(node->attribute().setter()))(value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -697,7 +697,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().setterFunc())(node->attribute().object(), value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -709,7 +709,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().setterFunc())(node->attribute().object(), value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -721,7 +721,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().setterFunc())(node->attribute().object(), value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -733,7 +733,7 @@ private:
|
||||
load(*this, value, node->attribute().parameters());
|
||||
(node->attribute().setterFunc())(node->attribute().object(), value);
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->attribute().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -749,7 +749,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -765,7 +765,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -781,7 +781,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -797,7 +797,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -813,7 +813,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -829,7 +829,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -845,7 +845,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -861,7 +861,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -877,7 +877,7 @@ private:
|
||||
m_currentRefNode = 0;
|
||||
}
|
||||
XmlTag xmlTag = readTag();
|
||||
if (!xmlTag.m_endTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
if (!xmlTag.m_isEndTag || xmlTag.m_tagName != node->reference().qualifiedName()) {
|
||||
throw FileFormatException();
|
||||
}
|
||||
}
|
||||
@@ -906,7 +906,7 @@ QXmlInArchive::XmlTag QXmlInArchive::readTag()
|
||||
throw FileFormatException();
|
||||
}
|
||||
xmlTag.m_tagName = m_stream.name().toString();
|
||||
xmlTag.m_endTag = true;
|
||||
xmlTag.m_isEndTag = true;
|
||||
m_endTagWasRead = false;
|
||||
return xmlTag;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ QXmlInArchive::XmlTag QXmlInArchive::readTag()
|
||||
return xmlTag;
|
||||
case QXmlStreamReader::EndElement:
|
||||
xmlTag.m_tagName = m_stream.name().toString();
|
||||
xmlTag.m_endTag = true;
|
||||
xmlTag.m_isEndTag = true;
|
||||
return xmlTag;
|
||||
case QXmlStreamReader::Comment:
|
||||
// intentionally left blank
|
||||
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
QXmlOutArchive(QXmlStreamWriter &stream)
|
||||
: m_stream(stream),
|
||||
m_nextPointerIsReference(false)
|
||||
m_isNextPointerAReference(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -230,13 +230,13 @@ public:
|
||||
void beginReference(const Ref<T> &ref)
|
||||
{
|
||||
m_stream.writeStartElement(ref.qualifiedName());
|
||||
m_nextPointerIsReference = true;
|
||||
m_isNextPointerAReference = true;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void endReference(const Ref<T> &)
|
||||
{
|
||||
m_nextPointerIsReference = false;
|
||||
m_isNextPointerAReference = false;
|
||||
m_stream.writeEndElement();
|
||||
}
|
||||
|
||||
@@ -244,13 +244,13 @@ public:
|
||||
void beginReference(const GetterRef<U, T> &ref)
|
||||
{
|
||||
m_stream.writeStartElement(ref.qualifiedName());
|
||||
m_nextPointerIsReference = true;
|
||||
m_isNextPointerAReference = true;
|
||||
}
|
||||
|
||||
template<class U, typename T>
|
||||
void endReference(const GetterRef<U, T> &)
|
||||
{
|
||||
m_nextPointerIsReference = false;
|
||||
m_isNextPointerAReference = false;
|
||||
m_stream.writeEndElement();
|
||||
}
|
||||
|
||||
@@ -258,13 +258,13 @@ public:
|
||||
void beginReference(const GetterSetterRef<U, T, V> &ref)
|
||||
{
|
||||
m_stream.writeStartElement(ref.qualifiedName());
|
||||
m_nextPointerIsReference = true;
|
||||
m_isNextPointerAReference = true;
|
||||
}
|
||||
|
||||
template<class U, typename T, typename V>
|
||||
void endReference(const GetterSetterRef<U, T, V> &)
|
||||
{
|
||||
m_nextPointerIsReference = false;
|
||||
m_isNextPointerAReference = false;
|
||||
m_stream.writeEndElement();
|
||||
}
|
||||
|
||||
@@ -272,13 +272,13 @@ public:
|
||||
void beginReference(const GetFuncRef<U, T> &ref)
|
||||
{
|
||||
m_stream.writeStartElement(ref.qualifiedName());
|
||||
m_nextPointerIsReference = true;
|
||||
m_isNextPointerAReference = true;
|
||||
}
|
||||
|
||||
template<class U, typename T>
|
||||
void endReference(const GetFuncRef<U, T> &)
|
||||
{
|
||||
m_nextPointerIsReference = false;
|
||||
m_isNextPointerAReference = false;
|
||||
m_stream.writeEndElement();
|
||||
}
|
||||
|
||||
@@ -286,20 +286,20 @@ public:
|
||||
void beginReference(const GetSetFuncRef<U, T, V> &ref)
|
||||
{
|
||||
m_stream.writeStartElement(ref.qualifiedName());
|
||||
m_nextPointerIsReference = true;
|
||||
m_isNextPointerAReference = true;
|
||||
}
|
||||
|
||||
template<class U, typename T, typename V>
|
||||
void endReference(const GetSetFuncRef<U, T, V> &)
|
||||
{
|
||||
m_nextPointerIsReference = false;
|
||||
m_isNextPointerAReference = false;
|
||||
m_stream.writeEndElement();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool isReference(T *p)
|
||||
{
|
||||
return m_nextPointerIsReference || m_savingRefMap.hasDefinedRef(p);
|
||||
return m_isNextPointerAReference || m_savingRefMap.hasDefinedRef(p);
|
||||
}
|
||||
|
||||
void beginNullPointer()
|
||||
@@ -341,7 +341,7 @@ public:
|
||||
private:
|
||||
QXmlStreamWriter &m_stream;
|
||||
impl::SavingRefMap m_savingRefMap;
|
||||
bool m_nextPointerIsReference;
|
||||
bool m_isNextPointerAReference;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user