8#include <QCoreApplication>
9#include <QDesktopServices>
25 QFileInfoList entries = d.entryInfoList(
26 QDir::NoDotAndDotDot | QDir::AllEntries, QDir::DirsFirst | QDir::Name);
27 for (
const QFileInfo& fi : entries) {
38 return QCoreApplication::applicationDirPath();
42 const QString trimmed = path.trimmed();
43 if (trimmed.isEmpty()) {
47 const QFileInfo info(trimmed);
50 folderPath = info.isDir() ? info.absoluteFilePath() : info.absolutePath();
52 const QDir dir(trimmed);
54 folderPath = dir.absolutePath();
57 return !folderPath.isEmpty() &&
58 QDesktopServices::openUrl(QUrl::fromLocalFile(folderPath));
Declares the UI helper that exposes a minimal filesystem view to QML.
Declarations for the UI PayloadKeys component.
Q_INVOKABLE QVariantList listDir(const QString &path) const
List the contents of a directory in a QML-friendly payload shape.
Q_INVOKABLE bool openLocation(const QString &path) const
Opens the containing folder for a file or directory path.
Q_INVOKABLE QString appDir() const
Return the current application directory path.
FileSystemBrowser(QObject *parent=nullptr)
Create the filesystem helper exposed to QML.