RhythmGame 1.4.3
Loading...
Searching...
No Matches
QmlUtils.h
Go to the documentation of this file.
1//
2// Created by PC on 08/06/2025.
3//
4
5#ifndef QMLUTILS_H
6#define QMLUTILS_H
7#include <QObject>
8#include <QQmlEngine>
9#include <QQuickItem>
10#include <qqmlcontext.h>
11#include <qqmlintegration.h>
12
13namespace qml_components {
14
20class QmlUtilsAttached : public QObject
21{
22 Q_OBJECT
23 QML_ATTACHED(QmlUtilsAttached)
24 QML_ELEMENT
28 Q_PROPERTY(QString themeName READ themeName CONSTANT)
32 Q_PROPERTY(QString fileName READ fileName CONSTANT)
33
34 public:
35 inline static std::function<QString(const QUrl&)>
37 static auto qmlAttachedProperties(QObject* object) -> QmlUtilsAttached*;
38 explicit QmlUtilsAttached(QObject* parent = nullptr);
39 auto themeName() const -> QString;
40 auto fileName() const -> QString;
41 Q_INVOKABLE QString folderName(const QString& path) const;
46 Q_INVOKABLE void adopt(QObject* object) const;
47};
48
49} // namespace qml_components
50
51#endif // QMLUTILS_H
QString path
Definition Lr2SkinParser.cpp:87
Provides utility functions for QML as an attached property.
Definition QmlUtils.h:21
Q_INVOKABLE QString folderName(const QString &path) const
Definition QmlUtils.cpp:43
static std::function< QString(const QUrl &)> getThemeNameForRootFile
Definition QmlUtils.h:36
Q_INVOKABLE void adopt(QObject *object) const
Transfers object to the attached object's QObject ownership.
Definition QmlUtils.cpp:48
QML_ELEMENTQString themeName
The name of the theme that this QML file belongs to.
Definition QmlUtils.h:28
static auto qmlAttachedProperties(QObject *object) -> QmlUtilsAttached *
Definition QmlUtils.cpp:10
QString fileName
The file name of the QML file that this object is attached to.
Definition QmlUtils.h:32
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9