Changeset View
Changeset View
Standalone View
Standalone View
analitzaplot/plotsmodel.cpp
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 154 | if (plot.canDraw()) { | |||
---|---|---|---|---|---|
160 | } | 160 | } | ||
161 | 161 | | |||
162 | emit dataChanged(index, index); | 162 | emit dataChanged(index, index); | ||
163 | 163 | | |||
164 | return true; | 164 | return true; | ||
165 | } | 165 | } | ||
166 | return false; | 166 | return false; | ||
167 | } | 167 | } | ||
168 | } | 168 | } //fallthrough | ||
apol: Use Q_FALLTHROUGH? https://doc.qt.io/qt-5/qtglobal.html#Q_FALLTHROUGH | |||||
Currently, Qt version required is 5.6. So this is not possible without bumping the required version (Q_FALLTHROUGH requires Qt 5.8). yurchor: Currently, Qt version required is 5.6. So this is not possible without bumping the required… | |||||
169 | case Qt::CheckStateRole: | 169 | case Qt::CheckStateRole: | ||
170 | m_items[index.row()]->setVisible(value.toBool()); | 170 | m_items[index.row()]->setVisible(value.toBool()); | ||
171 | return true; | 171 | return true; | ||
172 | case Qt::DecorationRole: | 172 | case Qt::DecorationRole: | ||
173 | m_items[index.row()]->setColor(value.value<QColor>()); | 173 | m_items[index.row()]->setColor(value.value<QColor>()); | ||
174 | return true; | 174 | return true; | ||
175 | } | 175 | } | ||
176 | 176 | | |||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 245 | for(int i=0; i<rows; i++) { | |||
247 | if(idx.data().toString()==name) | 247 | if(idx.data().toString()==name) | ||
248 | return idx; | 248 | return idx; | ||
249 | } | 249 | } | ||
250 | return QModelIndex(); | 250 | return QModelIndex(); | ||
251 | } | 251 | } | ||
252 | 252 | | |||
253 | QString PlotsModel::freeId() const | 253 | QString PlotsModel::freeId() const | ||
254 | { | 254 | { | ||
255 | return "f"+QString::number(m_namingCount); | 255 | return 'f'+QString::number(m_namingCount); | ||
256 | } | 256 | } | ||
257 | 257 | | |||
258 | void PlotsModel::setResolution(int res) | 258 | void PlotsModel::setResolution(int res) | ||
259 | { | 259 | { | ||
260 | m_resolution = res; | 260 | m_resolution = res; | ||
261 | for(int i=0; i<rowCount(); i++) { | 261 | for(int i=0; i<rowCount(); i++) { | ||
262 | FunctionGraph* g = dynamic_cast<FunctionGraph*>(m_items[i]); | 262 | FunctionGraph* g = dynamic_cast<FunctionGraph*>(m_items[i]); | ||
263 | if(g) | 263 | if(g) | ||
Show All 39 Lines |
Use Q_FALLTHROUGH? https://doc.qt.io/qt-5/qtglobal.html#Q_FALLTHROUGH