Commit bf4b16ed authored by Jochen Becher's avatar Jochen Becher

ModelEditor: Use Qt5-style connects

Change-Id: I35f284fd790713670ce31d4a802860b4d41c1ad3
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 7b3aa16d
......@@ -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, 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, 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::beginResetModel,
this, &DiagramController::onBeginResetModel);
connect(modelController, &ModelController::endResetModel,
this, &DiagramController::onEndResetModel);
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, &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, 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, 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, SIGNAL(relationEndChanged(MRelation*,MObject*)),
this, SLOT(onRelationEndChanged(MRelation*,MObject*)));
connect(m_modelController, &ModelController::beginResetModel,
this, &TreeModel::onBeginResetModel);
connect(m_modelController, &ModelController::endResetModel,
this, &TreeModel::onEndResetModel);
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, &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, &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, 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, 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, SIGNAL(relationEndChanged(MRelation*,MObject*)),
this, SLOT(onRelationEndChanged(MRelation*,MObject*)));
connect(m_modelController, &ModelController::beginResetModel,
this, &PropertiesView::onBeginResetModel);
connect(m_modelController, &ModelController::endResetModel,
this, &PropertiesView::onEndResetModel);
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, &ModelController::beginInsertRelation,
this, &PropertiesView::onBeginInsertRelation);