40 TableHeader(
int type, Qt::Orientation orientation = Qt::Vertical);
48 TableHeader(
int type,
const QString& text, Qt::Orientation orientation = Qt::Vertical);
54 int type()
const {
return _type; }
60 QString
text()
const {
return _text; }
66 void setText(
const QString& text) { _text = text; }
121 QVariant
data(
int role)
const {
return _entityMetadata.data(role); }
128 void setData(
const QVariant& value,
int role) { _entityMetadata.setData(value, role); }
134 QUuid
uuid()
const {
return _entityMetadata.data(KANOOP::UUidRole).toUuid(); }
145 class List :
public QList<TableHeader>
155 auto it = std::find_if(begin(), end(), [type](
TableHeader& header) {
return header.
type() == type; });
157 (*it).setVisible(visible);
169 auto it = std::find_if(constBegin(), constEnd(), [text](
const TableHeader& header) {
return header.
text() == text; });
170 if(it != constEnd()) {
180 class IntMap :
public QMap<int, TableHeader>
190 QList<int> cols = keys();
191 std::sort(cols.begin(), cols.end());
192 for(
int col : cols) {
193 result.append(this->value(col));
205 auto it = std::find_if(begin(), end(), [type](
TableHeader& header) {
return header.
type() == type; });
219 auto it = std::find_if(begin(), end(), [type](
TableHeader& header) {
return header.
type() == type; });
221 (*it).setVisible(visible);
232 auto it = std::find_if(begin(), end(), [type](
TableHeader& header) {
return header.
type() == type; });
245 static QString
typeToString(
int type) {
return _TableHeaderTypeToStringMap.value(type); }
250 Qt::Orientation _orientation;
251 QColor _columnTextColor;
252 bool _visible =
true;
253 EntityMetadata _entityMetadata;
255 class TableHeaderTypeToStringMap :
public QMap<int, QString>
259 static const TableHeaderTypeToStringMap _TableHeaderTypeToStringMap;