-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathruntimeqml.hpp
45 lines (33 loc) · 1.13 KB
/
runtimeqml.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <QObject>
#include <QQmlApplicationEngine>
#include <QScopedPointer>
class RuntimeQmlPrivate;
class RuntimeQml : public QObject
{
Q_OBJECT
Q_PROPERTY(bool autoReload READ autoReload WRITE setAutoReload NOTIFY autoReloadChanged)
public:
explicit RuntimeQml(QQmlApplicationEngine* engine, QObject* parent = nullptr);
~RuntimeQml() override;
void parseQrc(QString const& qrcFilename);
void load(QUrl const& url);
void setReloadUrl(QUrl const& url);
QUrl const& reloadUrl() const;
//! Reload the main QML file.
Q_INVOKABLE void reload();
Q_INVOKABLE bool isReloading() const;
bool autoReload() const;
void setAutoReload(bool autoReload);
void addFileSuffixFilter(QString const& suffix);
QList<QString> const& allowedSuffixes() const;
void addIgnoreFilter(QString const& filter);
void addQrcPrefixIgnoreFilter(QString const& prefix);
QList<QString> const& ignoreFiltersList() const;
signals:
void autoReloadChanged(bool autoReload);
void reloaded();
private:
Q_DECLARE_PRIVATE_D(dd_ptr, RuntimeQml)
QScopedPointer<RuntimeQmlPrivate> dd_ptr;
};