QmlDesigner: Show canvas background in states view

* Forward the auxiliary property formeditorColorProperty to the states
  editor delegate
* Add functionality to enabled/disable certain colors in the form editor
  canvas background combo box
* Disable context image property in the combo box when it isn't set
* When context image is set as the canvas background make the states
  background transparent
* Fix Item as root being rendered with white background in
  Qt5NodeInstanceServer::grabRenderControl

Task-number: QDS-12914
Change-Id: Ie2850986f4a54c6e03f33527d8308d01ba16884e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2024-06-05 18:46:12 +02:00
committed by Henning Gründl
parent 24c79573db
commit 0c92c8aaf7
12 changed files with 83 additions and 22 deletions

View File

@@ -89,6 +89,7 @@ void Qt5NodeInstanceServer::initializeView()
m_viewData.renderControl = new QQuickRenderControl;
m_viewData.window = new QQuickWindow(m_viewData.renderControl);
m_viewData.window->setColor(Qt::transparent);
setPipelineCacheConfig(m_viewData.window);
m_viewData.renderControl->initialize();
m_qmlEngine = new QQmlEngine;
@@ -379,9 +380,11 @@ QImage Qt5NodeInstanceServer::grabRenderControl([[maybe_unused]] RenderViewData
QRhiReadbackResult readResult;
readResult.completed = [&] {
readCompleted = true;
QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
readResult.pixelSize.width(), readResult.pixelSize.height(),
QImage::Format_RGBA8888_Premultiplied);
QImage wrapperImage(
reinterpret_cast<const uchar *>(readResult.data.constData()),
readResult.pixelSize.width(),
readResult.pixelSize.height(),
QImage::Format_RGBA8888_Premultiplied);
if (viewData.rhi->isYUpInFramebuffer())
renderImage = wrapperImage.mirrored();
else