-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for QQuickWebEngineView #73
Comments
I’ll see what I can do. |
@omix yes it is, but it's not the same as QWebEngineView. It's a kind of a merge between QWebEngineView and QWebEnginePage.
I tried to catch any c++ exceptions to findwhy that crashes, but there were none, it just stops debugging at this point. |
@omix just run attached files and you will always get jvm crash the moment you click on "click me" button.
mainTest.qml
|
In debug setup I got more data.
Exception: |
The callstack looks as if there is an assertion error and the app's crash is caused by the subsequent message dialog. Let me check the example and I will find out what happens. If qml type WebEngineView is actually multiinheriting as you said, then this circumstance could be the cause of the issue. |
Why don't you use resource url? |
I just copied some code from our project :) I suspect it was written this way to support both develop setup and final build from qt jambi deployer |
resource url should also support both situations because it uses classpath. |
I must correct, it is: |
I don't see any error. The program returns: got io.qt.quick.QQuickItem: QQuickWebEngineView(0x27de1ea9ff0, name="webEngine", parent=0x27de1ea92e0, geometry=0,102 1200x800) That's what I expect. |
it still crashes every time for me from all computers. @omix do you use 6.2.6 jars from maven with 6.2.5 qt on windows? |
I use my working version of QtJambi but there are no differences to 6.2.6 maven binaries. My Qt is 6.2.4. |
It crashed exactly the same. It doesn't even get inside the method, it never reaches breakpoint with console output |
What happens if you search for webEngine object: QList<QObject> rootObjects = engine.rootObjects();
QObject webEngine = rootObjects.get(0).findChild("webEngine"); What happens if you dump the object tree: dump(rootObjects, 0);
private static void dump(QList<QObject> objects, int nestedLevel) {
StringBuilder suffix = new StringBuilder();
for (int i = 0; i < nestedLevel; i++) {
suffix.append(" ");
}
for (QObject obj : objects) {
System.out.println(suffix + "| " + obj.getClass().getName() + ": " + obj);
dump(obj.children(), nestedLevel+1);
}
} In both cases QQuickWebEngineView is represented as QQuickItem java type. |
Crashes on findChild call, just as it did in our real code issue. callstack:
crashes the moment it reaches webview:
call stack
Every time it crashes at exactly the same moment - when the webview object is accessed from java. I don't see the point of these tests.. |
Does it even happen when you do both operations directoy after |
Yes even with this it crashes exactly the same..... |
What happens if you reduce the qml code to the problematic type:
|
It crashes at rootObjects.get(0) |
I'll check it with maven natives... |
Yes, 6.2.6 maven natives crash at this position. My latest binaries do not. I will make sure that 6.2.7 is actually fixing it. |
Concerning your request to include QQuickWebEngineView in QtJambi: In fact, QQuickWebEngineView's API is similar but not equals to QWebEngineView. |
As long as we would still be able to use all it's signals/properties using meta object, we can work with that. Unfortuanately I can't check that while it's crashing :) |
@omix is it possible to at least add https://doc.qt.io/qt-6/qml-qtwebengine-webenginesettings.html ? I assume it's a private unavailable object too now, but its fields are all bools/ints/etc and just one enum from the same object |
QQuickWebEngineSettings inherits QObject. You can access all these properties by |
Yeah I know, it would just be better for code to have thisese fields in java classes with compile checks instead of using some string constants. |
QQuickWebEngineSettings is a QObject-wrapped QWebEngineSettings. I'm thinking about a converter function. |
This is the final solution I can offer:
|
looks great, thanks! |
@omix do you have any estimates for the next release? |
I am busy with releasing this entire day. Tomorrow, everything should be online and accessible. |
I hope the system does not treat me again as malicious attack as it did last time. |
Did you forget to push git changes to this repo? :) Last commit is 13 days ago, I doubt you are releasing on it |
I will push after uploading the binaries. |
Is your feature request related to a problem? Please describe.
We are trying to use QQuickWebEngineView in our code, but whenever we try to send that object to java, it always cores the jvm
Describe the solution you'd like
Could you please add support for QQuickWebEngineView? Including all the private stuff, like in this example: https://forum.qt.io/topic/87569/access-webengineview-from-c
we need all signals and methods that it has, incluing but not limited to:
etc etc
see https://doc.qt.io/qt-6.2/qml-qtwebengine-webengineview.html
Describe alternatives you've considered
We can't even send it as qobject and use metaobject code like we did for QQuickWindow, because the moment jambi loads WebEngineView it always cores.
Additional context
This will be useful for any developer that would want to use webapps in his qml views. Right now we have to create qwidget just for this webapp, while all the other ui is in qml.
The text was updated successfully, but these errors were encountered: