forked from qt-creator/qt-creator
ModelEditor: Use Qt5-style connects
Change-Id: I35f284fd790713670ce31d4a802860b4d41c1ad3 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -74,8 +74,10 @@ void ConfigController::setStereotypeController(StereotypeController *stereotypeC
|
||||
void ConfigController::readStereotypeDefinitions(const QString &path)
|
||||
{
|
||||
StereotypeDefinitionParser parser;
|
||||
connect(&parser, SIGNAL(iconParsed(StereotypeIcon)), this, SLOT(onStereotypeIconParsed(StereotypeIcon)));
|
||||
connect(&parser, SIGNAL(toolbarParsed(Toolbar)), this, SLOT(onToolbarParsed(Toolbar)));
|
||||
connect(&parser, &StereotypeDefinitionParser::iconParsed,
|
||||
this, &ConfigController::onStereotypeIconParsed);
|
||||
connect(&parser, &StereotypeDefinitionParser::toolbarParsed,
|
||||
this, &ConfigController::onToolbarParsed);
|
||||
|
||||
QDir dir(path);
|
||||
dir.setNameFilters(QStringList() << QStringLiteral("*.def"));
|
||||
|
@@ -53,11 +53,10 @@ public:
|
||||
|
||||
void readStereotypeDefinitions(const QString &path);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onStereotypeIconParsed(const StereotypeIcon &stereotypeIcon);
|
||||
void onToolbarParsed(const Toolbar &toolbar);
|
||||
|
||||
private:
|
||||
ConfigControllerPrivate *d;
|
||||
};
|
||||
|
||||
|
@@ -43,7 +43,6 @@ public:
|
||||
StringTextSource();
|
||||
~StringTextSource();
|
||||
|
||||
public:
|
||||
void setText(const QString &text);
|
||||
int sourceId() const { return m_sourceId; }
|
||||
void setSourceId(int sourceId);
|
||||
|
@@ -52,12 +52,10 @@ public:
|
||||
|
||||
QUndoStack *undoStack() const { return m_undoStack; }
|
||||
|
||||
public slots:
|
||||
void push(UndoCommand *cmd);
|
||||
void beginMergeSequence(const QString &text);
|
||||
void endMergeSequence();
|
||||
|
||||
public:
|
||||
void reset();
|
||||
void doNotMerge();
|
||||
|
||||
|
@@ -350,38 +350,40 @@ void DiagramController::setModelController(ModelController *modelController)
|
||||
}
|
||||
if (modelController) {
|
||||
m_modelController = modelController;
|
||||
connect(modelController, SIGNAL(beginResetModel()), this, SLOT(onBeginResetModel()));
|
||||
connect(modelController, SIGNAL(endResetModel()), this, SLOT(onEndResetModel()));
|
||||
connect(modelController, &ModelController::beginResetModel,
|
||||
this, &DiagramController::onBeginResetModel);
|
||||
connect(modelController, &ModelController::endResetModel,
|
||||
this, &DiagramController::onEndResetModel);
|
||||
|
||||
connect(modelController, SIGNAL(beginUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(beginInsertObject(int,const MObject*)),
|
||||
this, SLOT(onBeginInsertObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endInsertObject(int,const MObject*)),
|
||||
this, SLOT(onEndInsertObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(beginRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(beginMoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveObject(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endMoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndMoveObject(int,const MObject*)));
|
||||
connect(modelController, &ModelController::beginUpdateObject,
|
||||
this, &DiagramController::onBeginUpdateObject);
|
||||
connect(modelController, &ModelController::endUpdateObject,
|
||||
this, &DiagramController::onEndUpdateObject);
|
||||
connect(modelController, &ModelController::beginInsertObject,
|
||||
this, &DiagramController::onBeginInsertObject);
|
||||
connect(modelController, &ModelController::endInsertObject,
|
||||
this, &DiagramController::onEndInsertObject);
|
||||
connect(modelController, &ModelController::beginRemoveObject,
|
||||
this, &DiagramController::onBeginRemoveObject);
|
||||
connect(modelController, &ModelController::endRemoveObject,
|
||||
this, &DiagramController::onEndRemoveObject);
|
||||
connect(modelController, &ModelController::beginMoveObject,
|
||||
this, &DiagramController::onBeginMoveObject);
|
||||
connect(modelController, &ModelController::endMoveObject,
|
||||
this, &DiagramController::onEndMoveObject);
|
||||
|
||||
connect(modelController, SIGNAL(beginUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateRelation(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateRelation(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(beginRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveRelation(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveRelation(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(beginMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveRelation(int,const MObject*)));
|
||||
connect(modelController, SIGNAL(endMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndMoveRelation(int,const MObject*)));
|
||||
connect(modelController, &ModelController::beginUpdateRelation,
|
||||
this, &DiagramController::onBeginUpdateRelation);
|
||||
connect(modelController, &ModelController::endUpdateRelation,
|
||||
this, &DiagramController::onEndUpdateRelation);
|
||||
connect(modelController, &ModelController::beginRemoveRelation,
|
||||
this, &DiagramController::onBeginRemoveRelation);
|
||||
connect(modelController, &ModelController::endRemoveRelation,
|
||||
this, &DiagramController::onEndRemoveRelation);
|
||||
connect(modelController, &ModelController::beginMoveRelation,
|
||||
this, &DiagramController::onBeginMoveRelation);
|
||||
connect(modelController, &ModelController::endMoveRelation,
|
||||
this, &DiagramController::onEndMoveRelation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -128,7 +128,7 @@ public:
|
||||
void pasteElements(const DContainer &diagramContainer, MDiagram *diagram);
|
||||
void deleteElements(const DSelection &diagramSelection, MDiagram *diagram);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onBeginResetModel();
|
||||
void onEndResetModel();
|
||||
void onBeginUpdateObject(int row, const MObject *parent);
|
||||
@@ -146,7 +146,6 @@ private slots:
|
||||
void onBeginMoveRelation(int formerRow, const MObject *formerOwner);
|
||||
void onEndMoveRelation(int row, const MObject *owner);
|
||||
|
||||
private:
|
||||
void deleteElements(const DSelection &diagramSelection, MDiagram *diagram,
|
||||
const QString &commandLabel);
|
||||
|
||||
|
@@ -108,7 +108,8 @@ DiagramSceneModel::DiagramSceneModel(QObject *parent)
|
||||
m_focusItem(0)
|
||||
{
|
||||
m_latchController->setDiagramSceneModel(this);
|
||||
connect(m_graphicsScene, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
|
||||
connect(m_graphicsScene, &QGraphicsScene::selectionChanged,
|
||||
this, &DiagramSceneModel::onSelectionChanged);
|
||||
|
||||
// add one item at origin to force scene rect to include origin always
|
||||
m_graphicsScene->addItem(m_originItem);
|
||||
@@ -137,24 +138,26 @@ void DiagramSceneModel::setDiagramController(DiagramController *diagramControlle
|
||||
}
|
||||
m_diagramController = diagramController;
|
||||
if (diagramController) {
|
||||
connect(m_diagramController, SIGNAL(beginResetAllDiagrams()), this, SLOT(onBeginResetAllDiagrams()));
|
||||
connect(m_diagramController, SIGNAL(endResetAllDiagrams()), this, SLOT(onEndResetAllDiagrams()));
|
||||
connect(m_diagramController, SIGNAL(beginResetDiagram(const MDiagram*)),
|
||||
this, SLOT(onBeginResetDiagram(const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endResetDiagram(const MDiagram*)),
|
||||
this, SLOT(onEndResetDiagram(const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(beginUpdateElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginUpdateElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endUpdateElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndUpdateElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(beginInsertElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginInsertElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endInsertElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndInsertElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(beginRemoveElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginRemoveElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endRemoveElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndRemoveElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, &DiagramController::beginResetAllDiagrams,
|
||||
this, &DiagramSceneModel::onBeginResetAllDiagrams);
|
||||
connect(m_diagramController, &DiagramController::endResetAllDiagrams,
|
||||
this, &DiagramSceneModel::onEndResetAllDiagrams);
|
||||
connect(m_diagramController, &DiagramController::beginResetDiagram,
|
||||
this, &DiagramSceneModel::onBeginResetDiagram);
|
||||
connect(m_diagramController, &DiagramController::endResetDiagram,
|
||||
this, &DiagramSceneModel::onEndResetDiagram);
|
||||
connect(m_diagramController, &DiagramController::beginUpdateElement,
|
||||
this, &DiagramSceneModel::onBeginUpdateElement);
|
||||
connect(m_diagramController, &DiagramController::endUpdateElement,
|
||||
this, &DiagramSceneModel::onEndUpdateElement);
|
||||
connect(m_diagramController, &DiagramController::beginInsertElement,
|
||||
this, &DiagramSceneModel::onBeginInsertElement);
|
||||
connect(m_diagramController, &DiagramController::endInsertElement,
|
||||
this, &DiagramSceneModel::onEndInsertElement);
|
||||
connect(m_diagramController, &DiagramController::beginRemoveElement,
|
||||
this, &DiagramSceneModel::onBeginRemoveElement);
|
||||
connect(m_diagramController, &DiagramController::endRemoveElement,
|
||||
this, &DiagramSceneModel::onEndRemoveElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -135,7 +135,6 @@ private:
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||
void mouseReleaseEventReparenting(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
private slots:
|
||||
void onBeginResetAllDiagrams();
|
||||
void onEndResetAllDiagrams();
|
||||
void onBeginResetDiagram(const MDiagram *diagram);
|
||||
@@ -149,7 +148,6 @@ private slots:
|
||||
|
||||
void onSelectionChanged();
|
||||
|
||||
private:
|
||||
void clearGraphicsScene();
|
||||
void removeExtraSceneItems();
|
||||
void addExtraSceneItems();
|
||||
|
@@ -98,10 +98,9 @@ protected:
|
||||
|
||||
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onContentsChanged();
|
||||
|
||||
private:
|
||||
QSizeF calcMinimumGeometry() const;
|
||||
void updateGeometry();
|
||||
|
||||
|
@@ -96,10 +96,9 @@ protected:
|
||||
const Style *adaptedStyle();
|
||||
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onContentsChanged();
|
||||
|
||||
private:
|
||||
QSizeF calcMinimumGeometry() const;
|
||||
void updateGeometry();
|
||||
|
||||
|
@@ -88,9 +88,10 @@ void DiagramsManager::setModel(TreeModel *model)
|
||||
if (m_model)
|
||||
connect(m_model, 0, this, 0);
|
||||
m_model = model;
|
||||
if (model)
|
||||
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(onDataChanged(QModelIndex,QModelIndex)));
|
||||
if (model) {
|
||||
connect(model, &QAbstractItemModel::dataChanged,
|
||||
this, &DiagramsManager::onDataChanged);
|
||||
}
|
||||
}
|
||||
|
||||
void DiagramsManager::setDiagramsView(DiagramsViewInterface *diagramsView)
|
||||
@@ -103,9 +104,10 @@ void DiagramsManager::setDiagramController(DiagramController *diagramController)
|
||||
if (m_diagramController)
|
||||
connect(m_diagramController, 0, this, 0);
|
||||
m_diagramController = diagramController;
|
||||
if (diagramController)
|
||||
connect(diagramController, SIGNAL(diagramAboutToBeRemoved(const MDiagram*)),
|
||||
this, SLOT(removeDiagram(const MDiagram*)));
|
||||
if (diagramController) {
|
||||
connect(diagramController, &DiagramController::diagramAboutToBeRemoved,
|
||||
this, &DiagramsManager::removeDiagram);
|
||||
}
|
||||
}
|
||||
|
||||
void DiagramsManager::setDiagramSceneController(DiagramSceneController *diagramSceneController)
|
||||
@@ -132,10 +134,10 @@ DiagramSceneModel *DiagramsManager::bindDiagramSceneModel(MDiagram *diagram)
|
||||
diagramSceneModel->setStyleController(m_styleController);
|
||||
diagramSceneModel->setStereotypeController(m_stereotypeController);
|
||||
diagramSceneModel->setDiagram(diagram);
|
||||
connect(diagramSceneModel, SIGNAL(diagramSceneActivated(const MDiagram*)),
|
||||
this, SIGNAL(diagramActivated(const MDiagram*)));
|
||||
connect(diagramSceneModel, SIGNAL(selectionHasChanged(const MDiagram*)),
|
||||
this, SIGNAL(diagramSelectionChanged(const MDiagram*)));
|
||||
connect(diagramSceneModel, &DiagramSceneModel::diagramSceneActivated,
|
||||
this, &DiagramsManager::diagramActivated);
|
||||
connect(diagramSceneModel, &DiagramSceneModel::selectionHasChanged,
|
||||
this, &DiagramsManager::diagramSelectionChanged);
|
||||
ManagedDiagram *managedDiagram = new ManagedDiagram(diagramSceneModel, diagram->name());
|
||||
m_diagramUidToManagedDiagramMap.insert(diagram->uid(), managedDiagram);
|
||||
}
|
||||
|
@@ -82,15 +82,13 @@ public:
|
||||
DiagramSceneModel *diagramSceneModel(const MDiagram *diagram) const;
|
||||
void unbindDiagramSceneModel(const MDiagram *diagram);
|
||||
|
||||
public slots:
|
||||
void openDiagram(MDiagram *diagram);
|
||||
void removeDiagram(const MDiagram *diagram);
|
||||
void removeAllDiagrams();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright);
|
||||
|
||||
private:
|
||||
QPointer<TreeModel> m_model;
|
||||
DiagramsViewInterface *m_diagramsView;
|
||||
DiagramController *m_diagramController;
|
||||
|
@@ -48,8 +48,8 @@ DiagramsView::DiagramsView(QWidget *parent)
|
||||
setTabsClosable(true);
|
||||
setMovable(true);
|
||||
setDocumentMode(false);
|
||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(onCurrentChanged(int)));
|
||||
connect(this, SIGNAL(tabCloseRequested(int)), this, SLOT(onTabCloseRequested(int)));
|
||||
connect(this, &QTabWidget::currentChanged, this, &DiagramsView::onCurrentChanged);
|
||||
connect(this, &QTabWidget::tabCloseRequested, this, &DiagramsView::onTabCloseRequested);
|
||||
}
|
||||
|
||||
DiagramsView::~DiagramsView()
|
||||
|
@@ -63,17 +63,15 @@ signals:
|
||||
public:
|
||||
void setDiagramsManager(DiagramsManager *diagramsManager);
|
||||
|
||||
public slots:
|
||||
void openDiagram(MDiagram *diagram);
|
||||
void closeDiagram(const MDiagram *diagram);
|
||||
void closeAllDiagrams();
|
||||
void onDiagramRenamed(const MDiagram *diagram);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onCurrentChanged(int tabIndex);
|
||||
void onTabCloseRequested(int tabIndex);
|
||||
|
||||
private:
|
||||
MDiagram *diagram(int tabIndex) const;
|
||||
MDiagram *diagram(DiagramView * diagramView) const;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ StackedDiagramsView::StackedDiagramsView(QWidget *parent)
|
||||
: QStackedWidget(parent),
|
||||
m_diagramsManager(0)
|
||||
{
|
||||
connect(this, SIGNAL(currentChanged(int)), this, SLOT(onCurrentChanged(int)));
|
||||
connect(this, &QStackedWidget::currentChanged, this, &StackedDiagramsView::onCurrentChanged);
|
||||
}
|
||||
|
||||
StackedDiagramsView::~StackedDiagramsView()
|
||||
|
@@ -62,16 +62,14 @@ signals:
|
||||
public:
|
||||
void setDiagramsManager(DiagramsManager *diagramsManager);
|
||||
|
||||
public slots:
|
||||
void openDiagram(MDiagram *diagram);
|
||||
void closeDiagram(const MDiagram *diagram);
|
||||
void closeAllDiagrams();
|
||||
void onDiagramRenamed(const MDiagram *diagram);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onCurrentChanged(int tabIndex);
|
||||
|
||||
private:
|
||||
MDiagram *diagram(int tabIndex) const;
|
||||
MDiagram *diagram(DiagramView * diagramView) const;
|
||||
|
||||
|
@@ -80,16 +80,18 @@ DocumentController::DocumentController(QObject *parent) :
|
||||
m_diagramClipboard(new DContainer())
|
||||
{
|
||||
// project controller
|
||||
QObject::connect(m_projectController, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
connect(m_projectController, &ProjectController::changed, this, &DocumentController::changed);
|
||||
|
||||
// model controller
|
||||
m_modelController->setUndoController(m_undoController);
|
||||
QObject::connect(m_modelController, SIGNAL(modified()), m_projectController, SLOT(setModified()));
|
||||
connect(m_modelController, &ModelController::modified,
|
||||
m_projectController, &ProjectController::setModified);
|
||||
|
||||
// diagram controller
|
||||
m_diagramController->setModelController(m_modelController);
|
||||
m_diagramController->setUndoController(m_undoController);
|
||||
QObject::connect(m_diagramController, SIGNAL(modified(const MDiagram*)), m_projectController, SLOT(setModified()));
|
||||
connect(m_diagramController, &DiagramController::modified,
|
||||
m_projectController, &ProjectController::setModified);
|
||||
|
||||
// diagram scene controller
|
||||
m_diagramSceneController->setModelController(m_modelController);
|
||||
|
@@ -41,12 +41,12 @@ SortedTreeModel::SortedTreeModel(QObject *parent)
|
||||
setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
m_delayedSortTimer.setSingleShot(true);
|
||||
connect(&m_delayedSortTimer, SIGNAL(timeout()), this, SLOT(onDelayedSortTimeout()));
|
||||
connect(&m_delayedSortTimer, &QTimer::timeout, this, &SortedTreeModel::onDelayedSortTimeout);
|
||||
|
||||
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||
this, SLOT(onTreeModelRowsInserted(QModelIndex,int,int)));
|
||||
connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
|
||||
this, SLOT(onDataChanged(QModelIndex,QModelIndex,QVector<int>)));
|
||||
connect(this, &QAbstractItemModel::rowsInserted,
|
||||
this, &SortedTreeModel::onTreeModelRowsInserted);
|
||||
connect(this, &QAbstractItemModel::dataChanged,
|
||||
this, &SortedTreeModel::onDataChanged);
|
||||
}
|
||||
|
||||
SortedTreeModel::~SortedTreeModel()
|
||||
|
@@ -54,12 +54,11 @@ public:
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onTreeModelRowsInserted(const QModelIndex &parent, int start, int end);
|
||||
void onDataChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &);
|
||||
void onDelayedSortTimeout();
|
||||
|
||||
private:
|
||||
void startDelayedSortTimer();
|
||||
|
||||
TreeModel *m_treeModel;
|
||||
|
@@ -321,8 +321,8 @@ TreeModel::TreeModel(QObject *parent)
|
||||
m_rootItem(0),
|
||||
m_busyState(NotBusy)
|
||||
{
|
||||
connect(this, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(onModelDataChanged(QModelIndex,QModelIndex)));
|
||||
connect(this, &QAbstractItemModel::dataChanged,
|
||||
this, &TreeModel::onModelDataChanged);
|
||||
}
|
||||
|
||||
TreeModel::~TreeModel()
|
||||
@@ -339,45 +339,47 @@ void TreeModel::setModelController(ModelController *modelController)
|
||||
disconnect(m_modelController, 0, this, 0);
|
||||
m_modelController = modelController;
|
||||
if (m_modelController) {
|
||||
connect(m_modelController, SIGNAL(beginResetModel()), this, SLOT(onBeginResetModel()));
|
||||
connect(m_modelController, SIGNAL(endResetModel()), this, SLOT(onEndResetModel()));
|
||||
connect(m_modelController, &ModelController::beginResetModel,
|
||||
this, &TreeModel::onBeginResetModel);
|
||||
connect(m_modelController, &ModelController::endResetModel,
|
||||
this, &TreeModel::onEndResetModel);
|
||||
|
||||
connect(m_modelController, SIGNAL(beginInsertObject(int,const MObject*)),
|
||||
this, SLOT(onBeginInsertObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endInsertObject(int,const MObject*)),
|
||||
this, SLOT(onEndInsertObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginMoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endMoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndMoveObject(int,const MObject*)));
|
||||
connect(m_modelController, &ModelController::beginInsertObject,
|
||||
this, &TreeModel::onBeginInsertObject);
|
||||
connect(m_modelController, &ModelController::endInsertObject,
|
||||
this, &TreeModel::onEndInsertObject);
|
||||
connect(m_modelController, &ModelController::beginUpdateObject,
|
||||
this, &TreeModel::onBeginUpdateObject);
|
||||
connect(m_modelController, &ModelController::endUpdateObject,
|
||||
this, &TreeModel::onEndUpdateObject);
|
||||
connect(m_modelController, &ModelController::beginRemoveObject,
|
||||
this, &TreeModel::onBeginRemoveObject);
|
||||
connect(m_modelController, &ModelController::endRemoveObject,
|
||||
this, &TreeModel::onEndRemoveObject);
|
||||
connect(m_modelController, &ModelController::beginMoveObject,
|
||||
this, &TreeModel::onBeginMoveObject);
|
||||
connect(m_modelController, &ModelController::endMoveObject,
|
||||
this, &TreeModel::onEndMoveObject);
|
||||
|
||||
connect(m_modelController, SIGNAL(beginInsertRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginInsertRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endInsertRelation(int,const MObject*)),
|
||||
this, SLOT(onEndInsertRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndMoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, &ModelController::beginInsertRelation,
|
||||
this, &TreeModel::onBeginInsertRelation);
|
||||
connect(m_modelController, &ModelController::endInsertRelation,
|
||||
this, &TreeModel::onEndInsertRelation);
|
||||
connect(m_modelController, &ModelController::beginUpdateRelation,
|
||||
this, &TreeModel::onBeginUpdateRelation);
|
||||
connect(m_modelController, &ModelController::endUpdateRelation,
|
||||
this, &TreeModel::onEndUpdateRelation);
|
||||
connect(m_modelController, &ModelController::beginRemoveRelation,
|
||||
this, &TreeModel::onBeginRemoveRelation);
|
||||
connect(m_modelController, &ModelController::endRemoveRelation,
|
||||
this, &TreeModel::onEndRemoveRelation);
|
||||
connect(m_modelController, &ModelController::beginMoveRelation,
|
||||
this, &TreeModel::onBeginMoveRelation);
|
||||
connect(m_modelController, &ModelController::endMoveRelation,
|
||||
this, &TreeModel::onEndMoveRelation);
|
||||
|
||||
connect(m_modelController, SIGNAL(relationEndChanged(MRelation*,MObject*)),
|
||||
this, SLOT(onRelationEndChanged(MRelation*,MObject*)));
|
||||
connect(m_modelController, &ModelController::relationEndChanged,
|
||||
this, &TreeModel::onRelationEndChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
QStringList mimeTypes() const;
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onBeginResetModel();
|
||||
void onEndResetModel();
|
||||
void onBeginUpdateObject(int row, const MObject *parent);
|
||||
@@ -113,7 +113,6 @@ private slots:
|
||||
void onRelationEndChanged(MRelation *relation, MObject *endObject);
|
||||
void onModelDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright);
|
||||
|
||||
private:
|
||||
void clear();
|
||||
ModelItem *createItem(const MElement *element);
|
||||
void createChildren(const MObject *parentObject, ModelItem *parentItem);
|
||||
|
@@ -289,7 +289,7 @@ ClassMembersEdit::ClassMembersEdit(QWidget *parent)
|
||||
d(new ClassMembersEditPrivate)
|
||||
{
|
||||
setTabChangesFocus(true);
|
||||
connect(this, SIGNAL(textChanged()), this, SLOT(onTextChanged()));
|
||||
connect(this, &QPlainTextEdit::textChanged, this, &ClassMembersEdit::onTextChanged);
|
||||
}
|
||||
|
||||
ClassMembersEdit::~ClassMembersEdit()
|
||||
|
@@ -56,13 +56,11 @@ public:
|
||||
QList<MClassMember> members() const;
|
||||
void setMembers(const QList<MClassMember> &members);
|
||||
|
||||
public slots:
|
||||
void reparse();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onTextChanged();
|
||||
|
||||
private:
|
||||
QString build(const QList<MClassMember> &members);
|
||||
QList<MClassMember> parse(const QString &text, bool *ok);
|
||||
|
||||
|
@@ -57,7 +57,6 @@ public:
|
||||
void setLinePen(int index, const QPen &pen);
|
||||
int currentIndex() const { return m_currentIndex; }
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void setCurrentIndex(int index);
|
||||
|
||||
|
@@ -64,45 +64,47 @@ void PropertiesView::setModelController(ModelController *modelController)
|
||||
disconnect(m_modelController, 0, this, 0);
|
||||
m_modelController = modelController;
|
||||
if (m_modelController) {
|
||||
connect(m_modelController, SIGNAL(beginResetModel()), this, SLOT(onBeginResetModel()));
|
||||
connect(m_modelController, SIGNAL(endResetModel()), this, SLOT(onEndResetModel()));
|
||||
connect(m_modelController, &ModelController::beginResetModel,
|
||||
this, &PropertiesView::onBeginResetModel);
|
||||
connect(m_modelController, &ModelController::endResetModel,
|
||||
this, &PropertiesView::onEndResetModel);
|
||||
|
||||
connect(m_modelController, SIGNAL(beginInsertObject(int,const MObject*)),
|
||||
this, SLOT(onBeginInsertObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endInsertObject(int,const MObject*)),
|
||||
this, SLOT(onEndInsertObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endUpdateObject(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endRemoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginMoveObject(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveObject(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endMoveObject(int,const MObject*)),
|
||||
this, SLOT(onEndMoveObject(int,const MObject*)));
|
||||
connect(m_modelController, &ModelController::beginInsertObject,
|
||||
this, &PropertiesView::onBeginInsertObject);
|
||||
connect(m_modelController, &ModelController::endInsertObject,
|
||||
this, &PropertiesView::onEndInsertObject);
|
||||
connect(m_modelController, &ModelController::beginUpdateObject,
|
||||
this, &PropertiesView::onBeginUpdateObject);
|
||||
connect(m_modelController, &ModelController::endUpdateObject,
|
||||
this, &PropertiesView::onEndUpdateObject);
|
||||
connect(m_modelController, &ModelController::beginRemoveObject,
|
||||
this, &PropertiesView::onBeginRemoveObject);
|
||||
connect(m_modelController, &ModelController::endRemoveObject,
|
||||
this, &PropertiesView::onEndRemoveObject);
|
||||
connect(m_modelController, &ModelController::beginMoveObject,
|
||||
this, &PropertiesView::onBeginMoveObject);
|
||||
connect(m_modelController, &ModelController::endMoveObject,
|
||||
this, &PropertiesView::onEndMoveObject);
|
||||
|
||||
connect(m_modelController, SIGNAL(beginInsertRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginInsertRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endInsertRelation(int,const MObject*)),
|
||||
this, SLOT(onEndInsertRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginUpdateRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endUpdateRelation(int,const MObject*)),
|
||||
this, SLOT(onEndUpdateRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginRemoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endRemoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndRemoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(beginMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onBeginMoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, SIGNAL(endMoveRelation(int,const MObject*)),
|
||||
this, SLOT(onEndMoveRelation(int,const MObject*)));
|
||||
connect(m_modelController, &ModelController::beginInsertRelation,
|
||||
this, &PropertiesView::onBeginInsertRelation);
|
||||
connect(m_modelController, &ModelController::endInsertRelation,
|
||||
this, &PropertiesView::onEndInsertRelation);
|
||||
connect(m_modelController, &ModelController::beginUpdateRelation,
|
||||
this, &PropertiesView::onBeginUpdateRelation);
|
||||
connect(m_modelController, &ModelController::endUpdateRelation,
|
||||
this, &PropertiesView::onEndUpdateRelation);
|
||||
connect(m_modelController, &ModelController::beginRemoveRelation,
|
||||
this, &PropertiesView::onBeginRemoveRelation);
|
||||
connect(m_modelController, &ModelController::endRemoveRelation,
|
||||
this, &PropertiesView::onEndRemoveRelation);
|
||||
connect(m_modelController, &ModelController::beginMoveRelation,
|
||||
this, &PropertiesView::onBeginMoveRelation);
|
||||
connect(m_modelController, &ModelController::endMoveRelation,
|
||||
this, &PropertiesView::onEndMoveRelation);
|
||||
|
||||
connect(m_modelController, SIGNAL(relationEndChanged(MRelation*,MObject*)),
|
||||
this, SLOT(onRelationEndChanged(MRelation*,MObject*)));
|
||||
connect(m_modelController, &ModelController::relationEndChanged,
|
||||
this, &PropertiesView::onRelationEndChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -116,26 +118,28 @@ void PropertiesView::setDiagramController(DiagramController *diagramController)
|
||||
}
|
||||
m_diagramController = diagramController;
|
||||
if (diagramController) {
|
||||
connect(m_diagramController, SIGNAL(beginResetAllDiagrams()), this, SLOT(onBeginResetAllDiagrams()));
|
||||
connect(m_diagramController, SIGNAL(endResetAllDiagrams()), this, SLOT(onEndResetAllDiagrams()));
|
||||
connect(m_diagramController, &DiagramController::beginResetAllDiagrams,
|
||||
this, &PropertiesView::onBeginResetAllDiagrams);
|
||||
connect(m_diagramController, &DiagramController::endResetAllDiagrams,
|
||||
this, &PropertiesView::onEndResetAllDiagrams);
|
||||
|
||||
connect(m_diagramController, SIGNAL(beginResetDiagram(const MDiagram*)),
|
||||
this, SLOT(onBeginResetDiagram(const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endResetDiagram(const MDiagram*)),
|
||||
this, SLOT(onEndResetDiagram(const MDiagram*)));
|
||||
connect(m_diagramController, &DiagramController::beginResetDiagram,
|
||||
this, &PropertiesView::onBeginResetDiagram);
|
||||
connect(m_diagramController, &DiagramController::endResetDiagram,
|
||||
this, &PropertiesView::onEndResetDiagram);
|
||||
|
||||
connect(m_diagramController, SIGNAL(beginUpdateElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginUpdateElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endUpdateElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndUpdateElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(beginInsertElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginInsertElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endInsertElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndInsertElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(beginRemoveElement(int,const MDiagram*)),
|
||||
this, SLOT(onBeginRemoveElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, SIGNAL(endRemoveElement(int,const MDiagram*)),
|
||||
this, SLOT(onEndRemoveElement(int,const MDiagram*)));
|
||||
connect(m_diagramController, &DiagramController::beginUpdateElement,
|
||||
this, &PropertiesView::onBeginUpdateElement);
|
||||
connect(m_diagramController, &DiagramController::endUpdateElement,
|
||||
this, &PropertiesView::onEndUpdateElement);
|
||||
connect(m_diagramController, &DiagramController::beginInsertElement,
|
||||
this, &PropertiesView::onBeginInsertElement);
|
||||
connect(m_diagramController, &DiagramController::endInsertElement,
|
||||
this, &PropertiesView::onEndInsertElement);
|
||||
connect(m_diagramController, &DiagramController::beginRemoveElement,
|
||||
this, &PropertiesView::onBeginRemoveElement);
|
||||
connect(m_diagramController, &DiagramController::endRemoveElement,
|
||||
this, &PropertiesView::onEndRemoveElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -80,10 +80,9 @@ public:
|
||||
|
||||
QWidget *widget() const;
|
||||
|
||||
public slots:
|
||||
void editSelectedElement();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onBeginResetModel();
|
||||
void onEndResetModel();
|
||||
void onBeginUpdateObject(int row, const MObject *parent);
|
||||
@@ -115,7 +114,6 @@ private slots:
|
||||
void onBeginRemoveElement(int row, const MDiagram *diagram);
|
||||
void onEndRemoveElement(int row, const MDiagram *diagram);
|
||||
|
||||
private:
|
||||
void beginUpdate(MElement *modelElement);
|
||||
void endUpdate(MElement *modelElement, bool cancelled);
|
||||
void beginUpdate(DElement *diagramElement);
|
||||
|
@@ -390,9 +390,10 @@ void PropertiesView::MView::visitMElement(const MElement *element)
|
||||
m_stereotypeComboBox->setInsertPolicy(QComboBox::NoInsert);
|
||||
m_topLayout->addRow(tr("Stereotypes:"), m_stereotypeComboBox);
|
||||
m_stereotypeComboBox->addItems(m_propertiesView->stereotypeController()->knownStereotypes(m_stereotypeElement));
|
||||
connect(m_stereotypeComboBox->lineEdit(), SIGNAL(textEdited(QString)),
|
||||
this, SLOT(onStereotypesChanged(QString)));
|
||||
connect(m_stereotypeComboBox, SIGNAL(activated(QString)), this, SLOT(onStereotypesChanged(QString)));
|
||||
connect(m_stereotypeComboBox->lineEdit(), &QLineEdit::textEdited,
|
||||
this, &PropertiesView::MView::onStereotypesChanged);
|
||||
connect(m_stereotypeComboBox, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onStereotypesChanged);
|
||||
}
|
||||
if (!m_stereotypeComboBox->hasFocus()) {
|
||||
QList<QString> stereotypeList;
|
||||
@@ -424,7 +425,8 @@ void PropertiesView::MView::visitMObject(const MObject *object)
|
||||
if (m_elementNameLineEdit == 0) {
|
||||
m_elementNameLineEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Name:"), m_elementNameLineEdit);
|
||||
connect(m_elementNameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onObjectNameChanged(QString)));
|
||||
connect(m_elementNameLineEdit, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onObjectNameChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (object->name() != m_elementNameLineEdit->text() && !m_elementNameLineEdit->hasFocus())
|
||||
@@ -467,7 +469,8 @@ void PropertiesView::MView::visitMClass(const MClass *klass)
|
||||
if (m_namespaceLineEdit == 0) {
|
||||
m_namespaceLineEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Namespace:"), m_namespaceLineEdit);
|
||||
connect(m_namespaceLineEdit, SIGNAL(textEdited(QString)), this, SLOT(onNamespaceChanged(QString)));
|
||||
connect(m_namespaceLineEdit, &QLineEdit::textEdited,
|
||||
this, &PropertiesView::MView::onNamespaceChanged);
|
||||
}
|
||||
if (!m_namespaceLineEdit->hasFocus()) {
|
||||
QString umlNamespace;
|
||||
@@ -483,8 +486,8 @@ void PropertiesView::MView::visitMClass(const MClass *klass)
|
||||
if (m_templateParametersLineEdit == 0) {
|
||||
m_templateParametersLineEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Template:"), m_templateParametersLineEdit);
|
||||
connect(m_templateParametersLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(onTemplateParametersChanged(QString)));
|
||||
connect(m_templateParametersLineEdit, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onTemplateParametersChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (!m_templateParametersLineEdit->hasFocus()) {
|
||||
@@ -507,7 +510,8 @@ void PropertiesView::MView::visitMClass(const MClass *klass)
|
||||
layout->setStretch(0, 1);
|
||||
layout->setStretch(1, 0);
|
||||
m_topLayout->addRow(QStringLiteral(""), layout);
|
||||
connect(m_classMembersParseButton, SIGNAL(clicked()), this, SLOT(onParseClassMembers()));
|
||||
connect(m_classMembersParseButton, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onParseClassMembers);
|
||||
}
|
||||
if (m_classMembersParseButton->isEnabled() != isSingleSelection)
|
||||
m_classMembersParseButton->setEnabled(isSingleSelection);
|
||||
@@ -515,9 +519,10 @@ void PropertiesView::MView::visitMClass(const MClass *klass)
|
||||
m_classMembersEdit = new ClassMembersEdit(m_topWidget);
|
||||
m_classMembersEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||
m_topLayout->addRow(tr("Members:"), m_classMembersEdit);
|
||||
connect(m_classMembersEdit, SIGNAL(membersChanged(QList<MClassMember>&)),
|
||||
this, SLOT(onClassMembersChanged(QList<MClassMember>&)));
|
||||
connect(m_classMembersEdit, SIGNAL(statusChanged(bool)), this, SLOT(onClassMembersStatusChanged(bool)));
|
||||
connect(m_classMembersEdit, &ClassMembersEdit::membersChanged,
|
||||
this, &PropertiesView::MView::onClassMembersChanged);
|
||||
connect(m_classMembersEdit, &ClassMembersEdit::statusChanged,
|
||||
this, &PropertiesView::MView::onClassMembersStatusChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (klass->members() != m_classMembersEdit->members() && !m_classMembersEdit->hasFocus())
|
||||
@@ -564,7 +569,8 @@ void PropertiesView::MView::visitMItem(const MItem *item)
|
||||
if (m_itemVarietyEdit == 0) {
|
||||
m_itemVarietyEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Variety:"), m_itemVarietyEdit);
|
||||
connect(m_itemVarietyEdit, SIGNAL(textChanged(QString)), this, SLOT(onItemVarietyChanged(QString)));
|
||||
connect(m_itemVarietyEdit, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onItemVarietyChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (item->variety() != m_itemVarietyEdit->text() && !m_itemVarietyEdit->hasFocus())
|
||||
@@ -585,7 +591,8 @@ void PropertiesView::MView::visitMRelation(const MRelation *relation)
|
||||
if (m_elementNameLineEdit == 0) {
|
||||
m_elementNameLineEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Name:"), m_elementNameLineEdit);
|
||||
connect(m_elementNameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onRelationNameChanged(QString)));
|
||||
connect(m_elementNameLineEdit, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onRelationNameChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (relation->name() != m_elementNameLineEdit->text() && !m_elementNameLineEdit->hasFocus())
|
||||
@@ -614,7 +621,8 @@ void PropertiesView::MView::visitMDependency(const MDependency *dependency)
|
||||
m_directionSelector->addItems(QStringList()
|
||||
<< QStringLiteral("->") << QStringLiteral("<-") << QStringLiteral("<->"));
|
||||
m_topLayout->addRow(tr("Direction:"), m_directionSelector);
|
||||
connect(m_directionSelector, SIGNAL(activated(int)), this, SLOT(onDependencyDirectionChanged(int)));
|
||||
connect(m_directionSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onDependencyDirectionChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if ((!isValidDirectionIndex(m_directionSelector->currentIndex())
|
||||
@@ -653,7 +661,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endAEndName == 0) {
|
||||
m_endAEndName = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Role:"), m_endAEndName);
|
||||
connect(m_endAEndName, SIGNAL(textChanged(QString)), this, SLOT(onAssociationEndANameChanged(QString)));
|
||||
connect(m_endAEndName, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onAssociationEndANameChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endA().name() != m_endAEndName->text() && !m_endAEndName->hasFocus())
|
||||
@@ -666,8 +675,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endACardinality == 0) {
|
||||
m_endACardinality = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Cardinality:"), m_endACardinality);
|
||||
connect(m_endACardinality, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(onAssociationEndACardinalityChanged(QString)));
|
||||
connect(m_endACardinality, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onAssociationEndACardinalityChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endA().cardinality() != m_endACardinality->text() && !m_endACardinality->hasFocus())
|
||||
@@ -680,7 +689,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endANavigable == 0) {
|
||||
m_endANavigable = new QCheckBox(tr("Navigable"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_endANavigable);
|
||||
connect(m_endANavigable, SIGNAL(clicked(bool)), this, SLOT(onAssociationEndANavigableChanged(bool)));
|
||||
connect(m_endANavigable, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onAssociationEndANavigableChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endA().isNavigable() != m_endANavigable->isChecked())
|
||||
@@ -694,7 +704,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
m_endAKind = new QComboBox(m_topWidget);
|
||||
m_endAKind->addItems(QStringList() << tr("Association") << tr("Aggregation") << tr("Composition"));
|
||||
m_topLayout->addRow(tr("Relationship:"), m_endAKind);
|
||||
connect(m_endAKind, SIGNAL(activated(int)), this, SLOT(onAssociationEndAKindChanged(int)));
|
||||
connect(m_endAKind, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onAssociationEndAKindChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if ((!isValidAssociationKindIndex(m_endAKind->currentIndex())
|
||||
@@ -715,7 +726,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endBEndName == 0) {
|
||||
m_endBEndName = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Role:"), m_endBEndName);
|
||||
connect(m_endBEndName, SIGNAL(textChanged(QString)), this, SLOT(onAssociationEndBNameChanged(QString)));
|
||||
connect(m_endBEndName, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onAssociationEndBNameChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endB().name() != m_endBEndName->text() && !m_endBEndName->hasFocus())
|
||||
@@ -728,8 +740,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endBCardinality == 0) {
|
||||
m_endBCardinality = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Cardinality:"), m_endBCardinality);
|
||||
connect(m_endBCardinality, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(onAssociationEndBCardinalityChanged(QString)));
|
||||
connect(m_endBCardinality, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onAssociationEndBCardinalityChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endB().cardinality() != m_endBCardinality->text() && !m_endBCardinality->hasFocus())
|
||||
@@ -742,7 +754,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
if (m_endBNavigable == 0) {
|
||||
m_endBNavigable = new QCheckBox(tr("Navigable"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_endBNavigable);
|
||||
connect(m_endBNavigable, SIGNAL(clicked(bool)), this, SLOT(onAssociationEndBNavigableChanged(bool)));
|
||||
connect(m_endBNavigable, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onAssociationEndBNavigableChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (association->endB().isNavigable() != m_endBNavigable->isChecked())
|
||||
@@ -756,7 +769,8 @@ void PropertiesView::MView::visitMAssociation(const MAssociation *association)
|
||||
m_endBKind = new QComboBox(m_topWidget);
|
||||
m_endBKind->addItems(QStringList() << tr("Association") << tr("Aggregation") << tr("Composition"));
|
||||
m_topLayout->addRow(tr("Relationship:"), m_endBKind);
|
||||
connect(m_endBKind, SIGNAL(activated(int)), this, SLOT(onAssociationEndBKindChanged(int)));
|
||||
connect(m_endBKind, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onAssociationEndBKindChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if ((!isValidAssociationKindIndex(m_endAKind->currentIndex())
|
||||
@@ -811,7 +825,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
if (m_autoSizedCheckbox == 0) {
|
||||
m_autoSizedCheckbox = new QCheckBox(tr("Auto sized"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_autoSizedCheckbox);
|
||||
connect(m_autoSizedCheckbox, SIGNAL(clicked(bool)), this, SLOT(onAutoSizedChanged(bool)));
|
||||
connect(m_autoSizedCheckbox, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onAutoSizedChanged);
|
||||
}
|
||||
if (!m_autoSizedCheckbox->hasFocus()) {
|
||||
bool autoSized;
|
||||
@@ -828,7 +843,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
setPrimaryRolePalette(m_styleElementType, DObject::PrimaryRoleCustom4, QColor());
|
||||
setPrimaryRolePalette(m_styleElementType, DObject::PrimaryRoleCustom5, QColor());
|
||||
m_topLayout->addRow(tr("Color:"), m_visualPrimaryRoleSelector);
|
||||
connect(m_visualPrimaryRoleSelector, SIGNAL(activated(int)), this, SLOT(onVisualPrimaryRoleChanged(int)));
|
||||
connect(m_visualPrimaryRoleSelector, &PaletteBox::activated,
|
||||
this, &PropertiesView::MView::onVisualPrimaryRoleChanged);
|
||||
}
|
||||
if (!m_visualPrimaryRoleSelector->hasFocus()) {
|
||||
StereotypeDisplayVisitor stereotypeDisplayVisitor;
|
||||
@@ -854,7 +870,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
<< tr("Lighter") << tr("Darker")
|
||||
<< tr("Soften") << tr("Outline"));
|
||||
m_topLayout->addRow(tr("Role:"), m_visualSecondaryRoleSelector);
|
||||
connect(m_visualSecondaryRoleSelector, SIGNAL(activated(int)), this, SLOT(onVisualSecondaryRoleChanged(int)));
|
||||
connect(m_visualSecondaryRoleSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onVisualSecondaryRoleChanged);
|
||||
}
|
||||
if (!m_visualSecondaryRoleSelector->hasFocus()) {
|
||||
DObject::VisualSecondaryRole visualSecondaryRole;
|
||||
@@ -866,7 +883,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
if (m_visualEmphasizedCheckbox == 0) {
|
||||
m_visualEmphasizedCheckbox = new QCheckBox(tr("Emphasized"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_visualEmphasizedCheckbox);
|
||||
connect(m_visualEmphasizedCheckbox, SIGNAL(clicked(bool)), this, SLOT(onVisualEmphasizedChanged(bool)));
|
||||
connect(m_visualEmphasizedCheckbox, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onVisualEmphasizedChanged);
|
||||
}
|
||||
if (!m_visualEmphasizedCheckbox->hasFocus()) {
|
||||
bool emphasized;
|
||||
@@ -880,7 +898,8 @@ void PropertiesView::MView::visitDObject(const DObject *object)
|
||||
m_stereotypeDisplaySelector->addItems(QStringList() << tr("Smart") << tr("None") << tr("Label")
|
||||
<< tr("Decoration") << tr("Icon"));
|
||||
m_topLayout->addRow(tr("Stereotype display:"), m_stereotypeDisplaySelector);
|
||||
connect(m_stereotypeDisplaySelector, SIGNAL(activated(int)), this, SLOT(onStereotypeDisplayChanged(int)));
|
||||
connect(m_stereotypeDisplaySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onStereotypeDisplayChanged);
|
||||
}
|
||||
if (!m_stereotypeDisplaySelector->hasFocus()) {
|
||||
DObject::StereotypeDisplay stereotypeDisplay;
|
||||
@@ -916,7 +935,8 @@ void PropertiesView::MView::visitDClass(const DClass *klass)
|
||||
m_templateDisplaySelector = new QComboBox(m_topWidget);
|
||||
m_templateDisplaySelector->addItems(QStringList() << tr("Smart") << tr("Box") << tr("Angle Brackets"));
|
||||
m_topLayout->addRow(tr("Template display:"), m_templateDisplaySelector);
|
||||
connect(m_templateDisplaySelector, SIGNAL(activated(int)), this, SLOT(onTemplateDisplayChanged(int)));
|
||||
connect(m_templateDisplaySelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onTemplateDisplayChanged);
|
||||
}
|
||||
if (!m_templateDisplaySelector->hasFocus()) {
|
||||
DClass::TemplateDisplay templateDisplay;
|
||||
@@ -928,7 +948,8 @@ void PropertiesView::MView::visitDClass(const DClass *klass)
|
||||
if (m_showAllMembersCheckbox == 0) {
|
||||
m_showAllMembersCheckbox = new QCheckBox(tr("Show members"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_showAllMembersCheckbox);
|
||||
connect(m_showAllMembersCheckbox, SIGNAL(clicked(bool)), this, SLOT(onShowAllMembersChanged(bool)));
|
||||
connect(m_showAllMembersCheckbox, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onShowAllMembersChanged);
|
||||
}
|
||||
if (!m_showAllMembersCheckbox->hasFocus()) {
|
||||
bool showAllMembers;
|
||||
@@ -948,7 +969,8 @@ void PropertiesView::MView::visitDComponent(const DComponent *component)
|
||||
if (m_plainShapeCheckbox == 0) {
|
||||
m_plainShapeCheckbox = new QCheckBox(tr("Plain shape"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_plainShapeCheckbox);
|
||||
connect(m_plainShapeCheckbox, SIGNAL(clicked(bool)), this, SLOT(onPlainShapeChanged(bool)));
|
||||
connect(m_plainShapeCheckbox, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onPlainShapeChanged);
|
||||
}
|
||||
if (!m_plainShapeCheckbox->hasFocus()) {
|
||||
bool plainShape;
|
||||
@@ -978,7 +1000,8 @@ void PropertiesView::MView::visitDItem(const DItem *item)
|
||||
if (m_itemShapeEdit == 0) {
|
||||
m_itemShapeEdit = new QLineEdit(m_topWidget);
|
||||
m_topLayout->addRow(tr("Shape:"), m_itemShapeEdit);
|
||||
connect(m_itemShapeEdit, SIGNAL(textChanged(QString)), this, SLOT(onItemShapeChanged(QString)));
|
||||
connect(m_itemShapeEdit, &QLineEdit::textChanged,
|
||||
this, &PropertiesView::MView::onItemShapeChanged);
|
||||
}
|
||||
if (isSingleSelection) {
|
||||
if (item->shape() != m_itemShapeEdit->text() && !m_itemShapeEdit->hasFocus())
|
||||
@@ -1021,7 +1044,8 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation)
|
||||
if (m_annotationAutoWidthCheckbox == 0) {
|
||||
m_annotationAutoWidthCheckbox = new QCheckBox(tr("Auto width"), m_topWidget);
|
||||
m_topLayout->addRow(QString(), m_annotationAutoWidthCheckbox);
|
||||
connect(m_annotationAutoWidthCheckbox, SIGNAL(clicked(bool)), this, SLOT(onAutoWidthChanged(bool)));
|
||||
connect(m_annotationAutoWidthCheckbox, &QAbstractButton::clicked,
|
||||
this, &PropertiesView::MView::onAutoWidthChanged);
|
||||
}
|
||||
if (!m_annotationAutoWidthCheckbox->hasFocus()) {
|
||||
bool autoSized;
|
||||
@@ -1036,7 +1060,8 @@ void PropertiesView::MView::visitDAnnotation(const DAnnotation *annotation)
|
||||
<< tr("Normal") << tr("Title") << tr("Subtitle")
|
||||
<< tr("Emphasized") << tr("Soften") << tr("Footnote"));
|
||||
m_topLayout->addRow(tr("Role:"), m_annotationVisualRoleSelector);
|
||||
connect(m_annotationVisualRoleSelector, SIGNAL(activated(int)), this, SLOT(onAnnotationVisualRoleChanged(int)));
|
||||
connect(m_annotationVisualRoleSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
|
||||
this, &PropertiesView::MView::onAnnotationVisualRoleChanged);
|
||||
}
|
||||
if (!m_annotationVisualRoleSelector->hasFocus()) {
|
||||
DAnnotation::VisualRole visualRole;
|
||||
|
@@ -102,7 +102,7 @@ public:
|
||||
void update(QList<DElement *> &diagramElements, MDiagram *diagram);
|
||||
void edit();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void onStereotypesChanged(const QString &stereotypes);
|
||||
void onObjectNameChanged(const QString &name);
|
||||
void onNamespaceChanged(const QString ¨Namespace);
|
||||
@@ -133,7 +133,6 @@ private slots:
|
||||
void onAutoWidthChanged(bool autoWidthed);
|
||||
void onAnnotationVisualRoleChanged(int visualRoleIndex);
|
||||
|
||||
private:
|
||||
void prepare();
|
||||
template<class T, class V>
|
||||
void setTitle(const QList<V *> &elements, const QString &singularTitle,
|
||||
|
@@ -69,7 +69,6 @@ public:
|
||||
Project *project() const { return m_project.data(); }
|
||||
bool isModified() const { return m_isModified; }
|
||||
|
||||
public slots:
|
||||
void newProject(const QString &fileName);
|
||||
void setFileName(const QString &fileName);
|
||||
void setModified();
|
||||
|
@@ -127,7 +127,6 @@ private:
|
||||
|
||||
void evaluate();
|
||||
|
||||
private:
|
||||
const QString m_source;
|
||||
const QString m_pattern;
|
||||
bool m_isEvaluated;
|
||||
|
Reference in New Issue
Block a user