17#ifndef __gui_mrview_tool_odf_model_h__
18#define __gui_mrview_tool_odf_model_h__
44 QAbstractItemModel (parent) { }
46 QVariant data (
const QModelIndex& index,
int role)
const {
47 if (!
index.isValid())
return {};
48 if (role != Qt::DisplayRole && role != Qt::ToolTipRole)
return {};
49 return qstr (items[
index.row()]->image.get_filename());
52 bool setData (
const QModelIndex&
index,
const QVariant&
value,
int role) {
53 return QAbstractItemModel::setData (
index,
value, role);
56 Qt::ItemFlags flags (
const QModelIndex&
index)
const {
57 if (!
index.isValid())
return {};
58 return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
61 QModelIndex parent (
const QModelIndex&)
const {
65 int rowCount (
const QModelIndex& parent = QModelIndex())
const {
70 int columnCount (
const QModelIndex& parent = QModelIndex())
const {
77 QModelIndex
index (
int row,
int column,
const QModelIndex& parent = QModelIndex())
const {
79 return createIndex (row, column);
82 void remove_item (QModelIndex&
index) {
83 beginRemoveRows (QModelIndex(),
index.row(),
index.row());
84 items.erase (items.begin() +
index.row());
VectorType::Scalar value(const VectorType &coefs, typename VectorType::Scalar cos_elevation, typename VectorType::Scalar cos_azimuth, typename VectorType::Scalar sin_azimuth, int lmax)
mat4 scale(float x, float y, float z)
QString qstr(const std::string &s)