Choreonoid  1.8
FileDialog.h
Go to the documentation of this file.
1 #ifndef CNOID_BASE_FILE_DIALOG_H
2 #define CNOID_BASE_FILE_DIALOG_H
3 
4 #include <cnoid/Signal>
5 #include <QFileDialog>
6 #include "exportdecl.h"
7 
8 namespace cnoid {
9 
10 class CNOID_EXPORT FileDialog : public QDialog
11 {
12 public:
13  FileDialog();
14  FileDialog(QWidget* parent, Qt::WindowFlags f = 0);
15  ~FileDialog();
16 
17  void updatePresetDirectories();
18  bool selectFilePath(const std::string& filePath);
19  void insertOptionPanel(QWidget* panel);
20 
21  SignalProxy<void(int index)> sigFilterSelected();
22  SignalProxy<bool(int result), LogicalProduct> sigAboutToFinished();
23 
24  virtual int exec() override;
25 
26  // Internal QFileDialog object
27  QFileDialog* fileDialog();
28 
29  // Functions delegated to the internal QFileDialog object
30  QDir directory() const;
31  QStringList nameFilters() const;
32  QStringList selectedFiles() const;
33  void selectFile(const QString& filename);
34  void selectFile(const std::string& filename);
35  void setAcceptMode(QFileDialog::AcceptMode mode);
36  void setDirectory(const QString& directory);
37  void setDirectory(const std::string& directory);
38  void setFileMode(QFileDialog::FileMode mode);
39  void setLabelText(QFileDialog::DialogLabel label, const QString& text);
40  void setNameFilter(const QString& filter);
41  void setNameFilters(const QStringList& filters);
42  void setOption(QFileDialog::Option option, bool on = true);
43  void setViewMode(QFileDialog::ViewMode mode);
44 
45  // Util functions
46  void selectNameFilter(int index);
47 
48 private:
49  class Impl;
50  Impl* impl;
51 };
52 
53 
54 }
55 
56 #endif
cnoid::FileDialog
Definition: FileDialog.h:10
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::LogicalProduct
Definition: Signal.h:429
cnoid::SignalProxy
Definition: Signal.h:470