Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
QSR 1.2
-
None
Description
Please see https://doc-snapshots.qt.io/qtsaferenderer/saferenderer-statemanager.html#setLayout
In case that the loaded second bitmap is smaller than the first bitmap. the function returns false. And the second bitmap is not loaded. For example if using the indicators example Mainform and Secondary form files.
static QSafeLayoutFileReader layout("D:/RC7_tests/RuntimeR2_7/layoutData/MainForm/MainForm.ui.srl"); static QSafeLayoutFileReader layout2("D:/RC7_tests/RuntimeR2_7/layoutData/SecondaryForm/SecondaryForm.ui.srl"); SafeWindow telltaleWindow(layout.size()); static SafeRenderer::StateManager stateManager(telltaleWindow, layout); bool retval = stateManager.setLayout(&layout2);
But if you change the secondary form width and height to the same than in the mainform, then exception is thrown when loading the files. That is because the layouts have different safe QML objects. And that how it should work, that exception is always thrown.
But the documentation does not mention anything else than this in different class:
Sets the layout to layout.It is possible to change renderer layout on runtime. The size of the new layout must match the current layout.Returns true if setting the layout succeeded, otherwise false.
https://doc-snapshots.qt.io/qtsaferenderer/saferenderer-qsaferenderer.html#setLayout
Please update the documentation and mention that the layouts must have similar number of safe QML types with similar names and object ids. The sources and other properties may however be different for the another layout.
Please also add corresponding question and answer pair to the FAQ section of the safety manual, since finding that information from several locations is not trivial.