PL_UNLOCK;
return isLeaf;
}
+ else if( role == IsCurrentsParentNodeRole )
+ {
+ return QVariant( isParent( index, current_index ) );
+ }
return QVariant();
}
+/* Seek from current index toward the top and see if index is one of parent nodes */
+bool PLModel::isParent( const QModelIndex &index, const QModelIndex ¤t ) const
+{
+ if( index == current )
+ return true;
+
+ if( !current.parent().isValid() )
+ return false;
+
+ return isParent( index, current.parent() );
+}
+
bool PLModel::isCurrent( const QModelIndex &index ) const
{
return index == current_index;