This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
id_qml_module_dev [2018/02/07 02:26] 92.78.28.39 |
id_qml_module_dev [2018/02/07 02:56] (current) 92.78.28.39 |
||
|---|---|---|---|
| Line 107: | Line 107: | ||
| property int thisIntQML_Modules_Visible_Variable : 0 | property int thisIntQML_Modules_Visible_Variable : 0 | ||
| property int thisIntQML_Module_Index_Variable : -1 | property int thisIntQML_Module_Index_Variable : -1 | ||
| + | property int just_a_VariableForImplementationReasons: 0 | ||
| + | |||
| + | |||
| Connections { | Connections { | ||
| target: appWindow | target: appWindow | ||
| Line 117: | Line 120: | ||
| } | } | ||
| - | Dadurch wird das Modul mit dem Reiter-Button system verbunden, welches einen button erzeugt um das Modul | + | Dadurch wird das Modul mit dem Reiter-Button System verbunden, welches einen Button erzeugt um das Modul |
| sichtbar werden zu lassen im Tool. | sichtbar werden zu lassen im Tool. | ||
| - | Zudem muss das modul min einmal in seiner qml instanziiert werden z.B. durch "<module>{}" damit einmal der | + | Zudem muss das Modul min einmal in seiner qml instanziiert werden, z.B. durch "<module>{}" damit einmal der |
| Konstruktor aufgerufen wird und das Modul so registriert ist. | Konstruktor aufgerufen wird und das Modul so registriert ist. | ||
| Line 130: | Line 133: | ||
| QML_For_Module_<module>{ | QML_For_Module_<module>{ | ||
| id: qmlModule<module>Viewer | id: qmlModule<module>Viewer | ||
| + | objectName: "qmlModule<module>ViewerObject" | ||
| z: 200 | z: 200 | ||
| visible: false; | visible: false; | ||
| thisIntQML_Modules_Visible_Variable : intQML_Modules_Visible_Variable | thisIntQML_Modules_Visible_Variable : intQML_Modules_Visible_Variable | ||
| thisIntQML_Module_Index_Variable : containerUI.getModuleIndex("Module Viewer >"); | thisIntQML_Module_Index_Variable : containerUI.getModuleIndex("Module Viewer >"); | ||
| + | just_a_VariableForImplementationReasons : containerUI.set_QML_ObjectName_String_from_Instance("qmlModule<module>ViewerObject", | ||
| + | containerUI.getModuleIndex("Module Viewer >")); | ||
| + | | ||
| } | } | ||
| Dadurch wird das Modul zur Laufzeit erstellt und kann im Tool genutzt werden. Bitte darauf achten das | Dadurch wird das Modul zur Laufzeit erstellt und kann im Tool genutzt werden. Bitte darauf achten das | ||
| - | der String "Module Viewer >" exakt der gleiche ist, wie er im Konstructor von <module>.cpp bei | + | der String "Module Viewer >" (bei 'thisIntQML_Module_Index_Variable') exakt der Gleiche ist, |
| - | this->mStringTypeName genannt wurde (sonst funktioniert es nicht). | + | wie er im Konstructor von <module>.cpp von Euch bei |
| + | this->mStringTypeName genannt wurde (sonst funktioniert es nicht). | ||
| + | Bitte bei 'just_a_VariableForImplementationReasons' weiter darauf achten, dass der erste String im Funktionsaufruf | ||
| + | mit "qmlModule<module>ViewerObject" genau die Bezeichnung des 'objectName' dieses qml-Modules ist, und auch | ||
| + | hier der zweite String mit "Module Viewer >" wieder exakt der Gleiche ist, wie er im Konstructor von <module>.cpp | ||
| + | von Euch bei this->mStringTypeName genannt wurde. Auch hier: wenn es nicht exakt so ist, funktioniert das | ||
| + | Modul, dessen Einbindung, ja noch nichteinmal dessen Lizenzierungsprozess innerhalb des Tools leider nicht. | ||
| + | Also unbedingt auf Genauigkeit und Gründlichkeit achten, and dieser sehr neuralgischen Stelle. | ||
| Nun ist das Modul angemeldet, eingebunden und kann genutzt werden. Wann immer Module aktualisiert werden | Nun ist das Modul angemeldet, eingebunden und kann genutzt werden. Wann immer Module aktualisiert werden | ||
| Line 153: | Line 167: | ||
| Hinweis: Hin und wieder kann es notwendig sein von qml Objkten bestimmte Eigenschaften aud dem c++ code selbst | Hinweis: Hin und wieder kann es notwendig sein von qml Objkten bestimmte Eigenschaften aud dem c++ code selbst | ||
| - | heraus zu setzen, anstatt über die qml Files selbser. Dafür gib es GuiState die Klassenfunktion | + | heraus zu setzen, anstatt über die qml Files selber. Dafür gib es in GuiState die Klassenfunktion |
| - | "Object Object= static QObject * m_getQMLObjectAsQObject(QString QML_Object_String);" welche das | + | "Object QML_Object= static QObject * m_getQMLObjectAsQObject(QString QML_Object_String);" welche das |
| - | QObject aus dem qml zurückgibt, das als Objektname 'objectName: "QML_Object_String" ' besitzt. | + | QObject aus dem qml zurückgibt das als Objektname 'objectName: "QML_Object_String" ' besitzt. |
| - | Die Eigenschaften können dann leicht wie folgt gesetzt werden: | + | Die Eigenschaften können dann leicht - beispielsweise wie folgt - gesetzt werden: |
| | | ||
| if(QML_Object) { | if(QML_Object) { | ||