forked from qt-creator/qt-creator
QmlPuppet: Render 2D content inside 3D edit view
In order to render embedded 2D items in 3D scenes or 2D items used as 3D material textures, those 2D items must be rendered. 2D content is now rendered when necessary also in editor puppet. Fixes: QDS-4471 Change-Id: I83da90198ecebc3a3a9a35aab28f4aec36620492 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -793,6 +793,11 @@ void Qt5InformationNodeInstanceServer::doRender3DEditView()
|
||||
m_editView3DData.window->afterRendering();
|
||||
}
|
||||
#else
|
||||
if (m_render2D) {
|
||||
// Render 2D content, as it might be used by 3D content
|
||||
grabWindow();
|
||||
m_render2D = false;
|
||||
}
|
||||
renderImage = grabRenderControl(m_editView3DData);
|
||||
#endif
|
||||
|
||||
@@ -1767,6 +1772,11 @@ void Qt5InformationNodeInstanceServer::changePropertyValues(const ChangeValuesCo
|
||||
if (!container.isReflected()) {
|
||||
hasDynamicProperties |= container.isDynamic();
|
||||
setInstancePropertyVariant(container);
|
||||
if (!m_render2D && isQuick3DMode() && hasInstanceForId(container.instanceId())) {
|
||||
ServerNodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isSubclassOf("QQuickItem"))
|
||||
m_render2D = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1877,6 +1887,17 @@ void Qt5InformationNodeInstanceServer::changeAuxiliaryValues(const ChangeAuxilia
|
||||
void Qt5InformationNodeInstanceServer::changePropertyBindings(const ChangeBindingsCommand &command)
|
||||
{
|
||||
Qt5NodeInstanceServer::changePropertyBindings(command);
|
||||
|
||||
const QVector<PropertyBindingContainer> &values = command.bindingChanges;
|
||||
for (const PropertyBindingContainer &container : values) {
|
||||
if (!m_render2D && isQuick3DMode() && hasInstanceForId(container.instanceId())) {
|
||||
ServerNodeInstance instance = instanceForId(container.instanceId());
|
||||
if (instance.isSubclassOf("QQuickItem")) {
|
||||
m_render2D = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
render3DEditView();
|
||||
}
|
||||
|
||||
|
@@ -165,6 +165,7 @@ private:
|
||||
QList<InputEventCommand> m_pendingInputEventCommands;
|
||||
QObject *m_3dHelper = nullptr;
|
||||
int m_need3DEditViewRender = 0;
|
||||
bool m_render2D = true;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
Reference in New Issue
Block a user