scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Folder Class Reference

Folder for the project explorer. More...

#include <Folder.h>

Inheritance diagram for Folder:
[legend]
Collaboration diagram for Folder:
[legend]

Public Member Functions

 Folder (const QString &name)
 
QList< MyWidget * > windowsList ()
 
void addWindow (MyWidget *w)
 
void removeWindow (MyWidget *w)
 
int windowCount (bool recursive=false) const
 
QStringList subfolders ()
 The list of subfolder names, including first generation children only. More...
 
QList< Folder * > folders () const
 The list of subfolders. More...
 
FolderfindSubfolder (const QString &s, bool caseSensitive=true, bool partialMatch=false)
 Pointer to the subfolder called s. More...
 
MyWidgetfindWindow (const QString &s, bool windowNames, bool labels, bool caseSensitive, bool partialMatch)
 Pointer to the first window matching the search criteria. More...
 
MyWidgetwindow (const QString &name, const char *cls="myWidget", bool recursive=false)
 get a window by name More...
 
Tabletable (const QString &name, bool recursive=false)
 Return table named name or NULL. More...
 
Matrixmatrix (const QString &name, bool recursive=false)
 Return matrix named name or NULL. More...
 
MultiLayergraph (const QString &name, bool recursive=false)
 Return graph named name or NULL. More...
 
Notenote (const QString &name, bool recursive=false)
 Return note named name or NULL. More...
 
QString path ()
 The complete path of the folder in the project tree. More...
 
FolderrootFolder ()
 The root of the hierarchy this folder belongs to. More...
 
QString birthDate ()
 
void setBirthDate (const QString &s)
 
QString modificationDate ()
 
void setModificationDate (const QString &s)
 
FolderListItemfolderListItem ()
 Pointer to the corresponding QListViewItem in the main application. More...
 
void setFolderListItem (FolderListItem *it)
 
MyWidgetactiveWindow ()
 
void setActiveWindow (MyWidget *w)
 
QString name ()
 
void setName (const QString &s)
 
T & addChild (A... args)
 generic factory function to add a child object, to avoid bare pointers More...
 

Protected Attributes

QString birthdate
 
QString modifDate
 
QList< MyWidget * > lstWindows
 
FolderListItemmyFolderListItem
 
MyWidgetd_active_window
 Pointer to the active window in the folder. More...
 

Private Member Functions

void m_setParent (QObject *child, QObject *parent)
 
void m_setParent (QWidget *child, QWidget *parent)
 

Detailed Description

Folder for the project explorer.

Definition at line 61 of file Folder.h.

Constructor & Destructor Documentation

◆ Folder()

Folder::Folder ( const QString &  name)

File : Folder.cpp

Project : SciDAVis

Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert, Knut Franke Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net, knut.franke*gmx.de Description : Folder for the project explorer

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
    • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
    • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Definition at line 50 of file Folder.cpp.

51  : d_active_window(0)
52 {
53  QObject::setObjectName(name);
54  birthdate = QDateTime::currentDateTime ().toString(Qt::LocalDate);
55 
56  // FIXME: This doesn't work anymore in Qt4, need alternative method
57  // lstWindows.setAutoDelete( true );
58 }

References birthdate, and name().

Here is the call graph for this function:

Member Function Documentation

◆ activeWindow()

MyWidget* Folder::activeWindow ( )
inline

Definition at line 133 of file Folder.h.

133 {return d_active_window;};

References d_active_window.

Referenced by ApplicationWindow::changeFolder(), and ApplicationWindow::windowGeometryInfo().

Here is the caller graph for this function:

◆ addChild()

T& SciDAVisObject< QObject >::addChild ( A...  args)
inlineinherited

generic factory function to add a child object, to avoid bare pointers

Definition at line 21 of file SciDAVisObject.h.

21  {
22  T* child=new T(std::forward<A>(args)...);
23  m_setParent(child,this);
24  return *child;
25  }

◆ addWindow()

void Folder::addWindow ( MyWidget w)
inline

Definition at line 70 of file Folder.h.

70  {
71  w->setFolder(this);
72  lstWindows.append( w );
73  };

References lstWindows, and MyWidget::setFolder().

Referenced by ImportOPJ::createProjectTree(), ApplicationWindow::dropFolderItems(), ApplicationWindow::initBareMultilayerPlot(), ApplicationWindow::initMatrix(), ApplicationWindow::initNote(), ApplicationWindow::initPlot3D(), ApplicationWindow::initTable(), and ApplicationWindow::moveFolder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ birthDate()

QString Folder::birthDate ( )
inline

Definition at line 123 of file Folder.h.

123 {return birthdate;};

References birthdate.

Referenced by ApplicationWindow::addFolderListViewItem(), ApplicationWindow::folderProperties(), ApplicationWindow::moveFolder(), ApplicationWindow::projectProperties(), and ApplicationWindow::rawSaveFolder().

Here is the caller graph for this function:

◆ findSubfolder()

Folder * Folder::findSubfolder ( const QString &  s,
bool  caseSensitive = true,
bool  partialMatch = false 
)

Pointer to the subfolder called s.

Definition at line 91 of file Folder.cpp.

92 {
93  QObjectList folderList = children();
94  if (!folderList.isEmpty()){
95  QObject * f;
96 
97  foreach(f,folderList){
98  QString name = static_cast<Folder *>(f)->name();
99  if (partialMatch){
100  if (caseSensitive && name.startsWith(s,Qt::CaseSensitive))
101  return static_cast<Folder *>(f);
102  else if (!caseSensitive && name.startsWith(s,Qt::CaseInsensitive))
103  return static_cast<Folder *>(f);
104  }
105  else // partialMatch == false
106  {
107  if (caseSensitive && name == s)
108  return static_cast<Folder *>(f);
109  else if ( !caseSensitive && (name.toLower() == s.toLower()) )
110  return static_cast<Folder *>(f);
111  }
112  }
113  }
114  return 0;
115 }

References name().

Referenced by ApplicationWindow::appendProject(), ApplicationWindow::find(), ApplicationWindow::loadProject(), and MuParserScript::resolveColumnPath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findWindow()

MyWidget * Folder::findWindow ( const QString &  s,
bool  windowNames,
bool  labels,
bool  caseSensitive,
bool  partialMatch 
)

Pointer to the first window matching the search criteria.

Definition at line 117 of file Folder.cpp.

119 {
120  Qt::CaseSensitivity cs = Qt::CaseSensitive;
121  if (!caseSensitive)
122  cs = Qt::CaseInsensitive;
123  MyWidget* w;
124  foreach(w,lstWindows)
125  {
126  if (windowNames)
127  {
128  QString name = w->name();
129  if (partialMatch && name.startsWith(s, cs))
130  return w;
131  else if (caseSensitive && name == s)
132  return w;
133  else
134  {
135  QString text = s;
136  if (name == text.toLower())
137  return w;
138  }
139  }
140 
141  if (labels)
142  {
143  QString label = w->windowLabel();
144  if (partialMatch && label.startsWith(s, cs))
145  return w;
146  else if (caseSensitive && label == s)
147  return w;
148  else
149  {
150  QString text = s;
151  if (label == text.toLower())
152  return w;
153  }
154  }
155  }
156  return 0;
157 }

References lstWindows, name(), MyWidget::name(), and MyWidget::windowLabel().

Referenced by ApplicationWindow::find().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ folderListItem()

◆ folders()

QList< Folder * > Folder::folders ( ) const

The list of subfolders.

Definition at line 60 of file Folder.cpp.

61 {
62  QList<Folder*> lst;
63  foreach(QObject *f, children())
64  lst.append((Folder*) f);
65  return lst;
66 }

Referenced by ApplicationWindow::rawSaveFolder(), and windowCount().

Here is the caller graph for this function:

◆ graph()

MultiLayer* Folder::graph ( const QString &  name,
bool  recursive = false 
)
inline

Return graph named name or NULL.

Definition at line 113 of file Folder.h.

113 { return (MultiLayer*) window(name, "MultiLayer", recursive); }

References name(), and window().

Here is the call graph for this function:

◆ m_setParent() [1/2]

void SciDAVisObject< QObject >::m_setParent ( QObject *  child,
QObject *  parent 
)
inlineprivateinherited

Definition at line 9 of file SciDAVisObject.h.

10  {child->setParent(parent);}

◆ m_setParent() [2/2]

void SciDAVisObject< QObject >::m_setParent ( QWidget *  child,
QWidget *  parent 
)
inlineprivateinherited

Definition at line 12 of file SciDAVisObject.h.

13  {child->setParent(parent,child->windowFlags());}

◆ matrix()

Matrix* Folder::matrix ( const QString &  name,
bool  recursive = false 
)
inline

Return matrix named name or NULL.

Definition at line 111 of file Folder.h.

111 { return (Matrix*) window(name, "Matrix", recursive); }

References name(), and window().

Here is the call graph for this function:

◆ modificationDate()

QString Folder::modificationDate ( )
inline

Definition at line 126 of file Folder.h.

126 {return modifDate;};

References modifDate.

Referenced by ApplicationWindow::moveFolder(), and ApplicationWindow::rawSaveFolder().

Here is the caller graph for this function:

◆ name()

QString Folder::name ( )
inline

◆ note()

Note* Folder::note ( const QString &  name,
bool  recursive = false 
)
inline

Return note named name or NULL.

Definition at line 115 of file Folder.h.

115 { return (Note*) window(name, "Note", recursive); }

References name(), and window().

Here is the call graph for this function:

◆ path()

QString Folder::path ( )

The complete path of the folder in the project tree.

Definition at line 80 of file Folder.cpp.

81 {
82  QString s = "/" + QString(name()) + "/";
83  Folder *parentFolder = (Folder *)parent();
84  while (parentFolder){
85  s.prepend("/" + QString(parentFolder->name()));
86  parentFolder = (Folder *)parentFolder->parent();
87  }
88  return s;
89 }

References name().

Referenced by ApplicationWindow::folderProperties(), FindDialog::setStartPath(), and ApplicationWindow::windowProperties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeWindow()

void Folder::removeWindow ( MyWidget w)
inline

Definition at line 74 of file Folder.h.

74  {
75  w->setFolder(0);
76  lstWindows.removeAll(w);
78  };

References d_active_window, lstWindows, and MyWidget::setFolder().

Referenced by ApplicationWindow::closeWindow(), ImportOPJ::createProjectTree(), ApplicationWindow::deleteFolder(), ApplicationWindow::dropFolderItems(), and ApplicationWindow::moveFolder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rootFolder()

Folder * Folder::rootFolder ( )

The root of the hierarchy this folder belongs to.

Definition at line 173 of file Folder.cpp.

174 {
175  Folder *i = this;
176  while(i->parent())
177  i = (Folder*)i->parent();
178  return i;
179 }

Referenced by MuParserScript::resolveColumnPath(), and MuParserScript::tableColumn__Function().

Here is the caller graph for this function:

◆ setActiveWindow()

void Folder::setActiveWindow ( MyWidget w)
inline

Definition at line 134 of file Folder.h.

134 {d_active_window = w;};

References d_active_window.

Referenced by ApplicationWindow::changeFolder(), ImportOPJ::createProjectTree(), ApplicationWindow::restoreWindowGeometry(), and ApplicationWindow::windowActivated().

Here is the caller graph for this function:

◆ setBirthDate()

void Folder::setBirthDate ( const QString &  s)
inline

Definition at line 124 of file Folder.h.

124 {birthdate = s;};

References birthdate.

Referenced by ApplicationWindow::appendProject(), ImportOPJ::createProjectTree(), ApplicationWindow::loadProject(), and ApplicationWindow::moveFolder().

Here is the caller graph for this function:

◆ setFolderListItem()

void Folder::setFolderListItem ( FolderListItem it)
inline

Definition at line 131 of file Folder.h.

131 {myFolderListItem = it;};

References myFolderListItem.

Referenced by ApplicationWindow::addFolder(), ApplicationWindow::appendProject(), ApplicationWindow::ApplicationWindow(), ImportOPJ::createProjectTree(), ApplicationWindow::loadProject(), and ApplicationWindow::moveFolder().

Here is the caller graph for this function:

◆ setModificationDate()

void Folder::setModificationDate ( const QString &  s)
inline

Definition at line 127 of file Folder.h.

127 {modifDate = s;};

References modifDate.

Referenced by ApplicationWindow::appendProject(), ImportOPJ::createProjectTree(), ApplicationWindow::loadProject(), and ApplicationWindow::moveFolder().

Here is the caller graph for this function:

◆ setName()

void Folder::setName ( const QString &  s)
inline

Definition at line 138 of file Folder.h.

138 {setObjectName(s);}

Referenced by ImportOPJ::createProjectTree(), ApplicationWindow::loadProject(), ApplicationWindow::renameFolder(), and ApplicationWindow::saveProjectAs().

Here is the caller graph for this function:

◆ subfolders()

QStringList Folder::subfolders ( )

The list of subfolder names, including first generation children only.

Definition at line 68 of file Folder.cpp.

69 {
70  QStringList list = QStringList();
71  QObjectList folderList = children();
72  if (!folderList.isEmpty()){
73  QObject * f;
74  foreach(f,folderList)
75  list << static_cast<Folder *>(f)->name();
76  }
77  return list;
78 }

Referenced by ApplicationWindow::addFolder(), ApplicationWindow::appendProject(), ApplicationWindow::dropFolderItems(), ApplicationWindow::folderProperties(), ApplicationWindow::projectProperties(), and ApplicationWindow::renameFolder().

Here is the caller graph for this function:

◆ table()

Table* Folder::table ( const QString &  name,
bool  recursive = false 
)
inline

Return table named name or NULL.

Definition at line 109 of file Folder.h.

109 { return (Table*) window(name, "Table", recursive); }

References name(), and window().

Referenced by MuParserScript::resolveColumnPath(), and MuParserScript::tableColumn__Function().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ window()

MyWidget * Folder::window ( const QString &  name,
const char *  cls = "myWidget",
bool  recursive = false 
)

get a window by name

Returns the first window with given name that inherits class cls; NULL on failure. If recursive is true, do a depth-first recursive search.

Definition at line 159 of file Folder.cpp.

160 {
161  foreach (MyWidget *w, lstWindows)
162  if (w->inherits(cls) && name == w->name().mid(0,w->name().indexOf("@")))
163  return w;
164  if (!recursive) return NULL;
165  foreach (QObject *f, children())
166  {
167  MyWidget *w = ((Folder*)f)->window(name, cls, true);
168  if (w) return w;
169  }
170  return NULL;
171 }

References lstWindows, name(), and MyWidget::name().

Referenced by ImportOPJ::createProjectTree(), graph(), matrix(), note(), and table().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowCount()

int Folder::windowCount ( bool  recursive = false) const
inline

Definition at line 80 of file Folder.h.

80  {
81  int result = lstWindows.size();
82  if (recursive)
83  foreach (Folder *folder, folders())
84  result += folder->windowCount(true);
85  return result;
86  };

References folders(), lstWindows, and windowCount().

Referenced by ApplicationWindow::saveFolder(), and windowCount().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowsList()

Member Data Documentation

◆ birthdate

QString Folder::birthdate
protected

Definition at line 140 of file Folder.h.

Referenced by birthDate(), Folder(), and setBirthDate().

◆ d_active_window

MyWidget* Folder::d_active_window
protected

Pointer to the active window in the folder.

Definition at line 145 of file Folder.h.

Referenced by activeWindow(), removeWindow(), and setActiveWindow().

◆ lstWindows

QList<MyWidget *> Folder::lstWindows
protected

Definition at line 141 of file Folder.h.

Referenced by addWindow(), findWindow(), removeWindow(), window(), windowCount(), and windowsList().

◆ modifDate

QString Folder::modifDate
protected

Definition at line 140 of file Folder.h.

Referenced by modificationDate(), and setModificationDate().

◆ myFolderListItem

FolderListItem* Folder::myFolderListItem
protected

Definition at line 142 of file Folder.h.

Referenced by folderListItem(), and setFolderListItem().


The documentation for this class was generated from the following files:
Matrix
Matrix worksheet class.
Definition: Matrix.h:52
Folder::birthdate
QString birthdate
Definition: Folder.h:140
MultiLayer
An MDI window (MyWidget) managing one or more Graph objects.
Definition: MultiLayer.h:67
MyWidget::windowLabel
virtual QString windowLabel()
Return the window label.
Definition: MyWidget.h:76
Folder::modifDate
QString modifDate
Definition: Folder.h:140
MyWidget
Base class of all MDI client windows.
Definition: MyWidget.h:52
MyWidget::name
virtual QString name()
Return the window name.
Definition: MyWidget.h:81
Folder::myFolderListItem
FolderListItem * myFolderListItem
Definition: Folder.h:142
Folder::windowCount
int windowCount(bool recursive=false) const
Definition: Folder.h:80
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:51
Folder::folders
QList< Folder * > folders() const
The list of subfolders.
Definition: Folder.cpp:60
MyWidget::setFolder
void setFolder(Folder *f)
Initializes the pointer to the parent folder of the window.
Definition: MyWidget.h:131
SciDAVisObject< QObject >::m_setParent
void m_setParent(QObject *child, QObject *parent)
Definition: SciDAVisObject.h:9
Folder::window
MyWidget * window(const QString &name, const char *cls="myWidget", bool recursive=false)
get a window by name
Definition: Folder.cpp:159
Folder::name
QString name()
Definition: Folder.h:137
Folder
Folder for the project explorer.
Definition: Folder.h:62
Folder::lstWindows
QList< MyWidget * > lstWindows
Definition: Folder.h:141
Folder::d_active_window
MyWidget * d_active_window
Pointer to the active window in the folder.
Definition: Folder.h:145
Note
Notes window class.
Definition: Note.h:44