All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Brief description of class still missing. More...
#include <PickItem.h>
Public Member Functions | |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| virtual QVariant | data (const QModelIndex &index, int role) const |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| PickItem (PicksProperties *picks) | |
| void | reset () |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
Brief description of class still missing.
Full description of class still missing
| GeopsyGui::PickItem::PickItem | ( | PicksProperties * | picks | ) |
| int GeopsyGui::PickItem::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| QVariant GeopsyGui::PickItem::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const [virtual] |
References TRACE, and QGpGuiTools::PropertyWidget::value().
{
TRACE;
// Directly addresses properties...
int pid=3*index.row()+index.column();
switch (role) {
case Qt::DisplayRole:
if(index.column()==0) return _picks->value(pid);
break;
case Qt::BackgroundRole:
if(index.column()==2) return _picks->value(pid);
break;
case Qt::CheckStateRole:
if(index.column()==1)
return _picks->value(pid).toBool() ? Qt::Checked : Qt::Unchecked;
break;
default:
break;
}
return QVariant();
}
| Qt::ItemFlags GeopsyGui::PickItem::flags | ( | const QModelIndex & | index | ) | const [virtual] |
{
switch(index.column()) {
case 0:
return Qt::ItemIsEnabled | Qt::ItemIsEditable;
case 1:
return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled;
default:
return Qt::ItemIsEnabled;
}
}
| QVariant GeopsyGui::PickItem::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const [virtual] |
| void GeopsyGui::PickItem::reset | ( | ) |
References TRACE.
{
TRACE;
QAbstractTableModel::reset();
}
| int GeopsyGui::PickItem::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| bool GeopsyGui::PickItem::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) | [virtual] |
References QGpGuiTools::PropertyWidget::propertyValue(), QGpGuiTools::PropertyWidget::touched(), and TRACE.
{
TRACE;
// Directly addresses properties...
int pid=3*index.row()+index.column();
switch (role) {
case Qt::EditRole:
if(index.column()==0) {
_picks->touched(_picks->propertyValue(pid), value);
return true;
}
break;
case Qt::BackgroundRole:
if(index.column()==2) {
_picks->touched(_picks->propertyValue(pid), value);
return true;
}
break;
case Qt::CheckStateRole:
if(index.column()==1) {
_picks->touched(_picks->propertyValue(pid), value==Qt::Checked);
return true;
}
default:
break;
}
return false;
}