24 #ifndef __ctkPathListWidget_h 25 #define __ctkPathListWidget_h 31 #include "ctkWidgetsExport.h" 33 class ctkPathListWidgetPrivate;
52 Q_PROPERTY(QStringList paths READ paths WRITE setPaths NOTIFY pathsChanged)
55 Q_PROPERTY(
Mode mode READ mode WRITE setMode)
58 Q_PROPERTY(PathOptions fileOptions READ fileOptions WRITE setFileOptions)
61 Q_PROPERTY(PathOptions directoryOptions READ directoryOptions WRITE setDirectoryOptions)
64 Q_PROPERTY(QIcon fileIcon READ fileIcon WRITE setFileIcon RESET unsetFileIcon)
67 Q_PROPERTY(QIcon directoryIcon READ directoryIcon WRITE setDirectoryIcon RESET unsetDirectoryIcon)
77 AbsolutePathRole = Qt::UserRole + 1
119 QIcon fileIcon()
const;
123 void setFileIcon(
const QIcon& icon);
126 void unsetFileIcon();
129 QIcon directoryIcon()
const;
133 void setDirectoryIcon(
const QIcon& icon);
136 void unsetDirectoryIcon();
139 PathOptions fileOptions()
const;
143 void setFileOptions(PathOptions fileOptions);
146 PathOptions directoryOptions()
const;
150 void setDirectoryOptions(PathOptions directoryOptions);
154 bool contains(
const QString& path)
const;
159 QStringList files(
bool absolutePath =
false)
const;
164 QStringList directories(
bool absolutePath =
false)
const;
169 QStringList paths(
bool absolutePath =
false)
const;
174 QStringList selectedPaths(
bool absolutePath =
false)
const;
179 QString currentPath(
bool absolutePath =
false)
const;
185 QString path(
int row)
const;
188 QStandardItem* item(
int row)
const;
191 QStandardItem* item(
const QString& absolutePath)
const;
195 QString pathAt(
const QPoint& point)
const;
199 QStandardItem* itemAt(
const QPoint& point)
const;
205 QStandardItem*
itemAt(
int x,
int y)
const {
return itemAt(QPoint(x, y)); }
209 int row(
const QString& path)
const;
216 bool editPath(
const QString& oldPath,
const QString& newPath);
223 bool editPath(
const QModelIndex& index,
const QString& newPath);
227 bool isFile(
const QString& path)
const;
231 bool isDirectory(
const QString& path)
const;
237 void setMode(
Mode mode);
244 bool addPath(
const QString& path);
251 QStringList addPaths(
const QStringList& paths);
259 void setPaths(
const QStringList& paths);
267 bool removePath(
const QString& path);
272 QStringList removePaths(
const QStringList& paths);
275 void removeSelectedPaths();
285 void pathsChanged(
const QStringList& added,
const QStringList& removed);
288 void pathClicked(
const QString& absolutePath);
291 void pathDoubleClicked(
const QString& absolutePath);
297 void pathActivated(
const QString& absolutePath);
302 void currentPathChanged(
const QString& currentAbsolutePath,
const QString& previousAbsolutePath);
305 QScopedPointer<ctkPathListWidgetPrivate>
d_ptr;
309 void setModel(QAbstractItemModel *model);
314 Q_PRIVATE_SLOT(d_func(),
void _q_emitPathClicked(
const QModelIndex& index))
315 Q_PRIVATE_SLOT(d_func(),
void _q_emitPathDoubleClicked(
const QModelIndex& index))
316 Q_PRIVATE_SLOT(d_func(),
void _q_emitPathActivated(
const QModelIndex& index))
317 Q_PRIVATE_SLOT(d_func(),
void _q_emitCurrentPathChanged(
const QModelIndex &previous,
const QModelIndex ¤t))
Q_DECLARE_OPERATORS_FOR_FLAGS(ctkVTKDataSetModel::AttributeTypes)