christophe.meurice Posted February 17, 2017 Share Posted February 17, 2017 Hi, we are trying to integrate Unigine with Qt/Qml. On windows using DX11 it work perfectly but on linux with opengl it doesn't work. We have an Unigine viewport and some Qml widget (Qt5QuickWidgets) created dynamically, when a qml widget is created both Unigine and Qt stop refreshing with the following error : OpenGL error: invalid operation Any help would be appreciated. You can reproduce it easily editing the source code of source/app/main_qt : (.zip with complete source code provided) main_qt.pro : -------------------------------- QT += core gui widgets quickwidgets main_qt.cpp : -------------------------------- // Qt #include "MainWindow.h" #include <QApplication> #include <QDesktopWidget> #include <QQuickWidget> #include <QQuickView> (...) int main(int argc, char *argv[]) { // Qt part QApplication app(argc, argv); MainWindow window; QQuickWidget *view = new QQuickWidget; view->setSource(QUrl::fromLocalFile("test.qml")); view->show(); // UnigineApp AppQt *widget = NULL; (...) test.qml : (drop it in the main_qt folder) -------------------------------- import QtQuick 2.0 Item { width: 600 height: 400 Rectangle { id: r anchors.centerIn : parent width: parent.width /2 height: parent.height /2 color: "red" } Timer { interval: 1000; running: true; repeat: true onTriggered: { console.log("Triggered " + r.color) r.color = (r.color == "#ff0000") ? "blue" : "red" } } } main_qt.zip Link to comment
silent Posted February 23, 2017 Share Posted February 23, 2017 Hi Christophe, The first version of our QML integration you can find in attachment. You need to change path to the SDK in QML.pro and main.qml to get it working on your side. Before launch from QtCreator set working directory to <SDK>/bin (or <SDK>/lib, if you are using 2.3.1 SDK). Currently input is send directly to QML. Thanks! QML.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
christophe.meurice Posted February 23, 2017 Author Share Posted February 23, 2017 Yeah ! Thanks, we will try it ! It was .. unexpected ! :D Link to comment
christophe.meurice Posted March 3, 2017 Author Share Posted March 3, 2017 Hi, Thanks for the integration ! It works without problem with Unigine 2.4 and Qt5.8 .. Just one question ... Are you planning to add the events (mouse, keyboard, ...) ? We are really interested in using this sample of code but we are wondering if you are working on it or if we improve it ourself .. Thanks, Christophe Link to comment
silent Posted March 3, 2017 Share Posted March 3, 2017 Hi Christophe, Sure, take a look at the updated sample in the attachment: Qml.zip Place Qml dir into <SDK>\source\samples\Api\App\Qml and rebuild project. It may be required to specify QML path separately. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
binstream Posted March 3, 2017 Share Posted March 3, 2017 The sample will be included into SDK 2.5 Link to comment
Recommended Posts