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 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
10 
11 #include <QAbstractListModel>
12 #include <QList>
13 #include <QObject>
14 #include <QPointer>
15 
16 class vtkProcessModule;
17 class pqFileDialogModel;
18 class pqServer;
19 class QModelIndex;
20 
27 class PQCORE_EXPORT pqFileDialogFavoriteModel : public QAbstractListModel
28 {
29  typedef QAbstractListModel Superclass;
30 
31  Q_OBJECT
32 
33 public:
38  pqFileDialogFavoriteModel(pqFileDialogModel* model, pqServer* server, QObject* Parent);
39  ~pqFileDialogFavoriteModel() override;
40 
44  QString filePath(const QModelIndex&) const;
48  bool isDirectory(const QModelIndex&) const;
49 
53  QVariant data(const QModelIndex& idx, int role) const override;
54 
58  int rowCount(const QModelIndex& idx) const override;
59 
63  bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
64 
68  Qt::ItemFlags flags(const QModelIndex& index) const override;
69 
73  QVariant headerData(int section, Qt::Orientation, int role) const override;
74 
78  virtual void addToFavorites(QString const& dirPath);
79 
83  virtual void removeFromFavorites(QString const& dirPath);
84 
88  virtual void resetFavoritesToDefault();
89 
94  PARAVIEW_DEPRECATED_IN_5_12_0("Use pqFileDialogLocationModel::AddExamplesInLocations instead")
95  static bool AddExamplesInFavorites;
96 
97 protected:
99  {
100  QString Label;
101  QString FilePath;
102  int Type;
103  };
104 
105  QPointer<pqFileDialogModel> FileDialogModel;
106  pqServer* Server = nullptr;
107  QList<pqFileDialogFavoriteModelFileInfo> FavoriteList;
108  QString SettingsKey;
109 };
110 
111 #endif // !pqFileDialogFavoriteModel_h
data
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
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