Skip to content

Commit

Permalink
main: Fix abstractlink register
Browse files Browse the repository at this point in the history
Move from qmlRegisterType to qmlRegisterUncreatableType
Since AbstractLink is an class that will only be created in C++ code,
it should be register as qmlRegisterUncreatableType.

The QML code should only provide the LinkConfiguration object to
create the connection and the communication link

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Oct 11, 2019
1 parent 8bb3363 commit 63f9308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ int main(int argc, char *argv[])
qmlRegisterSingletonType<Util>("Util", 1, 0, "Util", Util::qmlSingletonRegister);

// Normal register
qmlRegisterType<AbstractLink>("AbstractLink", 1, 0, "AbstractLink");
qmlRegisterUncreatableType<AbstractLink>("AbstractLink", 1, 0, "AbstractLink",
"Link abstraction class can't be created.");
qmlRegisterType<Flasher>("Flasher", 1, 0, "Flasher");
qmlRegisterType<LinkConfiguration>("LinkConfiguration", 1, 0, "LinkConfiguration");
qmlRegisterType<Ping>("Ping", 1, 0, "Ping");
Expand Down

0 comments on commit 63f9308

Please sign in to comment.