Skip to content
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

How to use it with multiple qmlengines? #210

Open
scuhappy opened this issue Jun 22, 2021 · 3 comments
Open

How to use it with multiple qmlengines? #210

scuhappy opened this issue Jun 22, 2021 · 3 comments

Comments

@scuhappy
Copy link

My QtQuick application contains more than one qmlengines, But I found that the Config is a singleton, It can not be loaded in other qmlengine if it has already has one.
Any ideas? Thank you!

@iamsergio iamsergio self-assigned this Jun 22, 2021
@iamsergio
Copy link
Contributor

Haven't thought much about this yet.

Will both qmlengines support dock widgets ?
And will you need to dock a dock widget from 1 engine into a window controlled to another ?

@iamsergio iamsergio added the question Further information is requested label Jun 22, 2021
@scuhappy
Copy link
Author

scuhappy commented Jun 23, 2021

Hi iamsergio,
Thank you for your reply!
In my app, there may be more than one qmlengines , each engine contains a Window.
Currently we only allow one window is visible, and we will delete the previous window when new window is created. so we don't have requirement to dock a dockwidget from one Window to another Window.
I tried to modify the source code , just remove the code below in function void Config::setQmlEngine(QQmlEngine *qmlEngine). Is that OK ?
if (d->m_qmlEngine) { qWarning() << Q_FUNC_INFO << "Already has QML engine"; return; }

@iamsergio
Copy link
Contributor

that might work, but it's best that I port away from the singleton

@iamsergio iamsergio added API Request qtquick and removed question Further information is requested labels Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants