MCPcopy Create free account
hub / github.com/benlau/quickflux / setScripts

Method setScripts

qfappscriptgroup.cpp:79–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void QFAppScriptGroup::setScripts(const QJSValue &scripts)
80{
81 for (int i = 0 ; i < objects.count() ; i++) {
82 if (objects.at(i).data()) {
83 objects.at(i)->disconnect(this);
84 }
85 }
86
87 objects.clear();
88 m_scripts = scripts;
89
90 if (!scripts.isArray()) {
91 qWarning() << "AppScriptGroup: Invalid scripts property";
92 return;
93 }
94
95 int count = scripts.property("length").toInt();
96
97 for (int i = 0 ; i < count ; i++) {
98 QJSValue item = scripts.property(i);
99
100 if (!item.isQObject()) {
101 qWarning() << "AppScriptGroup: Invalid scripts property";
102 continue;
103 }
104
105 QFAppScript* object = qobject_cast<QFAppScript*>(item.toQObject());
106
107 if (!object) {
108 qWarning() << "AppScriptGroup: Invalid scripts property";
109 continue;
110 }
111 objects << object;
112 connect(object,SIGNAL(started()),
113 this,SLOT(onStarted()));
114 }
115
116 emit scriptsChanged();
117}
118
119/*! \qmlmethod AppScriptGroup::exitAll()
120

Callers

nothing calls this directly

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected