<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 13, 2022, at 06:52, Sze Howe Koh <<a href="mailto:szehowe.koh@gmail.com" class="">szehowe.koh@gmail.com</a>> wrote:</div><div class=""><div class="">Apple has let their OpenGL implementation stagnate since 2010 [1].<br class="">They then officially deprecated it in 2018, citing significant<br class="">advantages of Metal over OpenGL [2]. They have not revealed when<br class="">OpenGL will be removed.<br class=""><br class="">Most of Qt Quick works well with Metal -- it's only QQuickWidget that<br class="">doesn't. In contrast, the graphics API setting affects all of Qt<br class="">Quick. Furthermore, QQuickWidget has limitations [3] compared to other<br class="">ways of displaying a Qt Quick UI, so it shouldn't be the first choice<br class="">unless you really need to mix widgets with Qt Quick.<br class=""><br class="">Given all this, I don't think it makes sense for Qt to default to<br class="">something that can be killed off any day now, just to make it easier<br class="">to use QQuickWidget.<br class=""><br class="">In any case, I think the error message "QQuickWidget is only supported<br class="">on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default"<br class="">is clear enough as a once-off message for those who want to use<br class="">QQuickWidget.<br class=""></div></div></blockquote></div><br class=""><div class="">So I finally found time to try and figure out what to do here.</div><div class=""><br class=""></div><div class="">This is all rather confusing.</div><div class=""><br class=""></div><div class="">I have two different QML modules that are included in my Qt Widget based</div><div class="">app. One of them works. It shows maps, not a problem. I get the warning:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default.</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">but it still works just fine.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">The other one, however, crashes in the software render when I try to instantiate</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">the Widget:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div class="">Exception Type:        EXC_BAD_ACCESS (SIGSEGV)</div><div class="">Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000</div><div class="">Exception Codes:       0x0000000000000001, 0x0000000000000000</div><div class="">Exception Note:        EXC_CORPSE_NOTIFY</div><div class=""><br class=""></div><div class="">Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11</div><div class="">Terminating Process:   exc handler [80775]</div><div class=""><br class=""></div><div class="">VM Region Info: 0 is not in any region.  Bytes before following region: 4332961792</div><div class="">      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL</div><div class="">      UNUSED SPACE AT START</div><div class="">--->  </div><div class="">      __TEXT                      10243c000-102aa8000    [ 6576K] r-x/r-x SM=COW  ...OS/Subsurface</div><div class=""><br class=""></div><div class="">Kernel Triage:</div><div class="">VM - Compressor failed a blocking pager_get</div><div class="">VM - Compressor failed a blocking pager_get</div><div class="">VM - Compressor failed a blocking pager_get</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thread 0 Crashed::  Dispatch queue: com.apple.main-thread</div><div class="">0   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">     </span>       0x1057423a8 QSGSoftwareRenderableNode::update() + 544 (qsgsoftwarerenderablenode.cpp:187)</div><div class="">1   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">     </span>       0x1057423a8 QSGSoftwareRenderableNode::update() + 544 (qsgsoftwarerenderablenode.cpp:187)</div><div class="">2   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">     </span>       0x105744a6c bool QSGSoftwareRenderableNodeUpdater::updateRenderableNode<QSGImageNode>(QSGSoftwareRenderableNode::NodeType, QSGImageNode*) + 288 (qsgsoftwarerenderablenodeupdater_p.h:135)</div><div class="">3   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">      </span>       0x10577eb24 QSGNodeVisitorEx::visitChildren(QSGNode*) + 108 (qsgadaptationlayer.cpp:355)</div><div class="">4   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">      </span>       0x105746008 QSGSoftwareRenderableNodeUpdater::updateNodes(QSGNode*, bool) + 1100 (qsgsoftwarerenderablenodeupdater.cpp:282)</div><div class="">5   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">   </span>       0x10573826c QSGAbstractSoftwareRenderer::nodeAdded(QSGNode*) + 124 (qsgabstractsoftwarerenderer.cpp:267)</div><div class="">6   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">      </span>       0x105737ee4 QSGAbstractSoftwareRenderer::nodeChanged(QSGNode*, QFlags<QSGNode::DirtyStateBit>) + 164 (qsgabstractsoftwarerenderer.cpp:108)</div><div class="">7   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">      </span>       0x105772750 QSGRootNode::notifyNodeChange(QSGNode*, QFlags<QSGNode::DirtyStateBit>) + 44 (qsgnode.cpp:1277) [inlined]</div><div class="">8   QtQuick                       <span class="Apple-tab-span" style="white-space:pre">   </span>       0x105772750 QSGNode::markDirty(QFlags<QSGNode::DirtyStateBit>) + 84 (qsgnode.cpp:671) [inlined]</div><div class="">9   QtQuick                       <span class="Apple-tab-span" style="white-space:pre"> </span>       0x105772750 QSGNode::appendChildNode(QSGNode*) + 144 (qsgnode.cpp:454)</div><div class="">10  Subsurface                    <span class="Apple-tab-span" style="white-space:pre">     </span>       0x10272c2a4 ChartPixmapItem::render(StatsTheme const&) + 172 (chartitem.cpp:71)</div><div class="">11  Subsurface                    <span class="Apple-tab-span" style="white-space:pre">        </span>       0x10276006c StatsView::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*) + 160 (statsview.cpp:186)</div><div class=""><br class=""></div><div class="">Ok, so maybe the software renderer is the problem... after all everyone tells me to use OpenGL</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">QT_QUICK_BACKEND="opengl" ./Subsurface.app/Contents/MacOS/Subsurface -v</span></div></div></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">...</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Could not create scene graph context for backend 'opengl' - check that plugins are installed correctly in /Users/hohndel/src/subsurface/build/Subsurface.app/Contents/PlugIns</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So I'm trying to use the OpenGL backend, but it's unclear how to do that. I looked high and lo for such a plugin. I copied all plugins... nothing.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">I saw elsewhere that I actually should include the OpenGL component when building like this:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(38, 170, 22); background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">                       </span><span style="font-variant-ligatures: no-common-ligatures" class="">find_package(Qt6 COMPONENTS OpenGL)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(38, 170, 22); background-color: rgb(254, 244, 139);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">                       </span><span style="font-variant-ligatures: no-common-ligatures" class="">LIST(APPEND SUBSURFACE_LINK_LIBRARIES Qt6::OpenGL)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">That builds, but immediately crashes on startup without even giving me a stack trace...</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Any pointers would be welcome. This is right now the major show stopper that prevents me from releasing a first limited Qt6 version of Subsurface (which would give me native m1 support)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/D</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></body></html>