18 if (parent.isValid()) {
27 if (parent.isValid()) {
43 int col = index.column();
46 if (role == Qt::CheckStateRole) {
47 if (cal->get_IsUsed()) {
54 if (role == Qt::DecorationRole) {
55 if (cal->isLocked()) {
56 return QPixmap(
":/images/lock-16x16.png");
60 if (role == Qt::DisplayRole) {
61 return cal->get_Name();
64 if (role == Qt::DisplayRole) {
65 switch (cal->get_Symmetry()) {
92 if (role == Qt::DisplayRole) {
93 return cal->get_Description();
108 if (orientation==Qt::Horizontal) {
109 if (role==Qt::DisplayRole) {
128 return "Description";
132 }
else if (orientation==Qt::Vertical) {
133 if (role==Qt::DisplayRole) {
147 return cal->get_IsUsed();
158 cal->set_IsUsed(!cal->get_IsUsed());
160 emit dataChanged(index(n,0), index(n,0));
171 emit dataChanged(index(n,0), index(n,0));
179 emit dataChanged(index(n,0), index(n,nc-1));
void setIsUsed(int n, int v)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
QSharedPointer< QxrdCalibrantLibrary > QxrdCalibrantLibraryPtr
QxrdCalibrantLibraryModel(QxrdCalibrantLibraryPtr cal)
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QSharedPointer< QxrdCalibrant > QxrdCalibrantPtr
~QxrdCalibrantLibraryModel()
void calibrantChanged(int n)
virtual QVariant data(const QModelIndex &index, int role) const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
QxrdCalibrantLibraryPtr m_CalibrantLibrary