11 item.setText(QString::fromStdString(cell.
contentText()));
13 item.setToolTip(QString::fromStdString(cell.
toolTip()));
22 auto cell =
Cell(item.text().toStdString());
29 cell.setBorderColor(borderColor.name().toStdString());
30 cell.setBorderOpacity(borderColor.alpha());
32 cell.setEditable(item.isEditable());
33 cell.setToolTip(item.toolTip().toStdString());
51void setIcon(QStandardItem &item, std::string
const &iconFilePath) {
52 auto qiconFilePath = QString::fromStdString(iconFilePath);
54 if (!qiconFilePath.isEmpty())
55 item.setIcon(QIcon(qiconFilePath));
57 item.setIcon(QIcon());
60void setBorderColor(QStandardItem &item, std::string
const &borderColor,
int alpha) {
61 auto borderQColor = QColor(borderColor.c_str());
62 borderQColor.setAlpha(alpha);
67 auto borderColor = QColor(backgroundColor.c_str());
68 item.setData(QBrush(borderColor), Qt::BackgroundRole);
72 return item.data(Qt::BackgroundRole).value<QBrush>().color().name().toStdString();
76 auto borderColor = QColor(foregroundColor.c_str());
77 item.setData(QBrush(borderColor), Qt::ForegroundRole);
81 return item.data(Qt::ForegroundRole).value<QBrush>().color().name().toStdString();