Make the Controller a singleton

This commit is contained in:
Tobias Fella
2020-11-04 01:43:13 +00:00
committed by Nicolas Fella
parent 1739a454da
commit 2d1a7d6500
13 changed files with 42 additions and 66 deletions

View File

@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
app.setApplicationName("neochat");
app.setWindowIcon(QIcon(":/assets/img/icon.png"));
qmlRegisterType<Controller>("Spectral", 0, 1, "Controller");
qmlRegisterSingletonInstance("Spectral", 0, 1, "Controller", &Controller::instance());
qmlRegisterType<AccountListModel>("Spectral", 0, 1, "AccountListModel");
qmlRegisterType<RoomListModel>("Spectral", 0, 1, "RoomListModel");
qmlRegisterType<UserListModel>("Spectral", 0, 1, "UserListModel");