mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-21 23:50:26 +00:00
Keep a singleton ComputerManager outside of the Models
This commit is contained in:
@@ -30,6 +30,11 @@ int main(int argc, char *argv[])
|
||||
// Register our C++ types for QML
|
||||
qmlRegisterType<ComputerModel>("ComputerModel", 1, 0, "ComputerModel");
|
||||
qmlRegisterType<AppModel>("AppModel", 1, 0, "AppModel");
|
||||
qmlRegisterSingletonType<ComputerManager>("ComputerManager", 1, 0,
|
||||
"ComputerManager",
|
||||
[](QQmlEngine*, QJSEngine*) -> QObject* {
|
||||
return new ComputerManager();
|
||||
});
|
||||
|
||||
// Load the main.qml file
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
Reference in New Issue
Block a user