diff --git a/src/plugins/projectexplorer/dependenciespanel.cpp b/src/plugins/projectexplorer/dependenciespanel.cpp index 30b1e3f00a7..ca15c2808b7 100644 --- a/src/plugins/projectexplorer/dependenciespanel.cpp +++ b/src/plugins/projectexplorer/dependenciespanel.cpp @@ -52,13 +52,13 @@ DependenciesModel::DependenciesModel(Project *project, QObject *parent) // We can't select ourselves as a dependency m_projects.removeAll(m_project); - QObject *sessionManager = SessionManager::instance(); - connect(sessionManager, SIGNAL(projectRemoved(ProjectExplorer::Project*)), - this, SLOT(resetModel())); - connect(sessionManager, SIGNAL(projectAdded(ProjectExplorer::Project*)), - this, SLOT(resetModel())); - connect(sessionManager, SIGNAL(sessionLoaded(QString)), - this, SLOT(resetModel())); + SessionManager *sessionManager = SessionManager::instance(); + connect(sessionManager, &SessionManager::projectRemoved, + this, &DependenciesModel::resetModel); + connect(sessionManager, &SessionManager::projectAdded, + this, &DependenciesModel::resetModel); + connect(sessionManager, &SessionManager::sessionLoaded, + this, &DependenciesModel::resetModel); // qDebug()<<"Dependencies Model"<file()->fileName()<<")"; } @@ -157,27 +157,27 @@ QSize DependenciesView::sizeHint() const void DependenciesView::setModel(QAbstractItemModel *newModel) { if (QAbstractItemModel *oldModel = model()) { - disconnect(oldModel, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(updateSizeHint())); - disconnect(oldModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(updateSizeHint())); - disconnect(oldModel, SIGNAL(modelReset()), - this, SLOT(updateSizeHint())); - disconnect(oldModel, SIGNAL(layoutChanged()), - this, SLOT(updateSizeHint())); + disconnect(oldModel, &QAbstractItemModel::rowsInserted, + this, &DependenciesView::updateSizeHint); + disconnect(oldModel, &QAbstractItemModel::rowsRemoved, + this, &DependenciesView::updateSizeHint); + disconnect(oldModel, &QAbstractItemModel::modelReset, + this, &DependenciesView::updateSizeHint); + disconnect(oldModel, &QAbstractItemModel::layoutChanged, + this, &DependenciesView::updateSizeHint); } QTreeView::setModel(newModel); if (newModel) { - connect(newModel, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(updateSizeHint())); - connect(newModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(updateSizeHint())); - connect(newModel, SIGNAL(modelReset()), - this, SLOT(updateSizeHint())); - connect(newModel, SIGNAL(layoutChanged()), - this, SLOT(updateSizeHint())); + connect(newModel, &QAbstractItemModel::rowsInserted, + this, &DependenciesView::updateSizeHint); + connect(newModel, &QAbstractItemModel::rowsRemoved, + this, &DependenciesView::updateSizeHint); + connect(newModel, &QAbstractItemModel::modelReset, + this, &DependenciesView::updateSizeHint); + connect(newModel, &QAbstractItemModel::layoutChanged, + this, &DependenciesView::updateSizeHint); } updateSizeHint(); } diff --git a/src/plugins/projectexplorer/dependenciespanel.h b/src/plugins/projectexplorer/dependenciespanel.h index 32a11cd0d71..4c9c342876c 100644 --- a/src/plugins/projectexplorer/dependenciespanel.h +++ b/src/plugins/projectexplorer/dependenciespanel.h @@ -59,10 +59,9 @@ public: bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); Qt::ItemFlags flags(const QModelIndex &index) const; -public slots: +private: void resetModel(); -private: Project *m_project; QList m_projects; }; @@ -77,10 +76,9 @@ public: QSize sizeHint() const; void setModel(QAbstractItemModel *model); -private slots: +private: void updateSizeHint(); -private: QSize m_sizeHint; };