VAPOR3 3.9.4
PFileButton.h
Go to the documentation of this file.
1#pragma once
2
3#include "PWidget.h"
4
5class VPushButton;
6class QString;
7
8
12
13class PFileButton : public PWidget {
14 Q_OBJECT
15
16private:
17 typedef std::function<void(std::string)> Callback;
18 Callback _cb;
19 VPushButton* _button;
20
21public:
22 PFileButton(const std::string label, Callback cb);
24 PFileButton *SetFileTypeFilter(const std::string &filter);
25 // PFileButton *UseDefaultPathSetting(const std::string &tag);
26
27protected:
28 QString _fileTypeFilter = "All Files (*)";
29
30 void updateGUI() const override;
31 bool requireParamsMgr() const override;
32 virtual QString selectPath(const std::string &defaultPath) const = 0;
33
34//private slots:
35 void clicked();
36};
37
41
42class PFileReader : public PFileButton {
43 Q_OBJECT
44public:
46
47protected:
48 virtual QString selectPath(const std::string &defaultPath) const override;
49};
50
54
55class PFileWriter : public PFileButton {
56 Q_OBJECT
57public:
59
60protected:
61 virtual QString selectPath(const std::string &defaultPath) const override;
62};
QString _fileTypeFilter
Definition: PFileButton.h:28
void clicked()
PFileButton(const std::string label, Callback cb)
virtual QString selectPath(const std::string &defaultPath) const =0
PFileButton * SetFileTypeFilter(const std::string &filter)
Sets the fileTypeFilter parameter in the QFileDialog popup functions.
void updateGUI() const override
bool requireParamsMgr() const override
virtual QString selectPath(const std::string &defaultPath) const override
virtual QString selectPath(const std::string &defaultPath) const override