Mercurial > hg > svgui
comparison view/AlignmentView.cpp @ 1414:fa986b91d77f
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:24:51 +0000 |
parents | c8a6fd3f9dff |
children | 9abddbd57667 |
comparison
equal
deleted
inserted
replaced
1413:0930a27ebea2 | 1414:fa986b91d77f |
---|---|
23 | 23 |
24 using std::vector; | 24 using std::vector; |
25 | 25 |
26 AlignmentView::AlignmentView(QWidget *w) : | 26 AlignmentView::AlignmentView(QWidget *w) : |
27 View(w, false), | 27 View(w, false), |
28 m_above(0), | 28 m_above(nullptr), |
29 m_below(0) | 29 m_below(nullptr) |
30 { | 30 { |
31 setObjectName(tr("AlignmentView")); | 31 setObjectName(tr("AlignmentView")); |
32 } | 32 } |
33 | 33 |
34 void | 34 void |
71 | 71 |
72 void | 72 void |
73 AlignmentView::setViewAbove(View *v) | 73 AlignmentView::setViewAbove(View *v) |
74 { | 74 { |
75 if (m_above) { | 75 if (m_above) { |
76 disconnect(m_above, 0, this, 0); | 76 disconnect(m_above, nullptr, this, nullptr); |
77 } | 77 } |
78 | 78 |
79 m_above = v; | 79 m_above = v; |
80 | 80 |
81 if (m_above) { | 81 if (m_above) { |
88 | 88 |
89 void | 89 void |
90 AlignmentView::setViewBelow(View *v) | 90 AlignmentView::setViewBelow(View *v) |
91 { | 91 { |
92 if (m_below) { | 92 if (m_below) { |
93 disconnect(m_below, 0, this, 0); | 93 disconnect(m_below, nullptr, this, nullptr); |
94 } | 94 } |
95 | 95 |
96 m_below = v; | 96 m_below = v; |
97 | 97 |
98 if (m_below) { | 98 if (m_below) { |
104 } | 104 } |
105 | 105 |
106 void | 106 void |
107 AlignmentView::paintEvent(QPaintEvent *) | 107 AlignmentView::paintEvent(QPaintEvent *) |
108 { | 108 { |
109 if (m_above == 0 || m_below == 0 || !m_manager) return; | 109 if (m_above == nullptr || m_below == nullptr || !m_manager) return; |
110 | 110 |
111 bool darkPalette = false; | 111 bool darkPalette = false; |
112 if (m_manager) darkPalette = m_manager->getGlobalDarkBackground(); | 112 if (m_manager) darkPalette = m_manager->getGlobalDarkBackground(); |
113 | 113 |
114 QColor fg, bg; | 114 QColor fg, bg; |
145 { | 145 { |
146 if (!m_above) { | 146 if (!m_above) { |
147 return getDefaultKeyFrames(); | 147 return getDefaultKeyFrames(); |
148 } | 148 } |
149 | 149 |
150 SparseOneDimensionalModel *m = 0; | 150 SparseOneDimensionalModel *m = nullptr; |
151 | 151 |
152 // get the topmost such | 152 // get the topmost such |
153 for (int i = 0; i < m_above->getLayerCount(); ++i) { | 153 for (int i = 0; i < m_above->getLayerCount(); ++i) { |
154 if (qobject_cast<TimeInstantLayer *>(m_above->getLayer(i))) { | 154 if (qobject_cast<TimeInstantLayer *>(m_above->getLayer(i))) { |
155 SparseOneDimensionalModel *mm = | 155 SparseOneDimensionalModel *mm = |