Mercurial > hg > svcore
comparison data/model/Model.cpp @ 1731:601851995f4b by-id
Introduce Model to ById
author | Chris Cannam |
---|---|
date | Fri, 21 Jun 2019 13:37:00 +0100 |
parents | 187c76c40c6f |
children | d91ff235e69d |
comparison
equal
deleted
inserted
replaced
1729:abd8b9673028 | 1731:601851995f4b |
---|---|
38 m_alignment->aboutToDelete(); | 38 m_alignment->aboutToDelete(); |
39 delete m_alignment; | 39 delete m_alignment; |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 int | |
44 Model::getNextId() | |
45 { | |
46 static int nextId = 0; | |
47 static QMutex mutex; | |
48 QMutexLocker locker(&mutex); | |
49 int i = nextId; | |
50 if (nextId == INT_MAX) { | |
51 nextId = INT_MIN; | |
52 } | |
53 ++nextId; | |
54 return i; | |
55 } | |
56 | |
57 void | 43 void |
58 Model::setSourceModel(Model *model) | 44 Model::setSourceModel(Model *model) |
59 { | 45 { |
60 if (m_sourceModel) { | 46 if (m_sourceModel) { |
61 disconnect(m_sourceModel, SIGNAL(aboutToBeDeleted()), | 47 disconnect(m_sourceModel, SIGNAL(aboutToBeDeleted()), |