MCPcopy Create free account
hub / github.com/KDAB/KDChart / headerData

Method headerData

examples/tools/TableModel.cpp:64–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64QVariant 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
96bool TableModel::setData(const QModelIndex &index, const QVariant &value, int role /* = Qt::EditRole */)
97{

Callers 3

paintMarkersMethod · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected