case Qt::DisplayRole:
{
if( aColumn==0 && aRow >=0 && aRow < myObjects.count() )
- return myObjects.at( aRow ).first;
+ return myObjects.at( aRow ).first->GetName();
else
return QVariant();
}
{
if( aColumn==0 && aRow >=0 && aRow < myObjects.count() )
{
- bool isVisible = IsObjectVisible( aRow );
+ bool isVisible = isObjectVisible( aRow );
if( isVisible )
return myEye;
else
case HYDROGUI_VisibleRole:
{
- bool isVisible = IsObjectVisible( aRow );
+ bool isVisible = isObjectVisible( aRow );
return QVariant( isVisible ).toString();
}
break;
return myObjects.count();
}
-void HYDROGUI_ZLevelsModel::setObjects( const QList<QPair<QString, bool>>& theObjects )
+void HYDROGUI_ZLevelsModel::setObjects( const Object2VisibleList& theObjects )
{
myObjects = theObjects;
reset();
}
-bool HYDROGUI_ZLevelsModel::IsObjectVisible( int theIndex ) const
+HYDROGUI_ZLevelsModel::ObjectList HYDROGUI_ZLevelsModel::getObjects() const
+{
+ ObjectList anObjects;
+
+ foreach( const Object2Visible& anItem, myObjects ) {
+ anObjects << anItem.first;
+ }
+
+ return anObjects;
+}
+
+bool HYDROGUI_ZLevelsModel::isObjectVisible( int theIndex ) const
{
bool isVisible = false;
if ( theItem > 0 ) {
aDestinationIndex = theItem - 1;
if ( theIsVisibleOnly ) {
- while ( aDestinationIndex >= 0 && !IsObjectVisible( aDestinationIndex ) ) {
+ while ( aDestinationIndex >= 0 && !isObjectVisible( aDestinationIndex ) ) {
aDestinationIndex--;
}
}
if ( theItem < myObjects.count() - 1 ) {
aDestinationIndex = theItem + 1;
if ( theIsVisibleOnly ) {
- while ( aDestinationIndex < myObjects.count() && !IsObjectVisible( aDestinationIndex ) ) {
+ while ( aDestinationIndex < myObjects.count() && !isObjectVisible( aDestinationIndex ) ) {
aDestinationIndex++;
}
}