<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>Hi</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">What I want to achieve is something similar to a cad / paint app, with a menu with buttons (circle, line, ...) and a drawing area. In Qt Widgets, I would have done a QMainWindow with a menu with buttons and a QGLwidget in the mdi area.</div><div><span></span></div><div>In QML, I have a main rectangle, with a menu with some buttons, now how do I set a child opengl drawing area ?</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent;
font-style: normal;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">1) using QML writing C++ items to integrate into the scene graph (see <a rel="nofollow" target="_blank" href="http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html" style="color: rgb(25, 106, 212);">http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html</a> for the base class) - this also means you’ll be able to use Silica in your application</div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">I'm not sure if this is what I want/need but I will check better the
link </div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">2) using C++, instantiating a QWindow, and doing all your rendering by yourself (ideally using OpenGL ES) - something like <a rel="nofollow" target="_blank" href="http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html" style="color: rgb(25, 106, 212);">http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html</a></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size:
13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">I like this option because I want to use OpenGL ES for my drawing area, where the user can input lines, circles, ... with touch events. But can I have best of both worlds and use also a fancy QML menu with buttons ? I would have to have a main (something ???) with a child qml menu and a child opengl QWindow.</div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"><br></div><div style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;">3) other, as-yet-to-be-finalised routes like doing *everything* yourself, using SDL, etc.</div><div> </div><div>Not a change in
hell :) Life is short and I just want to keep it simple, and use whenever possible all the goodies Qt has to offer :)</div><div><br></div><div>Thanks for your replay, and patience, has I am not, yet, very familiar with QML world.</div><div><br></div><div>Regards</div><div>João </div><div><br></div><div><br></div><div><br></div><div class="yahoo_quoted" style="display: block;"> <br> <br> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> Em Quarta-feira, 4 de Dezembro de 2013 22:40, Robin Burchell <robin.burchell@jolla.com> escreveu:<br> </font> </div> <div class="y_msg_container"><div id="yiv0609644615">
<div>
Hi,
<div><br>
<div>
<div>On 04 Dec 2013, at 20:18, joao morgado <<a rel="nofollow" ymailto="mailto:joaodeusmorgado@yahoo.com" target="_blank" href="mailto:joaodeusmorgado@yahoo.com">joaodeusmorgado@yahoo.com</a>> wrote:</div>
<blockquote type="cite">
<div>
<div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div><span>@: Wim de Vries. </span></div>
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>I share your frustation about OpenGL with QWindow, and I'm also frustated with Qt widgets. </span></div>
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>I have a very nice app in OVI, symbian, with QWidgets and OpenGL, I'll have to do a complete redesign, since widgets are black listed.</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
The reason for the blacklist is twofold:</div>
<div>1) we do not (and have not) done any work on QWidget-using applications on Sailfish, either in terms of working at all/working correctly, let alone working performantly - and as we don’t have infinite resources, we have to choose where to focus, and that
isn’t on widget-using applications</div>
<div>2) they will not work performantly at all, due to being stuck with the software rendering stack (we’re talking something well under the display refresh rate on an un-loaded device)</div>
<div><br>
</div>
<div>Separately from the problem of actually working, and working well, any use of QtWidgets also imposes some pretty nasty resource penalties on your application (mostly in terms of startup, but also resource usage) as it’s a pretty massive library.</div>
<div><br>
</div>
<div>Generally speaking - they just aren’t very mobile-friendly.</div>
<div><br>
<blockquote type="cite">
<div>
<div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>That example of QWindow with OpenGL, to me, it's an over complicated mess, luckly I managed to port my opengl code to QWindow but took me quite a while to do it. To me, there is a better example here </span><a rel="nofollow" target="_blank" href="https://github.com/advancingu/Qt5OpenGL" style="font-size:12pt;">https://github.com/advancingu/Qt5OpenGL</a></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>An example rather depends on what you want to do. Either you’re:</div>
<div>1) using QML writing C++ items to integrate into the scene graph (see <a rel="nofollow" target="_blank" href="http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html">http://qt-project.org/doc/qt-5.0/qtquick/qquickitem.html</a> for the base class) - this also means you’ll be able to
use Silica in your application</div>
<div>2) using C++, instantiating a QWindow, and doing all your rendering by yourself (ideally using OpenGL ES) - something like <a rel="nofollow" target="_blank" href="http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html">http://qt-project.org/doc/qt-5.0/qtgui/openglwindow.html</a></div>
<div>3) other, as-yet-to-be-finalised routes like doing *everything* yourself, using SDL, etc.</div>
<br>
<blockquote type="cite">
<div>
<div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span style="background-color:transparent;">So it seems that only QML apps are supported, but I have no clue how to add a QWindow in a QML app. There's an example in QtCreator "Scene Graph - OpenGL under QML" but they use </span><span style="color: rgb(128, 0, 128); font-family: 'Courier New'; white-space: pre; font-size: 12pt;">QQuickItem,
</span></div>
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span style="background-color:transparent;">for OpenGL, so I still don't have a clue how to use OpenGL in a QML app.</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
Your QML application has a C++ entry point (though if you’re using something like qmlscene… you’ll need to create such an entry point yourself) with your ‘main’ function. You can create a QWindow in there, and show it. You can hook into QML using Q_INVOKABLE
methods to show it based on a clicked action on a Silica button, etc, etc, etc.</div>
<div><br>
</div>
<div>I’d need more information to be able to really provide useful help here :)</div>
<div><br>
<blockquote type="cite">
<div>
<div style="background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div style="font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span style="background-color:transparent;">Regards</span></div>
<div style="font-size:16px;"><span style="background-color:transparent;">João de Deus </span></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<div>BR,</div>
<div>Robin</div>
</div>
</div><br><br></div> </div> </div> </div> </div></body></html>