NCL Composer  0.1.5
 All Classes Functions Variables Pages
WorkspaceModel.cpp
1 /* Copyright (c) 2011 Telemidia/PUC-Rio.
2  * All rights reserved. This program and the accompanying materials
3  * are made available under the terms of the Eclipse Public License v1.0
4  * which accompanies this distribution, and is available at
5  * http://www.eclipse.org/legal/epl-v10.html
6  *
7  * Contributors:
8  * Telemidia/PUC-Rio - initial API and implementation
9  */
10 #include "../include/WorkspaceModel.h"
11 
12 namespace composer {
13  namespace gui {
14 
15 WorkspaceModel::WorkspaceModel(QObject *parent) :
16  QSortFilterProxyModel(parent)
17 {
18 }
19 
20 bool WorkspaceModel::filterAcceptsRow(int sourceRow,
21  const QModelIndex &sourceParent) const
22 {
23  QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
24  if(sourceParent.isValid())
25  {
26  if (sourceParent == topIndex)
27  {
28  return !(sourceModel()->data(index0).toString().contains("blah"));
29  }
30  }
31  return true;
32 
33 }
34 
35 }} //end namespace