PathListEditor Class

(Utils::PathListEditor)

The PathListEditor class is a control that lets the user edit a list of (directory) paths using the platform separator (';',':'). More...

Header: #include <PathListEditor>

Properties

Public Functions

PathListEditor(QWidget *parent = nullptr)
~PathListEditor() override
void clear()
QString fileDialogTitle() const
QStringList pathList() const
QString pathListString() const
void setFileDialogTitle(const QString &l)
void setPathList(const QStringList &l)
void setPathList(const QString &pathString)

Protected Functions

QPushButton *addButton(const QString &text, QObject *parent, std::function<void() > slotFunc)
void deletePathAtCursor()
QPushButton *insertButton(int index, const QString &text, QObject *parent, std::function<void() > slotFunc)
void insertPathAtCursor(const QString &)
void setText(const QString &)
QString text() const

Detailed Description

The PathListEditor class is a control that lets the user edit a list of (directory) paths using the platform separator (';',':').

Typically used for path lists controlled by environment variables, such as PATH. It is based on a QPlainTextEdit as it should allow for convenient editing and non-directory type elements like


  "etc/mydir1:$SPECIAL_SYNTAX:/etc/mydir2".

When pasting text into it, the platform separator will be replaced by new line characters for convenience.

Property Documentation

fileDialogTitle : QString

Access functions:

QString fileDialogTitle() const
void setFileDialogTitle(const QString &l)

pathList : QStringList

Access functions:

QStringList pathList() const
void setPathList(const QStringList &l)
void setPathList(const QString &pathString)

Member Function Documentation

PathListEditor::PathListEditor(QWidget *parent = nullptr)

Default constructs an instance of PathListEditor.

PathListEditor::~PathListEditor()

Destroys the instance of PathListEditor.

[protected] QPushButton *PathListEditor::addButton(const QString &text, QObject *parent, std::function<void() > slotFunc)

void PathListEditor::clear()

[protected] void PathListEditor::deletePathAtCursor()

[protected] QPushButton *PathListEditor::insertButton(int index, const QString &text, QObject *parent, std::function<void() > slotFunc)

[protected] void PathListEditor::insertPathAtCursor(const QString &)

QString PathListEditor::pathListString() const

[protected] void PathListEditor::setText(const QString &)

See also text().

[protected] QString PathListEditor::text() const

See also setText().