Skip to content

Commit

Permalink
Register abstract types as uncreatable types
Browse files Browse the repository at this point in the history
Qt now detects missuse of qmlRegisterType() at compile time.
  • Loading branch information
hasselmm committed Jun 23, 2024
1 parent 13318b8 commit 6a92e7a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions apps/lmrstudio/automationview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ class AutomationCanvas : public QQuickWidget
explicit AutomationCanvas(QWidget *parent = nullptr)
: QQuickWidget{parent}
{
qmlRegisterType<automation::Action>("Lmrs.Core.Automation", 1, 0, "Action");
qmlRegisterType<automation::Event>("Lmrs.Core.Automation", 1, 0, "Event");
qmlRegisterType<automation::Item>("Lmrs.Core.Automation", 1, 0, "Item");
qmlRegisterUncreatableType<automation::Action>("Lmrs.Core.Automation", 1, 0, "Action",
"Cannot create instances of an abstract type"_L1);
qmlRegisterUncreatableType<automation::Event>("Lmrs.Core.Automation", 1, 0, "Event",
"Cannot create instances of an abstract type"_L1);
qmlRegisterUncreatableType<automation::Item>("Lmrs.Core.Automation", 1, 0, "Item",
"Cannot create instances of an abstract type"_L1);

qmlRegisterType<automation::Parameter>("Lmrs.Core.Automation", 1, 0, "parameter");

Expand Down

0 comments on commit 6a92e7a

Please sign in to comment.