Quarts/Quartz/UrlHelper.h
Станислав Хозяенок 529e0085af Поправлен баг
2025-05-29 11:12:21 +07:00

28 lines
574 B
C++

// urlhelper.h
#ifndef URLHELPER_H
#define URLHELPER_H
#include <QObject>
#include <QUrl>
class UrlHelper : public QObject
{
Q_OBJECT
public:
explicit UrlHelper(QObject *parent = nullptr) {}
Q_INVOKABLE QString fromLocalFile(const QString &localPath) {
return QUrl::fromLocalFile(localPath).toString();
}
Q_INVOKABLE QUrl fromLocalFileUrl(const QString &localPath) {
return QUrl::fromLocalFile(localPath);
}
Q_INVOKABLE QString toLocalFile(const QUrl &url) {
return url.toLocalFile();
}
};
#endif // URLHELPER_H