Load QML plugin without changing code in the application code base - c++

I have a QtQuick QML application which is having a Window.
On the other hand, I am writing a separate QML plugin. This plugin has a Rectangle QML component. I would like to show this rectangle (i.e Load plugin) automatically when the application is started. I do not want to make changes to my QtQuick application. I just want to show rectangle on top of the QtQuick application as a overlay. How can this be achieved. Please advice!.
I tried many ways, but so far I can get this worked on a non EGLFS platform. But it does not seem to work on EGLFS platform. Request your recommendation. Thanks in advance!
Regards,
Kishore Ravikumar

Related

Can I use OpenGL context in React Native for Windows?

I wonder if I can write my own native module, render something with using OpenGL in C++ and finally display rendered picture on react native side ( by simply using component).
If so, can I use that to render an animation in for example 60fps?
My case is that I've got the custom, let's say, game renderer written in OpenGL, and I looking for some fancy solution to create an editor detached from engine code.
I've already analyzed some react-native video libraries and I've discovered that frames are injecting as the texture of components, but I'm not sure is it the best solution (I can't find any documentation of those low-level mechanisms in react native).
Any advice? Thanks in advance!

Multi Screen/Window QT QML C++ application

I am new to QT Quick and QML and I am trying to build a Linux Desktop multi Window application using C++ and QT. I mean application having multiples windows like:
Slash or Welcome Screen
Main Dashboard
User Profile
Charts and Graphs
Etc. etc.
I want to have these screens as independent C++ classes and QML files for example:
Dashboard.cpp
Dashboard.qml
I am able to build QML files representing these screens but not sure how to map them to a class which will control and communicate with QML and backend. I want to have each QML file represented as C++ Class. And screen stack manager will use these classes to push and pop screens from the screen stack.
I have seen the examples provided by QT but most of the examples are single screen and not explaining how to have multiple screens and how the screen stack is maintained.
Use the Quick Controls 2 StackView control:
https://doc.qt.io/qt-5/qml-qtquick-controls2-stackview.html
This control maintains a stack of QML views where the top one is always visible and you can pop and push views with animation.

Raw Qt WebEngine renders a black screen yet works with QtQuick

I'm writing a simple QT application which uses a QWebEngineView to render a simple web page. If I use QtQuick then the page loads and renders properly. However, our current environment precludes me from using QtQuick so I tried using QWebEngineView directly, i.e. attaching it to a simple widget and it fails miserably, producing a completely black screen.
When I set the QTWEBENGINE_REMOTE_DEBUGGING environment variable and attach a chromium browser to the port, the page seems to have loaded correctly so it just looks like it's a rendering issue.
I suspect I need to set up the environment or application in some way that QtQuick does but I'm not sure what is required. As far as I can tell, I'm using OpenGL ES 3.0 to render (or at least QtQuick uses it, I'm not 100% sure that a manually instantiated QWebEngineView is using it.. Maybe that's the issue )
I throw myself on your collective wisdom...

OpenGL in Qt Quick cross platform application

I'm trying to develop a cross platform (or at least desktop + embedded hardware) application. I would like to use Qt Quick to create a touch friendly GUI. I have been implemented a classical application with a QGLWidget displaying data. It is important that only a part of the window is in OpenGL. Because of this there are problems with EGLFS and LinuxFB. Only X11 (or maybe Wayland) can display the application properly (others generates a couple of errors about missing setParent function and the whole screen is black). Now I'm trying to achieve the same thing in QML. I want to use this OpenGL renderer as part of my QML application and some Qt Quick widgets around it. I found a couple of people asking about the same thing and the answer is always to subclass QDeclarativeItem and call the painter's beginNativePainting() (the others says to export it through QDeclarativeItem, but I cannot figure out how to do this). The problem is that on desktop, Qt 5.11 the native painter is not OpenGL. And in QT5 there is no way to force OpenGL graphics system. So when I try to get the OpenGL context (QGLContext::currentContext()) I always get NULL. Another problem: If I export my widget with qmlRegisterType("Test", 1, 0, "Test"); it becomes only visible when I use QDeclarativeView, but then it doesn't sees Qt Quick. If I use QQuickView it says module "Test" is not installed. How can I implement this properly?
QDeclarativeItem is from Qt Quick 1 and Qt4. With Qt 5 and Qt Quick 2 you should use QQuickItem.
There is at least 1 example of this provided with qt docs, which you can find in Qt Creator in the Welcome tab in the Examples section.

QT Webkit & OpenGL Rendering Context

Would it be possible to create a window with a webpage using a webkit component using QT4, then embed an OpenGL context into the middle in the same way a java applet or a flash applet may appear normally?
Sure, you can embed any QWidget into a web page shown through a QWebView, including a QGLWidget. This would be a starting point in the docs: http://doc.trolltech.com/4.5/qwebpage.html#setPluginFactory .