Implement class for handling filesystem paths

PR #15915.
This commit is contained in:
Vladimir Golovnev
2022-02-08 06:03:48 +03:00
committed by GitHub
parent facfa26eed
commit dd1bd8ad10
131 changed files with 2252 additions and 1868 deletions

View File

@@ -30,6 +30,8 @@
#include <QWidget>
#include "base/path.h"
namespace Private
{
class FileComboEdit;
@@ -45,7 +47,7 @@ class FileSystemPathEdit : public QWidget
{
Q_OBJECT
Q_PROPERTY(Mode mode READ mode WRITE setMode)
Q_PROPERTY(QString selectedPath READ selectedPath WRITE setSelectedPath NOTIFY selectedPathChanged)
Q_PROPERTY(Path selectedPath READ selectedPath WRITE setSelectedPath NOTIFY selectedPathChanged)
Q_PROPERTY(QString fileNameFilter READ fileNameFilter WRITE setFileNameFilter)
Q_PROPERTY(QString dialogCaption READ dialogCaption WRITE setDialogCaption)
@@ -64,14 +66,14 @@ public:
Mode mode() const;
void setMode(Mode mode);
QString selectedPath() const;
void setSelectedPath(const QString &val);
Path selectedPath() const;
void setSelectedPath(const Path &val);
QString fileNameFilter() const;
void setFileNameFilter(const QString &val);
QString placeholder() const;
void setPlaceholder(const QString &val);
Path placeholder() const;
void setPlaceholder(const Path &val);
/// The browse button caption is "..." if true, and "Browse" otherwise
bool briefBrowseButtonCaption() const;
@@ -83,7 +85,7 @@ public:
virtual void clear() = 0;
signals:
void selectedPathChanged(const QString &path);
void selectedPathChanged(const Path &path);
protected:
explicit FileSystemPathEdit(Private::FileEditorWithCompletion *editor, QWidget *parent);
@@ -136,9 +138,9 @@ public:
void clear() override;
int count() const;
QString item(int index) const;
void addItem(const QString &text);
void insertItem(int index, const QString &text);
Path item(int index) const;
void addItem(const Path &path);
void insertItem(int index, const Path &path);
int currentIndex() const;
void setCurrentIndex(int index);