| 62 | } |
| 63 | |
| 64 | QVariant TableModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 65 | { |
| 66 | QVariant result; |
| 67 | |
| 68 | switch (role) { |
| 69 | case Qt::DisplayRole: |
| 70 | case Qt::EditRole: |
| 71 | if (m_supplyHeaderData) { |
| 72 | if (orientation == Qt::Horizontal) { |
| 73 | // column header data |
| 74 | if (!m_horizontalHeaderData.isEmpty()) |
| 75 | result = m_horizontalHeaderData[section]; |
| 76 | } else { |
| 77 | // row header data: |
| 78 | if (!m_verticalHeaderData.isEmpty()) |
| 79 | result = m_verticalHeaderData[section]; |
| 80 | } |
| 81 | } |
| 82 | break; |
| 83 | case Qt::TextAlignmentRole: |
| 84 | // result = QVariant ( Qt::AlignHCenter | Qt::AlignHCenter ); |
| 85 | break; |
| 86 | case Qt::DecorationRole: |
| 87 | case Qt::ToolTipRole: |
| 88 | break; |
| 89 | default: |
| 90 | // qDebug () << "TableModel::headerData: unknown role " << role << "." << endl; |
| 91 | break; |
| 92 | } |
| 93 | return result; |
| 94 | } |
| 95 | |
| 96 | bool TableModel::setData(const QModelIndex &index, const QVariant &value, int role /* = Qt::EditRole */) |
| 97 | { |
no test coverage detected