aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/aggregation
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2016-05-31 22:36:09 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-06-01 05:51:32 +0000
commit4ed9b68fbf8eceb84677298d1ea0e5fb1d59ae18 (patch)
treeda357bc3bbef024d152f045cd8119694b459e348 /src/libs/aggregation
parent9370e863f84c045be01b8e354efc977acca200f7 (diff)
Aggregation: Use Qt5-style connects
Change-Id: Ifee501f2da7d2834f6ce8a63f85e9fab9c683b5d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/aggregation')
-rw-r--r--src/libs/aggregation/aggregate.cpp6
-rw-r--r--src/libs/aggregation/aggregate.h3
-rw-r--r--src/libs/aggregation/examples/text/main.cpp3
-rw-r--r--src/libs/aggregation/examples/text/main.h3
4 files changed, 7 insertions, 8 deletions
diff --git a/src/libs/aggregation/aggregate.cpp b/src/libs/aggregation/aggregate.cpp
index 7ac0d2b223..b505c6cb4d 100644
--- a/src/libs/aggregation/aggregate.cpp
+++ b/src/libs/aggregation/aggregate.cpp
@@ -203,7 +203,7 @@ Aggregate::~Aggregate()
{
QWriteLocker locker(&lock());
foreach (QObject *component, m_components) {
- disconnect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
+ disconnect(component, &QObject::destroyed, this, &Aggregate::deleteSelf);
aggregateMap().remove(component);
}
components = m_components;
@@ -246,7 +246,7 @@ void Aggregate::add(QObject *component)
return;
}
m_components.append(component);
- connect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
+ connect(component, &QObject::destroyed, this, &Aggregate::deleteSelf);
aggregateMap().insert(component, this);
}
emit changed();
@@ -267,7 +267,7 @@ void Aggregate::remove(QObject *component)
QWriteLocker locker(&lock());
aggregateMap().remove(component);
m_components.removeAll(component);
- disconnect(component, SIGNAL(destroyed(QObject*)), this, SLOT(deleteSelf(QObject*)));
+ disconnect(component, &QObject::destroyed, this, &Aggregate::deleteSelf);
}
emit changed();
}
diff --git a/src/libs/aggregation/aggregate.h b/src/libs/aggregation/aggregate.h
index 8404e96d30..a60faed6c5 100644
--- a/src/libs/aggregation/aggregate.h
+++ b/src/libs/aggregation/aggregate.h
@@ -72,10 +72,9 @@ public:
signals:
void changed();
-private slots:
+private:
void deleteSelf(QObject *obj);
-private:
static QHash<QObject *, Aggregate *> &aggregateMap();
QList<QObject *> m_components;
diff --git a/src/libs/aggregation/examples/text/main.cpp b/src/libs/aggregation/examples/text/main.cpp
index 2a9e26b792..c205ccb838 100644
--- a/src/libs/aggregation/examples/text/main.cpp
+++ b/src/libs/aggregation/examples/text/main.cpp
@@ -31,7 +31,8 @@ MyMain::MyMain(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
ui.setupUi(this);
- connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(select(int)));
+ connect(ui.comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &MyMain::select);
}
void MyMain::add(IComboEntry *obj)
diff --git a/src/libs/aggregation/examples/text/main.h b/src/libs/aggregation/examples/text/main.h
index 76d0ec0191..c4472af1f4 100644
--- a/src/libs/aggregation/examples/text/main.h
+++ b/src/libs/aggregation/examples/text/main.h
@@ -42,10 +42,9 @@ public:
void add(IComboEntry *obj);
-private slots:
+private:
void select(int index);
-private:
Ui::mainClass ui;
QList<IComboEntry *> m_entries;