Brief description of class still missing. More...
#include <StationCoordinatesItem.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 &) const |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| virtual QModelIndex | index (int, int column, const QModelIndex &parent=QModelIndex()) const |
| virtual QModelIndex | parent (const QModelIndex &) const |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| void | setStations (QList< NamedPoint > *s) |
| void | setStations (StationList *s) |
| StationCoordinatesItem (QObject *parent=0) | |
| void | stationListChanged () |
Brief description of class still missing.
Full description of class still missing
| GeopsyGui::StationCoordinatesItem::StationCoordinatesItem | ( | QObject * | parent = 0 | ) |
| int GeopsyGui::StationCoordinatesItem::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| QVariant GeopsyGui::StationCoordinatesItem::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const [virtual] |
References GeopsyCore::StationSignals::coordinates(), QGpCoreTools::NamedPoint::name(), GeopsyCore::StationSignals::name(), TRACE, QGpCoreTools::Point2D::x(), QGpCoreTools::Point2D::y(), and QGpCoreTools::Point::z().
{
TRACE;
if(_stationList) {
const NamedPoint& s=_stationList->at(index.row());
switch (role) {
case Qt::DisplayRole:
switch (index.column()) {
case 0: return s.name();
case 1: return s.x();
case 2: return s.y();
case 3: return s.z();
default: break;
}
default:
break;
}
} else if(_stationSignalsList) {
const StationSignals * stat=_stationSignalsList->at(index.row());;
switch (role) {
case Qt::DisplayRole:
switch (index.column()) {
case 0: return stat->name();
case 1: return stat->coordinates().x();
case 2: return stat->coordinates().y();
case 3: return stat->coordinates().z();
default: break;
}
default:
break;
}
}
return QVariant();
}
| virtual Qt::ItemFlags GeopsyGui::StationCoordinatesItem::flags | ( | const QModelIndex & | ) | const [inline, virtual] |
{return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled;}
| QVariant GeopsyGui::StationCoordinatesItem::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role = Qt::DisplayRole |
||
| ) | const [virtual] |
References QGpCoreTools::tr(), and TRACE.
| QModelIndex GeopsyGui::StationCoordinatesItem::index | ( | int | row, |
| int | column, | ||
| const QModelIndex & | parent = QModelIndex() |
||
| ) | const [virtual] |
| virtual QModelIndex GeopsyGui::StationCoordinatesItem::parent | ( | const QModelIndex & | ) | const [inline, virtual] |
{return QModelIndex();}
| int GeopsyGui::StationCoordinatesItem::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| bool GeopsyGui::StationCoordinatesItem::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role = Qt::EditRole |
||
| ) | [virtual] |
References QGpCoreTools::NamedPoint::setName(), QGpCoreTools::Point2D::setX(), QGpCoreTools::Point2D::setY(), QGpCoreTools::Point::setZ(), and TRACE.
{
TRACE;
if(_stationList) {
NamedPoint& s=(*_stationList)[index.row()];
switch (role) {
case Qt::EditRole:
switch (index.column()) {
case 0:
s.setName(value.toString());
emit dataChanged(index, index);
return true;
case 1:
s.setX(value.toDouble());
emit dataChanged(index, index);
return true;
case 2:
s.setY(value.toDouble());
emit dataChanged(index, index);
return true;
case 3:
s.setZ(value.toDouble());
emit dataChanged(index, index);
return true;
default:
break;
}
default:
break;
}
}
return false;
}
| void GeopsyGui::StationCoordinatesItem::setStations | ( | QList< NamedPoint > * | s | ) |
Referenced by StationCoordinates::StationCoordinates(), and WaranWidget::WaranWidget().
{
_stationList=s;
}
{
_stationSignalsList=s;
}