21 #ifndef VFILEPROPERTY_H
22 #define VFILEPROPERTY_H
24 #include <qcompilerdetection.h>
25 #include <QMetaObject>
29 #include <QStringList>
30 #include <QStyleOptionViewItem>
35 #include "../vproperty.h"
56 virtual void setFile(
const QString& file);
59 virtual QString
getFile()
const;
62 virtual QVariant
data (
int column =
DPC_Name,
int role = Qt::DisplayRole)
const Q_DECL_OVERRIDE;
69 virtual QWidget*
createEditor(QWidget* parent,
const QStyleOptionViewItem& options,
70 const QAbstractItemDelegate* delegate) Q_DECL_OVERRIDE;
76 virtual QVariant
getEditorData(
const QWidget* editor)
const Q_DECL_OVERRIDE;
81 virtual void setSetting(
const QString& key,
const QVariant& value) Q_DECL_OVERRIDE;
84 virtual QVariant
getSetting(
const QString& key)
const Q_DECL_OVERRIDE;
90 virtual QString
type()
const Q_DECL_OVERRIDE;
97 Q_REQUIRED_RESULT
virtual VProperty*
clone(
bool include_children =
true,
98 VProperty* container =
nullptr)
const Q_DECL_OVERRIDE;
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &options, const QAbstractItemDelegate *delegate) Q_DECL_OVERRIDE
Returns an editor widget, or NULL if it doesn't supply one.
virtual QString getFileFilters() const
Returns the current file filters as a string.
virtual bool isDirectory() const
Returns whether this is a file (false) or a directory (true)
virtual QString type() const Q_DECL_OVERRIDE
Returns a string containing the type of the property.
virtual Q_REQUIRED_RESULT VProperty * clone(bool include_children=true, VProperty *container=nullptr) const Q_DECL_OVERRIDE
Clones this property.
virtual ~VFileProperty() Q_DECL_OVERRIDE
The destructor.
VFileProperty(const QString &name)
virtual QVariant data(int column=DPC_Name, int role=Qt::DisplayRole) const Q_DECL_OVERRIDE
Get the data how it should be displayed.
virtual QVariant getSetting(const QString &key) const Q_DECL_OVERRIDE
Get the settings. This function has to be implemented in a subclass in order to have an effect.
virtual void setDirectory(bool is_directory)
Sets whether this is a file (false) or a directory (true)
virtual bool setEditorData(QWidget *editor) Q_DECL_OVERRIDE
Sets the property's data to the editor (returns false, if the standard delegate should do that)
virtual void setFile(const QString &file)
Set file.
virtual QVariant getEditorData(const QWidget *editor) const Q_DECL_OVERRIDE
Gets the data from the widget.
virtual void setSetting(const QString &key, const QVariant &value) Q_DECL_OVERRIDE
Sets the settings. Available settings:
virtual QStringList getSettingKeys() const Q_DECL_OVERRIDE
Returns the list of keys of the property's settings.
virtual void setFileFilters(const QString &filefilters)
Sets the file filters. The file filters have to be like the ones passed a QFileOpenDialog.
virtual QString getFile() const
Get file.