FileScheme.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2015 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
19 #ifndef RQT_MULTIPLOT_FILE_SCHEME_H
20 #define RQT_MULTIPLOT_FILE_SCHEME_H
21 
22 #include <QDir>
23 #include <QFileSystemModel>
24 
26 
27 namespace rqt_multiplot {
28  class FileScheme :
29  public UrlScheme {
30  Q_OBJECT
31  public:
32  FileScheme(QObject* parent = 0, const QString& prefix = "file", const
33  QString& rootPath = "/", QDir::Filters filter = QDir::NoFilter);
34  virtual ~FileScheme();
35 
36  void setRootPath(const QString& rootPath);
37  QString getRootPath() const;
38  void setFilter(QDir::Filters filter);
39  QDir::Filters getFilter() const;
40 
41  size_t getNumHosts() const;
42  QModelIndex getHostIndex(size_t row) const;
43  QVariant getHostData(const QModelIndex& index, int role) const;
44 
45  size_t getNumPaths(const QModelIndex& hostIndex, const QModelIndex&
46  parent) const;
47  QModelIndex getPathIndex(const QModelIndex& hostIndex, size_t row,
48  const QModelIndex& parent = QModelIndex()) const;
49  QVariant getPathData(const QModelIndex& index, int role) const;
50 
51  QString getHost(const QModelIndex& hostIndex) const;
52  QString getPath(const QModelIndex& hostIndex, const QModelIndex&
53  pathIndex) const;
54 
55  QString getFilePath(const QModelIndex& hostIndex, const QModelIndex&
56  pathIndex) const;
57  QString getFilePath(const QString& host, const QString& path) const;
58 
59  private:
60  QFileSystemModel* model_;
61 
62  private slots:
63  void modelDirectoryLoaded(const QString& path);
64  };
65 };
66 
67 #endif
void setFilter(QDir::Filters filter)
Definition: FileScheme.cpp:53
QVariant getPathData(const QModelIndex &index, int role) const
Definition: FileScheme.cpp:95
QString getFilePath(const QModelIndex &hostIndex, const QModelIndex &pathIndex) const
Definition: FileScheme.cpp:116
void modelDirectoryLoaded(const QString &path)
Definition: FileScheme.cpp:133
FileScheme(QObject *parent=0, const QString &prefix="file", const QString &rootPath="/", QDir::Filters filter=QDir::NoFilter)
Definition: FileScheme.cpp:27
QString getPath(const QModelIndex &hostIndex, const QModelIndex &pathIndex) const
Definition: FileScheme.cpp:110
QVariant getHostData(const QModelIndex &index, int role) const
Definition: FileScheme.cpp:69
QString getRootPath() const
Definition: FileScheme.cpp:49
void setRootPath(const QString &rootPath)
Definition: FileScheme.cpp:45
QDir::Filters getFilter() const
Definition: FileScheme.cpp:57
QModelIndex getHostIndex(size_t row) const
Definition: FileScheme.cpp:65
QFileSystemModel * model_
Definition: FileScheme.h:60
QString getHost(const QModelIndex &hostIndex) const
Definition: FileScheme.cpp:106
QModelIndex getPathIndex(const QModelIndex &hostIndex, size_t row, const QModelIndex &parent=QModelIndex()) const
Definition: FileScheme.cpp:87
size_t getNumPaths(const QModelIndex &hostIndex, const QModelIndex &parent) const
Definition: FileScheme.cpp:73
size_t getNumHosts() const
Definition: FileScheme.cpp:61


rqt_multiplot
Author(s): Ralf Kaestner
autogenerated on Wed Jul 10 2019 03:49:44