Re: [Interest] How to use serveral textures in a QSGSimpleMaterialShader
Am 23.07.2014 um 19:06 schrieb Martin Ertl qsmokeonthewa...@gmail.com: ... Question: Where is my mistake? Does the call of bind() on the second texture overwrite the bind() from the first texture? Yes :) ... which has a method glActiveTexture() This. I can only speak for raw OpenGL right now, but OpenGL has several texture units (a minimum of 16 per shader stage). One of them is the active unit. As long as you deal only with one texture you don't need to worry about setting the active texture (unit): by default the active texture selector is 0. For multiple textures you iterate over all involved textures and activate the corresponding texture units (glActivateTexture) before binding (glBindTexture) the texture. Additionally you need to specify to which texture unit a given uniform sampler2D tex1 refers to by calling glUniform1i and setting the texture selector (values 0, 1, 2, ... Max Texure Units). In recent (OpenGL = 4.1?) shader versions there is also a layout (or location) qualifier, so you can save the call to glUniform1i - but the exact syntax escapes me right now. Lookup any multi texture example on the web, and the above will become clear ;) How to apply this to the usage of the mentioned Qt classes is left as an exercise to the reader... Cheers, Oliver ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] How to use serveral textures in a QSGSimpleMaterialShader
Am 24.07.2014 um 09:28 schrieb Till Oliver Knoll till.oliver.kn...@gmail.com: ... In recent (OpenGL = 4.1?) shader versions there is also a layout (or location) qualifier, so you can save the call to glUniform1i - but the exact syntax escapes me right now. From the OpenGL SuperBible: layout (binding = 0) uniform sampler2D foo; layout (binding = 1) uniform sampler2D bar; etc. This is the preferred way of assigning sampler uniforms to texture units (the binding values in the shader code above refer off course to the texture units that you activated (glActiveTexture) previously before binding your textures in your application). Cheers, Oliver ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt DevDays 2014 - Call for Papers
Hello, Il 19/06/2014 12:23, Giuseppe D'Angelo ha scritto: http://www.qtdeveloperdays.com/call-papers-information The deadlines are July 24th for Europe and August 15th for US. There's an update: the Call for Papers' deadline for the Europe event has been extended to July 31st at midnight (CEST). See you in Berlin! -- Join us Oct 6-8 at BCC Berlin for Qt Developer Days 2014! Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer KDAB (UK) Ltd., a KDAB Group company Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-independent software solutions smime.p7s Description: Firma crittografica S/MIME ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] How to use serveral textures in a QSGSimpleMaterialShader
Hello Till, thank you for your hints. That gave me some input for further search and I found this nice little piece of code which shows nearly everything I'd like to do :-) https://qt.gitorious.org/qt/qtdeclarative/source/4f69825c5bfd93b63f890a8188ece93af1283f1f:src/particles/qquickimageparticle.cpp#L207-297 Just a short summary of the main steps, the link above shows the details: - Override QSGSimpleMaterialShader::initialize(), call the initialize() method of the parent class at the very first action - bind() the program - define 'which texture unit a given uniform sampler2D tex refers to' by calling program()-setUniformValue(uTex0, 0); program()-setUniformValue(uTex1, 1); ... - get a pointer to QOpenGLFunctions by calling QOpenGLContext::currentContext()-functions(); and store it in a member variable - Then override the void QSGSimpleMaterialShader::updateState(const State *state, const State *) method - call glActiveTexture(GL_TEXTURE0); on the QOpenGLFunctions pointer extracted during initialize() - call bind() on first texture texture - call glActiveTexture(GL_TEXTURE1); - bind() the second texture. Have a nice day, Martin 2014-07-24 10:00 GMT+02:00 Till Oliver Knoll till.oliver.kn...@gmail.com: Am 24.07.2014 um 09:28 schrieb Till Oliver Knoll till.oliver.kn...@gmail.com: ... In recent (OpenGL = 4.1?) shader versions there is also a layout (or location) qualifier, so you can save the call to glUniform1i - but the exact syntax escapes me right now. From the OpenGL SuperBible: layout (binding = 0) uniform sampler2D foo; layout (binding = 1) uniform sampler2D bar; etc. This is the preferred way of assigning sampler uniforms to texture units (the binding values in the shader code above refer off course to the texture units that you activated (glActiveTexture) previously before binding your textures in your application). Cheers, Oliver ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] How to use serveral textures in a QSGSimpleMaterialShader
Am 24.07.2014 um 11:25 schrieb Martin Ertl qsmokeonthewa...@gmail.com: ... - define 'which texture unit a given uniform sampler2D tex refers to' by calling program()-setUniformValue(uTex0, 0); program()-setUniformValue(uTex1, 1); ... Or use the layout syntax in the shader itself, so you can skip setting the value (texture unit selector) of the uniforms (like you do above), like so: layout (binding = 0) uniform sampler2D foo; layout (binding = 1) uniform sampler2D bar; etc. Works at least with recent OpenGL versions (and off course only if you write the shaders yourself ;)). But by now I realise that the SG prefix probably stands for Scene Graph (which you are probably extending with your own objects), so you're with OpenGL ES 2 I guess (which probably won't digest above shader layout syntax). Cheers, Oliver___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Tabbed Dock Widgets
Hi In my application I have a set of docked widgets that are all tabbed. I have a menu to which I have added the action associated with the docked widget that enables me to toggle the viability of the widgets. This all works fine except for one niggle. Say I have 2 out of 3 of my widgets on display and then use the menu to make a 3rd visible. The 3rd widget does get added to the tabbed set of widgets but is not made the current tab. Does anyone have any hints on how I can make it the current tab Thanks ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] OpenGL weirdness
Greetings all, I'm trying to build a very basic OpenGL program, just displaying a red triangle. Context: - Windows 7 64bits - Qt 5.3.1 (tested with the official MinGW build and a Visual 2012 build) - I will need OpenGL 3.3 core and have to use GLEW - using QGLWidget, overriding the usual initializeGL() and paintGL() When I'm creating my widget like this: QGLFormat fmt( QGL::DoubleBuffer bitor // enables double-buffering QGL::DepthBuffer bitor// enables support for depth buffer QGL::AlphaChannel bitor // enables support for alpha-blending QGL::StencilBuffer bitor // enables support for stencil buffer QGL::DirectRendering // enables direct rendering to display ); fmt.setStencilBufferSize(8); QGLFormat::setDefaultFormat(fmt); Gl_Widget glw; glw.show(); ...then it works fine, I see my triangle. glGetString(GL_VERSION) gives 4.4.0. But if I add an explicit request for the GL version: fmt.setVersion(4, 4); fmt.setProfile(QGLFormat::CoreProfile); ...then I no longer see my triangle, however glGetString(GL_VERSION) still gives 4.4.0. If I try using some other version: fmt.setVersion(3, 3); fmt.setProfile(QGLFormat::CoreProfile); ...getGetString(GL_VERSION) gives 3.3.0 (as expected), but no triangle displayed. With: fmt.setVersion(2, 1); ...getGetString(GL_VERSION) gives 4.4.0 (unexpected), and no triangle displayed. With simply requesting the profile, without giving a version: fmt.setProfile(QGLFormat::CoreProfile); ...getGetString(GL_VERSION) gives 4.4.0 and my triangle is displayed. Any idea about what's going on? The same thing occures on both MinGW (32bits) and Visual C++ 2012 (64bits). I'm investigating this thing because a program that used to work well with Qt 5.2.1 no longer works with Qt 5.3.1. Any hint highly welcome. -- /- Yves Bailly - Software developer -\ \- Sescoi RD - http://www.sescoi.fr -/ The possible is done. The impossible is being done. For miracles, thanks to allow a little delay. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] qt_x11_wait_for_window_manager link error on CentOS 6.5
I am trying to compile some Qt code that is the following: #if defined(Q_WS_X11) extern void qt_x11_wait_for_window_manager(QWidget * mainWin, bool); qt_x11_wait_for_window_manager(mainWin, false); #endif I am trying to reimplement some of the QSplashScreen with some additional functionality and I think I may be missing a link library: This is the error I get during linking: CMakeFiles/DREAM3D.dir/DSplashScreen.cpp.o: In function `DSplashScreen::finish(QWidget*)': DSplashScreen.cpp:(.text+0x33f): undefined reference to `qt_x11_wait_for_window_manager(QWidget*, bool)' collect2: ld returned 1 exit status I have googled as much as I can but can not really reveal what library I am missing to link against. This is with a self built Qt 4.8.4 on CentOS 6.5. Thanks for any help with this. -- Mike Jackson imikejackson _at_ gee-mail dot com ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] OpenGL weirdness
Hello, Il 24/07/2014 14:13, Yves Bailly ha scritto: Any idea about what's going on? The same thing occures on both MinGW (32bits) and Visual C++ 2012 (64bits). Can you also dump the context profile? Maybe unless you're requesting both a version = 3.2 *and* a Core profile, then you're getting a Compatibility profile. Regards, -- Join us Oct 6-8 at BCC Berlin for Qt Developer Days 2014! Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer KDAB (UK) Ltd., a KDAB Group company Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-independent software solutions smime.p7s Description: Firma crittografica S/MIME ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] OpenGL weirdness
Hello, Yes, check the profile too. Additionally, starting from 5.3, we have a useful example in qtbase/examples/opengl/contextinfo that can be used to check what kind of context is returned for a given version, profile and options combination. Gl_Widget glw; glw.show(); Here you are asking for OpenGL 2.0. You get a 4.4 compatibility profile context. This is just fine. The driver is free to give you 2.0, 2.1, or a compatibility profile of 3.2, 3.3, 4.x. fmt.setVersion(4, 4); fmt.setProfile(QGLFormat::CoreProfile); Here you are asking for 4.4 core profile and that's exactly what you are getting. Are the app's OpenGL shaders and calls prepared to handle core profile? fmt.setVersion(3, 3); fmt.setProfile(QGLFormat::CoreProfile); Similarly to the previous, you get 3.3 core. fmt.setVersion(2, 1); Again, it gives you 4.4 compatibility. fmt.setProfile(QGLFormat::CoreProfile); This is again 4.4 compatibility (not core) since you are requesting 2.0 core which does not make sense so the profile is ignored. Best regards, Laszlo From: interest-bounces+laszlo.agocs=digia@qt-project.org [interest-bounces+laszlo.agocs=digia@qt-project.org] on behalf of Giuseppe D'Angelo [giuseppe.dang...@kdab.com] Sent: Thursday, July 24, 2014 2:49 PM To: interest@qt-project.org Subject: Re: [Interest] OpenGL weirdness Hello, Il 24/07/2014 14:13, Yves Bailly ha scritto: Any idea about what's going on? The same thing occures on both MinGW (32bits) and Visual C++ 2012 (64bits). Can you also dump the context profile? Maybe unless you're requesting both a version = 3.2 *and* a Core profile, then you're getting a Compatibility profile. Regards, -- Join us Oct 6-8 at BCC Berlin for Qt Developer Days 2014! Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Software Engineer KDAB (UK) Ltd., a KDAB Group company Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090 KDAB - Qt Experts - Platform-independent software solutions ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Tabbed Dock Widgets
Hi Graham, Calling raise() on the QDockWidget should do it. Greets, Ben -Original Message- From: interest-bounces+benswerts=telenet...@qt-project.org [mailto:interest-bounces+benswerts=telenet...@qt-project.org] On Behalf Of Graham Labdon Sent: Thursday, July 24, 2014 12:29 To: interest@qt-project.org Subject: [Interest] Tabbed Dock Widgets Hi In my application I have a set of docked widgets that are all tabbed. I have a menu to which I have added the action associated with the docked widget that enables me to toggle the viability of the widgets. This all works fine except for one niggle. Say I have 2 out of 3 of my widgets on display and then use the menu to make a 3rd visible. The 3rd widget does get added to the tabbed set of widgets but is not made the current tab. Does anyone have any hints on how I can make it the current tab Thanks ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Tabbed Dock Widgets
Hi I realise that but I cannot get a handle for the docked widget -Original Message- From: interest-bounces+graham.labdon=avalonsciences@qt-project.org [mailto:interest-bounces+graham.labdon=avalonsciences@qt-project.org] On Behalf Of Ben Swerts Sent: 24 July 2014 14:17 To: interest@qt-project.org Subject: Re: [Interest] Tabbed Dock Widgets Hi Graham, Calling raise() on the QDockWidget should do it. Greets, Ben -Original Message- From: interest-bounces+benswerts=telenet...@qt-project.org [mailto:interest-bounces+benswerts=telenet...@qt-project.org] On Behalf Of Graham Labdon Sent: Thursday, July 24, 2014 12:29 To: interest@qt-project.org Subject: [Interest] Tabbed Dock Widgets Hi In my application I have a set of docked widgets that are all tabbed. I have a menu to which I have added the action associated with the docked widget that enables me to toggle the viability of the widgets. This all works fine except for one niggle. Say I have 2 out of 3 of my widgets on display and then use the menu to make a 3rd visible. The 3rd widget does get added to the tabbed set of widgets but is not made the current tab. Does anyone have any hints on how I can make it the current tab Thanks ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Tabbed Dock Widgets
On 7/24/2014 5:29 AM, Graham Labdon wrote: Hi In my application I have a set of docked widgets that are all tabbed. I have a menu to which I have added the action associated with the docked widget that enables me to toggle the viability of the widgets. This all works fine except for one niggle. Say I have 2 out of 3 of my widgets on display and then use the menu to make a 3rd visible. The 3rd widget does get added to the tabbed set of widgets but is not made the current tab. Does anyone have any hints on how I can make it the current tab Are you calling raise() on it once you add it? ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is QML globalCompositeOperation incorrect?
Sorry, I think QML globalCompositeOperation behavior is incorrect even according to QPianter::CompositionMode. Best regards, Cheng Liang Nanjing, China http://www.devbean.net From: thiago.macie...@intel.com To: interest@qt-project.org Date: Tue, 22 Jul 2014 12:45:46 -0700 Subject: Re: [Interest] Is QML globalCompositeOperation incorrect? On Tuesday 22 July 2014 14:46:08 程梁 wrote: Hi, I have tested globalCompositeOperation of Context2D in Qt 5.3.1 but I found this is different from behavior of HTML5 canvas. I think this is incorrect accord with documents. I have attached these two screenshots. Is QML incorrect or my code is incorrect? QML HTML5 Authoritative: http://qt-project.org/doc/qt-5/qpainter.html#CompositionMode-enum -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] qt_x11_wait_for_window_manager link error on CentOS 6.5
On Jul 24, 2014, at 11:00 AM, Thiago Macieira thiago.macie...@intel.com wrote: On Thursday 24 July 2014 08:47:14 Mike Jackson wrote: I am trying to compile some Qt code that is the following: #if defined(Q_WS_X11) extern void qt_x11_wait_for_window_manager(QWidget * mainWin, bool); qt_x11_wait_for_window_manager(mainWin, false); #endif I am trying to reimplement some of the QSplashScreen with some additional functionality and I think I may be missing a link library: This is the error I get during linking: CMakeFiles/DREAM3D.dir/DSplashScreen.cpp.o: In function `DSplashScreen::finish(QWidget*)': DSplashScreen.cpp:(.text+0x33f): undefined reference to `qt_x11_wait_for_window_manager(QWidget*, bool)' collect2: ld returned 1 exit status I have googled as much as I can but can not really reveal what library I am missing to link against. You're not missing any. You're just trying to link against a private symbol that isn't exported. You can't do that. The version you can link to is this: Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget *w) The missing parameter is assumed to be true, unlike what you're doing. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center Thank you for the insight. I have adjusted my code accordingly and it now compiles file. Thank you again for the help Mike Jackson ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] qt_x11_wait_for_window_manager link error on CentOS 6.5
On Thursday 24 July 2014 08:47:14 Mike Jackson wrote: I am trying to compile some Qt code that is the following: #if defined(Q_WS_X11) extern void qt_x11_wait_for_window_manager(QWidget * mainWin, bool); qt_x11_wait_for_window_manager(mainWin, false); #endif I am trying to reimplement some of the QSplashScreen with some additional functionality and I think I may be missing a link library: This is the error I get during linking: CMakeFiles/DREAM3D.dir/DSplashScreen.cpp.o: In function `DSplashScreen::finish(QWidget*)': DSplashScreen.cpp:(.text+0x33f): undefined reference to `qt_x11_wait_for_window_manager(QWidget*, bool)' collect2: ld returned 1 exit status I have googled as much as I can but can not really reveal what library I am missing to link against. You're not missing any. You're just trying to link against a private symbol that isn't exported. You can't do that. The version you can link to is this: Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget *w) The missing parameter is assumed to be true, unlike what you're doing. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] OpenGL weirdness
Am 24.07.2014 um 14:13 schrieb Yves Bailly yves.bai...@verosoftware.com: [Whenever a Core Profile is explicitly requested rendering stops workin] If I try using some other version: fmt.setVersion(3, 3); fmt.setProfile(QGLFormat::CoreProfile); ...getGetString(GL_VERSION) gives 3.3.0 (as expected), Not directly related to the actual problem, but just to add: in my understanding the actual OpenGL driver is free to choose a higher API version (e.g. 4.4), even when you explicitly request an older one (e.g. 3.3) - as long as the returned context is backwards-compatible, that is! I am not sure whether that is the case here (all 3.3 shaders and GL code would run without modification in 4.4), but in general that is so. So the fact that you really received a 3.3 context when asking for one from a 4.4 capable driver is possible and maybe even likely, but not necessarily to be expected. IIRC on OS X 10.9 you always get a 4.1 context, even when asking for a 3.2 context (on hardware that supports it). but no triangle displayed. Probably again because you are getting a Core Profile. With: fmt.setVersion(2, 1); ...getGetString(GL_VERSION) gives 4.4.0 (unexpected), and no triangle displayed. As already mentioned in a previous reply: maybe a bit unexpected, but totally fine, because you get a Compatibility profile. With simply requesting the profile, without giving a version: Doesn't make sense really: profiles are only introduced on OpenGL 3.2 and above :) Any idea about what's going on? I strongly assume that you're not using any fixed pipeline functions such as glVertex etc. ;) so my best bet would be your shader code: did you copy/paste from some older OpenGL (ES) 2 shaders? Check the GL error state then and when and especially the shader compile/link logs (return values)! Cheers, Oliver ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] qt_x11_wait_for_window_manager link error on CentOS 6.5
On Thursday 24 July 2014 11:20:59 Michael Jackson wrote: Thank you for the insight. I have adjusted my code accordingly and it now compiles file. Thank you again for the help Note that there's a reason why QSplashScreen uses the other function. See this commit: https://qt.gitorious.org/qt/qt/commit/61dfa74bb542f495eb5ff25e3f91b9065eb1cfdd -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] making 'hole' in the rectangle
Is it possible to implement a 'hole' component which would make color of its parent control transparent? For example: Rectangle { width: 100 height: 100 color: 'blue' Rectangle { width: 50 height: 50 color: 'green' Hole { anchors.fill: parent width: 25 height: 50 } } } Expected result: area 100x100, filled with blue and 25x50 (not 50x50 as we erased half of area with 'Hole') area of green on top. ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Input devices auto detection
Greetings! I’m using Qt 5.2.1 on embedded platform (based on TI DM3730, if it makes any sense). I can plug any usb input devices and use them in my Qt apps only when I know exact device name. For example, I can call app: . /myapp -plugin EvdevMouse:/dev/input/event3 EvdevKeyboard:/dev/input/event6 But if need to launch app first, then plug USB devices in, I have no chances to use these devices. So is there any way to solve a problem (in case of EGLFS) ? Best regards, Konstantin Utkin ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest