pqFileDialogFavoriteModel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqFileDialogFavoriteModel_h
6 #define pqFileDialogFavoriteModel_h
7 
8 #include "pqCoreModule.h"
9 
10 #include <QAbstractListModel>
11 #include <QList>
12 #include <QObject>
13 #include <QPointer>
14 
15 class vtkProcessModule;
16 class pqFileDialogModel;
17 class pqServer;
18 class QModelIndex;
19 
26 class PQCORE_EXPORT pqFileDialogFavoriteModel : public QAbstractListModel
27 {
28  typedef QAbstractListModel Superclass;
29 
30  Q_OBJECT
31 
32 public:
37  pqFileDialogFavoriteModel(pqFileDialogModel* model, pqServer* server, QObject* Parent);
38  ~pqFileDialogFavoriteModel() override;
39 
43  QString filePath(const QModelIndex&) const;
47  bool isDirectory(const QModelIndex&) const;
48 
52  QVariant data(const QModelIndex& idx, int role) const override;
53 
57  int rowCount(const QModelIndex& idx) const override;
58 
62  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
63 
67  Qt::ItemFlags flags(const QModelIndex& index) const override;
68 
72  QVariant headerData(int section, Qt::Orientation, int role) const override;
73 
77  virtual void addToFavorites(QString const& dirPath);
78 
82  virtual void removeFromFavorites(QString const& dirPath);
83 
87  virtual void resetFavoritesToDefault();
88 
89 protected:
91  {
92  QString Label;
93  QString FilePath;
94  int Type;
95  };
96 
97  QPointer<pqFileDialogModel> FileDialogModel;
98  pqServer* Server = nullptr;
99  QList<pqFileDialogFavoriteModelFileInfo> FavoriteList;
100  QString SettingsKey;
101 };
102 
103 #endif // !pqFileDialogFavoriteModel_h
data
QPointer< pqFileDialogModel > FileDialogModel
QList< pqFileDialogFavoriteModelFileInfo > FavoriteList
pqFileDialogModel allows remote browsing of a connected ParaView server&#39;s filesystem, as well as browsing of the local file system.
pqFileDialogFavoriteModel allows remote browsing of a connected ParaView server&#39;s filesystem...
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
value
index
process initialization and management core for ParaView processes.
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35