summaryrefslogtreecommitdiff
path: root/src/libs
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-04-09 15:38:59 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-04-16 13:33:03 +0000
commit171d16c6fb56c202efb7a3e79e7121dadac85265 (patch)
treefd3245838ff30de7af858d67b9f7cde9eccdac18 /src/libs
parent7b1a421fbfb0b5c88f851f2ba088bd07896c10f6 (diff)
downloadqt-creator-171d16c6fb56c202efb7a3e79e7121dadac85265.tar.gz
Timeline: Be more exact about height of model aggregator
Only emit the change signal if the height has actually changed. Change-Id: Ic4bf67f25cb4a7f204815b4e6b0c6bd88c71944a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/timeline/timelinemodelaggregator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libs/timeline/timelinemodelaggregator.cpp b/src/libs/timeline/timelinemodelaggregator.cpp
index bad5462fc5..b363752058 100644
--- a/src/libs/timeline/timelinemodelaggregator.cpp
+++ b/src/libs/timeline/timelinemodelaggregator.cpp
@@ -53,10 +53,6 @@ TimelineModelAggregator::TimelineModelAggregator(TimelineNotesModel *notes, QObj
: QObject(parent), d(new TimelineModelAggregatorPrivate(this))
{
d->notesModel = notes;
- connect(this, &TimelineModelAggregator::modelsChanged,
- this, &TimelineModelAggregator::heightChanged);
- connect(this, &TimelineModelAggregator::stateChanged,
- this, &TimelineModelAggregator::heightChanged);
}
TimelineModelAggregator::~TimelineModelAggregator()
@@ -76,6 +72,8 @@ void TimelineModelAggregator::addModel(TimelineModel *m)
if (d->notesModel)
d->notesModel->addTimelineModel(m);
emit modelsChanged();
+ if (m->height() != 0)
+ emit heightChanged();
}
const TimelineModel *TimelineModelAggregator::model(int modelIndex) const
@@ -98,10 +96,13 @@ TimelineNotesModel *TimelineModelAggregator::notes() const
void TimelineModelAggregator::clear()
{
+ int prevHeight = height();
d->modelList.clear();
if (d->notesModel)
d->notesModel->clear();
emit modelsChanged();
+ if (height() != prevHeight)
+ emit heightChanged();
}
int TimelineModelAggregator::modelOffset(int modelIndex) const