[Interest] Qt 6.3.0 and OpenGL on macOS [was: Re: Creating fat binaries for Qt6 on macOS]

2022-04-29 Thread Dirk Hohndel


> On Apr 13, 2022, at 06:52, Sze Howe Koh  wrote:
> Apple has let their OpenGL implementation stagnate since 2010 [1].
> They then officially deprecated it in 2018, citing significant
> advantages of Metal over OpenGL [2]. They have not revealed when
> OpenGL will be removed.
> 
> Most of Qt Quick works well with Metal -- it's only QQuickWidget that
> doesn't. In contrast, the graphics API setting affects all of Qt
> Quick. Furthermore, QQuickWidget has limitations [3] compared to other
> ways of displaying a Qt Quick UI, so it shouldn't be the first choice
> unless you really need to mix widgets with Qt Quick.
> 
> Given all this, I don't think it makes sense for Qt to default to
> something that can be killed off any day now, just to make it easier
> to use QQuickWidget.
> 
> In any case, I think the error message "QQuickWidget is only supported
> on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default"
> is clear enough as a once-off message for those who want to use
> QQuickWidget.

So I finally found time to try and figure out what to do here.

This is all rather confusing.

I have two different QML modules that are included in my Qt Widget based
app. One of them works. It shows maps, not a problem. I get the warning:

QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to 
override the default.

but it still works just fine.

The other one, however, crashes in the software render when I try to instantiate
the Widget:

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x
Exception Codes:   0x0001, 0x
Exception Note:EXC_CORPSE_NOTIFY

Termination Reason:Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [80775]

VM Region Info: 0 is not in any region.  Bytes before following region: 
4332961792
  REGION TYPESTART - END [ VSIZE] PRT/MAX 
SHRMOD  REGION DETAIL
  UNUSED SPACE AT START
--->  
  __TEXT  10243c000-102aa8000[ 6576K] r-x/r-x 
SM=COW  ...OS/Subsurface

Kernel Triage:
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get
VM - Compressor failed a blocking pager_get


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   QtQuick0x1057423a8 
QSGSoftwareRenderableNode::update() + 544 (qsgsoftwarerenderablenode.cpp:187)
1   QtQuick0x1057423a8 
QSGSoftwareRenderableNode::update() + 544 (qsgsoftwarerenderablenode.cpp:187)
2   QtQuick0x105744a6c bool 
QSGSoftwareRenderableNodeUpdater::updateRenderableNode(QSGSoftwareRenderableNode::NodeType,
 QSGImageNode*) + 288 (qsgsoftwarerenderablenodeupdater_p.h:135)
3   QtQuick0x10577eb24 
QSGNodeVisitorEx::visitChildren(QSGNode*) + 108 (qsgadaptationlayer.cpp:355)
4   QtQuick0x105746008 
QSGSoftwareRenderableNodeUpdater::updateNodes(QSGNode*, bool) + 1100 
(qsgsoftwarerenderablenodeupdater.cpp:282)
5   QtQuick0x10573826c 
QSGAbstractSoftwareRenderer::nodeAdded(QSGNode*) + 124 
(qsgabstractsoftwarerenderer.cpp:267)
6   QtQuick0x105737ee4 
QSGAbstractSoftwareRenderer::nodeChanged(QSGNode*, 
QFlags) + 164 (qsgabstractsoftwarerenderer.cpp:108)
7   QtQuick0x105772750 
QSGRootNode::notifyNodeChange(QSGNode*, QFlags) + 44 
(qsgnode.cpp:1277) [inlined]
8   QtQuick0x105772750 
QSGNode::markDirty(QFlags) + 84 (qsgnode.cpp:671) 
[inlined]
9   QtQuick0x105772750 
QSGNode::appendChildNode(QSGNode*) + 144 (qsgnode.cpp:454)
10  Subsurface 0x10272c2a4 
ChartPixmapItem::render(StatsTheme const&) + 172 (chartitem.cpp:71)
11  Subsurface 0x10276006c 
StatsView::updatePaintNode(QSGNode*, QQuickItem::UpdatePaintNodeData*) + 160 
(statsview.cpp:186)

Ok, so maybe the software renderer is the problem... after all everyone tells 
me to use OpenGL

QT_QUICK_BACKEND="opengl" ./Subsurface.app/Contents/MacOS/Subsurface -v
...
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
QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to 
override the default.

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.
I saw elsewhere that I actually should include the OpenGL component when 
building like this:

   find_package(Qt6 COMPONENTS OpenGL)
   LIST(APPEND SUBSURFACE_LINK_LIBRARIES Qt6::OpenGL)

That builds, but 

Re: [Interest] QtWebEngine crash after codesign

2022-04-29 Thread Hamish Moffatt via Interest

On 30/4/22 00:56, Alexander Carôt wrote:

codesign --options=runtime --deep ./simplebrowser.app -s "Developer ID 
Application:–xyz"


The hardened runtime (--options=runtime) causes the web engine to crash. 
You need to add entitlements while signing it.


See: https://forum.qt.io/topic/102212/qtwebengine-signing-issues/4

You only need that on the web engine process, not the whole application, 
which messes with the --deep a bit.



Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] debugging on Macintosh

2022-04-29 Thread Michael Jackson


On 4/29/22, 12:20 PM, "j...@wavemetrics.com"  wrote:

> This happened to a colleague (sort of). He could debug one executable but 
not any of the other ones. We tried QtCreator 4.x, 6.x and 7.x. What we finally 
did was move his QtCreator configuration directory to the side and relaunch 
QtCreator. That seemed to fix it. Seems like a sledge hammer but it did work. 

Interesting. That would ~.config/QtProject? And then you have to re-create 
all your kits, etc.?

-John Weeks


Yes. That is correct. Also removed the CMakeLists.txt.user file from the 
project. We were able to bring over our styles, macros and snippets but the 
rest we had to recreate.

---
Mike Jackson


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] debugging on Macintosh

2022-04-29 Thread john
> This happened to a colleague (sort of). He could debug one executable but not 
> any of the other ones. We tried QtCreator 4.x, 6.x and 7.x. What we finally 
> did was move his QtCreator configuration directory to the side and relaunch 
> QtCreator. That seemed to fix it. Seems like a sledge hammer but it did work. 

Interesting. That would ~.config/QtProject? And then you have to re-create all 
your kits, etc.?

-John Weeks
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QtWebEngine crash after codesign

2022-04-29 Thread Alexander Carôt
Hello all,

I just noticed some odd behavior with QtWebEngine after codesigning:

When launching the app the QtWebEngineProcess crashes and the browser tells:

Render process exited with code: 9
Do you want to reload the page ?

I can reproduce this with the simplebrowser-example code:

Qt/Examples/Qt-6.2.4/webenginewidgets/simplebrowser

Can anyone confirm this ? For the sake of completeness – I am signing this way:

codesign --options=runtime --deep ./simplebrowser.app -s "Developer ID 
Application:–xyz"

Thanks,
best

Alex

--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest