Mercurial > hg > svgui
comparison widgets/LayerTree.cpp @ 1266:a34a2a25907c
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | 4a578a360011 |
children | c8a6fd3f9dff |
comparison
equal
deleted
inserted
replaced
1265:6e724c81f18f | 1266:a34a2a25907c |
---|---|
218 return flags; | 218 return flags; |
219 } | 219 } |
220 | 220 |
221 QVariant | 221 QVariant |
222 ModelMetadataModel::headerData(int section, | 222 ModelMetadataModel::headerData(int section, |
223 Qt::Orientation orientation, | 223 Qt::Orientation orientation, |
224 int role) const | 224 int role) const |
225 { | 225 { |
226 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { | 226 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { |
227 if (section == m_modelTypeColumn) return QVariant(tr("Type")); | 227 if (section == m_modelTypeColumn) return QVariant(tr("Type")); |
228 else if (section == m_modelNameColumn) return QVariant(tr("Name")); | 228 else if (section == m_modelNameColumn) return QVariant(tr("Name")); |
229 else if (section == m_modelMakerColumn) return QVariant(tr("Maker")); | 229 else if (section == m_modelMakerColumn) return QVariant(tr("Maker")); |
230 else if (section == m_modelSourceColumn) return QVariant(tr("Source")); | 230 else if (section == m_modelSourceColumn) return QVariant(tr("Source")); |
231 } | 231 } |
232 | 232 |
233 return QVariant(); | 233 return QVariant(); |
234 } | 234 } |
235 | 235 |
236 QModelIndex | 236 QModelIndex |
237 ModelMetadataModel::index(int row, int column, const QModelIndex &parent) const | 237 ModelMetadataModel::index(int row, int column, const QModelIndex &parent) const |
238 { | 238 { |
239 if (!parent.isValid()) { | 239 if (!parent.isValid()) { |
240 if (row >= (int)m_models.size()) return QModelIndex(); | 240 if (row >= (int)m_models.size()) return QModelIndex(); |
241 return createIndex(row, column, (void *)0); | 241 return createIndex(row, column, (void *)0); |
242 } | 242 } |
243 | 243 |
244 return QModelIndex(); | 244 return QModelIndex(); |
245 } | 245 } |
246 | 246 |
505 return flags; | 505 return flags; |
506 } | 506 } |
507 | 507 |
508 QVariant | 508 QVariant |
509 LayerTreeModel::headerData(int section, | 509 LayerTreeModel::headerData(int section, |
510 Qt::Orientation orientation, | 510 Qt::Orientation orientation, |
511 int role) const | 511 int role) const |
512 { | 512 { |
513 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { | 513 if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { |
514 if (section == m_layerNameColumn) return QVariant(tr("Layer")); | 514 if (section == m_layerNameColumn) return QVariant(tr("Layer")); |
515 else if (section == m_layerVisibleColumn) return QVariant(tr("Shown")); | 515 else if (section == m_layerVisibleColumn) return QVariant(tr("Shown")); |
516 else if (section == m_layerPlayedColumn) return QVariant(tr("Played")); | 516 else if (section == m_layerPlayedColumn) return QVariant(tr("Played")); |
517 else if (section == m_modelNameColumn) return QVariant(tr("Model")); | 517 else if (section == m_modelNameColumn) return QVariant(tr("Model")); |
518 } | 518 } |
519 | 519 |
520 return QVariant(); | 520 return QVariant(); |
521 } | 521 } |
522 | 522 |
529 // cell for a layer contains row, column, pane | 529 // cell for a layer contains row, column, pane |
530 // -> its parent is row, column, pane stack (which identify the pane) | 530 // -> its parent is row, column, pane stack (which identify the pane) |
531 | 531 |
532 if (!parent.isValid()) { | 532 if (!parent.isValid()) { |
533 if (row >= m_stack->getPaneCount() || column > 0) return QModelIndex(); | 533 if (row >= m_stack->getPaneCount() || column > 0) return QModelIndex(); |
534 return createIndex(row, column, m_stack); | 534 return createIndex(row, column, m_stack); |
535 } | 535 } |
536 | 536 |
537 QObject *obj = static_cast<QObject *>(parent.internalPointer()); | 537 QObject *obj = static_cast<QObject *>(parent.internalPointer()); |
538 | 538 |
539 if (obj == m_stack) { | 539 if (obj == m_stack) { |