Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QT with composite windows: (10 Items)
   
QT with composite windows  
I'm a QNX newbie on trial licenses evaluating QNX with QT for future applications for our company.

I've built a BSP and boot image, integrated QT, CAN and other drivers. I've written a small QT application driven by CAN
 messages from a PLC running CodeSys. So far so good.

I would like now to run several QT application windows as separate processes within different QNX screen composite 
windows. My architectural aim is not to have a huge monolithic HMI, we also have the need to mix technologies other than
 QT.

I've read the documentation such as at 

http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.screen%2Ftopic%2Fmanual%2Fcscreen_composition.html


I've also searched the QT forum but not turned up anything helpful.

and understand the principles. However, I have no idea how to implement this in practice e.g. how can a QWindow be 
created separate as a separate window from the 'screen' processes.

I'm using SDP 6.6 with qnx-sdk-for-apps-and-media-1.1-201503251644 which I think contains pre-compile QT 5.3 libraries. 
For hardware, I'm using Sabrelite board.

Any more detailed pointers or better code samples would be extremely helpful.

Thanks
Nick Barton




RE: QT with composite windows  
I don't entirely understand your question but I'll try to provide some information that might help. 

Each QWindow is associated with a separate screen window.  If you have multiple Qt processes, each with a QWindow with 
their x, y, width and height properties set so that they are not totally overlapping they should all show up on the 
screen at the same time.  This might be enough if your needs are very simple i.e. you have a fixed layout of the screen.

If you require more than this you are likely to want a process to act as a window manager.  This will get events from 
screen notifying it of the creation of top level windows from other processes and it can change positions, z-order, 
displayed sizes and visibility of these windows.  With the current QNX Qt platform plugin it is not possible for a Qt 
application to act as a window manager, or at least Qt provides nothing to help you with this (you'd have to create a 
separate window manager screen context and monitor events from it in a separate thread).

We have developed a new QNX platform plugin for Qt which we are in the process of upstreaming to code.qt.io that 
provides much better integration with screen including the ability for a Qt app to act as a window manager and the 
ability to modify most or all screen window properties associated with a QWindow.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Wednesday, February 03, 2016 10:09 AM
To: ostech-core_os
Subject: QT with composite windows

I'm a QNX newbie on trial licenses evaluating QNX with QT for future applications for our company.

I've built a BSP and boot image, integrated QT, CAN and other drivers. I've written a small QT application driven by CAN
 messages from a PLC running CodeSys. So far so good.

I would like now to run several QT application windows as separate processes within different QNX screen composite 
windows. My architectural aim is not to have a huge monolithic HMI, we also have the need to mix technologies other than
 QT.

I've read the documentation such as at

http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.screen%2Ftopic%2Fmanual%2Fcscreen_composition.html

I've also searched the QT forum but not turned up anything helpful.

and understand the principles. However, I have no idea how to implement this in practice e.g. how can a QWindow be 
created separate as a separate window from the 'screen' processes.

I'm using SDP 6.6 with qnx-sdk-for-apps-and-media-1.1-201503251644 which I think contains pre-compile QT 5.3 libraries. 
For hardware, I'm using Sabrelite board.

Any more detailed pointers or better code samples would be extremely helpful.

Thanks
Nick Barton








_______________________________________________

OSTech
http://community.qnx.com/sf/go/post115664
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
RE: QT with composite windows  
Thanks for your email Roger

I don't think the first solution will be enough as it won't provide the ability to mix technologies i.e. QT apps, Open 
EGL apps, HTML5 apps.

Also if I've understood you correctly, they won't be separate QNX processes but QT threads running QT Windows i.e. it 
would still be a monolithic app. I'm trying to avoid that architecture as it is cumbersome to maintain, inflexible in 
deployment to different product streams (we have many derivitave products that have more or less features), harder to 
manage the processes i.e. mapping resources to a HMI process that implements safety function, also control via the High 
Availability Module HAM.

When will the plugin you are working on be available?

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com] 
Sent: 03 February 2016 17:01
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

I don't entirely understand your question but I'll try to provide some information that might help. 

Each QWindow is associated with a separate screen window.  If you have multiple Qt processes, each with a QWindow with 
their x, y, width and height properties set so that they are not totally overlapping they should all show up on the 
screen at the same time.  This might be enough if your needs are very simple i.e. you have a fixed layout of the screen.


If you require more than this you are likely to want a process to act as a window manager.  This will get events from 
screen notifying it of the creation of top level windows from other processes and it can change positions, z-order, 
displayed sizes and visibility of these windows.  With the current QNX Qt platform plugin it is not possible for a Qt 
application to act as a window manager, or at least Qt provides nothing to help you with this (you'd have to create a 
separate window manager screen context and monitor events from it in a separate thread).

We have developed a new QNX platform plugin for Qt which we are in the process of upstreaming to code.qt.io that 
provides much better integration with screen including the ability for a Qt app to act as a window manager and the 
ability to modify most or all screen window properties associated with a QWindow.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Wednesday, February 03, 2016 10:09 AM
To: ostech-core_os
Subject: QT with composite windows

I'm a QNX newbie on trial licenses evaluating QNX with QT for future applications for our company.

I've built a BSP and boot image, integrated QT, CAN and other drivers. I've written a small QT application driven by CAN
 messages from a PLC running CodeSys. So far so good.

I would like now to run several QT application windows as separate processes within different QNX screen composite 
windows. My architectural aim is not to have a huge monolithic HMI, we also have the need to mix technologies other than
 QT.

I've read the documentation such as at

http://www.qnx.com/developers/docs/660/index.jsp?topic=%2Fcom.qnx.doc.screen%2Ftopic%2Fmanual%2Fcscreen_composition.html


I've also searched the QT forum but not turned up anything helpful.

and understand the principles. However, I have no idea how to implement this in practice e.g. how can a QWindow be 
created separate as a separate window from the 'screen' processes.

I'm using SDP 6.6 with qnx-sdk-for-apps-and-media-1.1-201503251644 which I think contains pre-compile QT 5.3 libraries. 
For hardware, I'm using Sabrelite board.

Any more detailed pointers or better code samples would be extremely helpful.

Thanks
Nick Barton








_______________________________________________

OSTech
http://community.qnx.com/sf/go/post115664
To cancel your subscription to this discussion, please e-mail...
View Full Message
RE: QT with composite windows  
No, what I was talking about doesn't require that everything be in one process or be solely Qt. 

The simple case I mentioned allows any mixture of processes using any type rendering, Qt, OpenGL, HTML5.  It's just in 
this case because there is no window manager the applications themselves are responsible for their own layout.  If the 
set of windows display on the screen is fixed then this can work OK.  Each process arranges to create their window with 
the appropriate size and positions it at the appropriate place and you're done.

Where this doesn't work is where things need to be more dynamic, especially if you're aiming for fancy effects.  If you 
want to have windows come and go and change positions then it helps to have something central to do this which is where 
window managers come into the picture.  If you're developing a product like a typical smartphone you need a window 
manager, if it's something like a medical device which has a fixed set of windows in a fixed arrangement then you might 
not.

A window manager can be a regular graphical application which has its own windows or it can do nothing but window 
management.  The restriction about Qt apps acting as window managers is that to do anything in screen you have to create
 a screen context and their are two types of them, application contexts and window manager contexts and the current QNX 
plugin creates a application context.  If you're writing a Qt app there is nothing to prevent you from creating a 
separate window manager context it's just that Qt doesn't do anything much to help you.

I'm not sure when the new plugin will be available (I'm no longer working on Qt).  We are actively working on 
upstreaming the code so the time depends partially on how long it takes to get the Qt community to accept it.  I've no 
idea when QNX would provide binaries for it though once it has been upstreamed the source will be publically available. 
 One complication with it is there are aspects of it that make use of new features of screen that have not yet been 
released, they're not essential for most of the core functionality but they make it all a little harder.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 4:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks for your email Roger

I don't think the first solution will be enough as it won't provide the ability to mix technologies i.e. QT apps, Open 
EGL apps, HTML5 apps.

Also if I've understood you correctly, they won't be separate QNX processes but QT threads running QT Windows i.e. it 
would still be a monolithic app. I'm trying to avoid that architecture as it is cumbersome to maintain, inflexible in 
deployment to different product streams (we have many derivitave products that have more or less features), harder to 
manage the processes i.e. mapping resources to a HMI process that implements safety function, also control via the High 
Availability Module HAM.

When will the plugin you are working on be available?

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com]
Sent: 03 February 2016 17:01
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

I don't entirely understand your question but I'll try to provide some information that might help.

Each QWindow is associated with a separate screen window.  If you have multiple Qt processes, each with a QWindow with 
their x, y, width and height properties set so that they are not totally overlapping they should all show up on the 
screen at the same time.  This might be enough if your needs are very simple i.e. you have a fixed layout of the screen.

If you require more than this you are likely to want a process to act as a window manager.  This will get events from 
screen notifying it of the creation of top level windows from other processes and it can change positions, z-order, 
displayed sizes and visibility of these...
View Full Message
RE: QT with composite windows  
Thanks Roger, got it.

The first case is just fine for us, multiple GUI processes talking to separate Screen windows, possibly different 
technologies but mostly Qt processes and most importantly fixed layout of windows. The only important thing over this is
 for the windows to be able to be made visible or hidden depending on the state of the system.

Given that, have you got any code examples of how to achieve the above, particularly how to create a simple QT 
application within a Screen window. Just need a starting point.

Thanks
Nick

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com] 
Sent: 04 February 2016 13:41
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

No, what I was talking about doesn't require that everything be in one process or be solely Qt. 

The simple case I mentioned allows any mixture of processes using any type rendering, Qt, OpenGL, HTML5.  It's just in 
this case because there is no window manager the applications themselves are responsible for their own layout.  If the 
set of windows display on the screen is fixed then this can work OK.  Each process arranges to create their window with 
the appropriate size and positions it at the appropriate place and you're done.

Where this doesn't work is where things need to be more dynamic, especially if you're aiming for fancy effects.  If you 
want to have windows come and go and change positions then it helps to have something central to do this which is where 
window managers come into the picture.  If you're developing a product like a typical smartphone you need a window 
manager, if it's something like a medical device which has a fixed set of windows in a fixed arrangement then you might 
not.

A window manager can be a regular graphical application which has its own windows or it can do nothing but window 
management.  The restriction about Qt apps acting as window managers is that to do anything in screen you have to create
 a screen context and their are two types of them, application contexts and window manager contexts and the current QNX 
plugin creates a application context.  If you're writing a Qt app there is nothing to prevent you from creating a 
separate window manager context it's just that Qt doesn't do anything much to help you.

I'm not sure when the new plugin will be available (I'm no longer working on Qt).  We are actively working on 
upstreaming the code so the time depends partially on how long it takes to get the Qt community to accept it.  I've no 
idea when QNX would provide binaries for it though once it has been upstreamed the source will be publically available. 
 One complication with it is there are aspects of it that make use of new features of screen that have not yet been 
released, they're not essential for most of the core functionality but they make it all a little harder.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 4:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks for your email Roger

I don't think the first solution will be enough as it won't provide the ability to mix technologies i.e. QT apps, Open 
EGL apps, HTML5 apps.

Also if I've understood you correctly, they won't be separate QNX processes but QT threads running QT Windows i.e. it 
would still be a monolithic app. I'm trying to avoid that architecture as it is cumbersome to maintain, inflexible in 
deployment to different product streams (we have many derivitave products that have more or less features), harder to 
manage the processes i.e. mapping resources to a HMI process that implements safety function, also control via the High 
Availability Module HAM.

When will the plugin you are working on be available?

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com]
Sent: 03 February 2016 17:01
To:...
View Full Message
RE: QT with composite windows  
You could try this as an example though no promises as to whether it actually works.  I'm not working on Qt just now and
 not in a position to try it out.  Hopefully it be of some use even if not quite right (and it's pretty trivial).

________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 9:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks Roger, got it.

The first case is just fine for us, multiple GUI processes talking to separate Screen windows, possibly different 
technologies but mostly Qt processes and most importantly fixed layout of windows. The only important thing over this is
 for the windows to be able to be made visible or hidden depending on the state of the system.

Given that, have you got any code examples of how to achieve the above, particularly how to create a simple QT 
application within a Screen window. Just need a starting point.

Thanks
Nick

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com]
Sent: 04 February 2016 13:41
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

No, what I was talking about doesn't require that everything be in one process or be solely Qt.

The simple case I mentioned allows any mixture of processes using any type rendering, Qt, OpenGL, HTML5.  It's just in 
this case because there is no window manager the applications themselves are responsible for their own layout.  If the 
set of windows display on the screen is fixed then this can work OK.  Each process arranges to create their window with 
the appropriate size and positions it at the appropriate place and you're done.

Where this doesn't work is where things need to be more dynamic, especially if you're aiming for fancy effects.  If you 
want to have windows come and go and change positions then it helps to have something central to do this which is where 
window managers come into the picture.  If you're developing a product like a typical smartphone you need a window 
manager, if it's something like a medical device which has a fixed set of windows in a fixed arrangement then you might 
not.

A window manager can be a regular graphical application which has its own windows or it can do nothing but window 
management.  The restriction about Qt apps acting as window managers is that to do anything in screen you have to create
 a screen context and their are two types of them, application contexts and window manager contexts and the current QNX 
plugin creates a application context.  If you're writing a Qt app there is nothing to prevent you from creating a 
separate window manager context it's just that Qt doesn't do anything much to help you.

I'm not sure when the new plugin will be available (I'm no longer working on Qt).  We are actively working on 
upstreaming the code so the time depends partially on how long it takes to get the Qt community to accept it.  I've no 
idea when QNX would provide binaries for it though once it has been upstreamed the source will be publically available. 
 One complication with it is there are aspects of it that make use of new features of screen that have not yet been 
released, they're not essential for most of the core functionality but they make it all a little harder.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 4:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks for your email Roger

I don't think the first solution will be enough as it won't provide the ability to mix technologies i.e. QT apps, Open 
EGL apps, HTML5 apps.

Also if I've understood you correctly, they won't be separate QNX processes but QT threads running QT Windows i.e. it 
would still be a monolithic app. I'm trying to avoid that architecture as it is cumbersome to maintain, inflexible in 
deployment to different product streams (we have many derivitave...
View Full Message
Attachment: Text play.tgz 14.86 KB
RE: QT with composite windows  
That's great Roger,

Any help is welcome. I just need to get to a starting point upon which I can develop.

Regards
Nick

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com] 
Sent: 05 February 2016 13:48
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

You could try this as an example though no promises as to whether it actually works.  I'm not working on Qt just now and
 not in a position to try it out.  Hopefully it be of some use even if not quite right (and it's pretty trivial).

________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 9:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks Roger, got it.

The first case is just fine for us, multiple GUI processes talking to separate Screen windows, possibly different 
technologies but mostly Qt processes and most importantly fixed layout of windows. The only important thing over this is
 for the windows to be able to be made visible or hidden depending on the state of the system.

Given that, have you got any code examples of how to achieve the above, particularly how to create a simple QT 
application within a Screen window. Just need a starting point.

Thanks
Nick

-----Original Message-----
From: Roger Maclean [mailto:community-noreply@qnx.com]
Sent: 04 February 2016 13:41
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

No, what I was talking about doesn't require that everything be in one process or be solely Qt.

The simple case I mentioned allows any mixture of processes using any type rendering, Qt, OpenGL, HTML5.  It's just in 
this case because there is no window manager the applications themselves are responsible for their own layout.  If the 
set of windows display on the screen is fixed then this can work OK.  Each process arranges to create their window with 
the appropriate size and positions it at the appropriate place and you're done.

Where this doesn't work is where things need to be more dynamic, especially if you're aiming for fancy effects.  If you 
want to have windows come and go and change positions then it helps to have something central to do this which is where 
window managers come into the picture.  If you're developing a product like a typical smartphone you need a window 
manager, if it's something like a medical device which has a fixed set of windows in a fixed arrangement then you might 
not.

A window manager can be a regular graphical application which has its own windows or it can do nothing but window 
management.  The restriction about Qt apps acting as window managers is that to do anything in screen you have to create
 a screen context and their are two types of them, application contexts and window manager contexts and the current QNX 
plugin creates a application context.  If you're writing a Qt app there is nothing to prevent you from creating a 
separate window manager context it's just that Qt doesn't do anything much to help you.

I'm not sure when the new plugin will be available (I'm no longer working on Qt).  We are actively working on 
upstreaming the code so the time depends partially on how long it takes to get the Qt community to accept it.  I've no 
idea when QNX would provide binaries for it though once it has been upstreamed the source will be publically available. 
 One complication with it is there are aspects of it that make use of new features of screen that have not yet been 
released, they're not essential for most of the core functionality but they make it all a little harder.


________________________________________
From: Nick Barton [community-noreply@qnx.com]
Sent: Thursday, February 04, 2016 4:00 AM
To: ostech-core_os@community.qnx.com
Subject: RE: QT with composite windows

Thanks for your email Roger

I don't think the first solution will be enough as it won't provide the ability to...
View Full Message
Re: RE: QT with composite windows  
Nick-  If you build your own Qt libraries, you "may" have to set this environment variable to keep the app from taking 
the full screen.  (Building against Apps & Media Qt libraries does not require this!)   

export QT_QPA_PLATFORM=qnx:no-fullscreen

Of course its hard to "share" the screen with multiple apps if one component covers it all.

RE: RE: QT with composite windows  
Dennis

Thanks for the tip. 

I have built Qt 5 but for the x86 integrated into Visual Studio.

I fully intend to build Qt 5 for ARM using the Momentics compiler but haven't done so yet.

Nick

-----Original Message-----
From: Dennis Kellly [mailto:community-noreply@qnx.com] 
Sent: 05 February 2016 15:11
To: ostech-core_os <ostech-core_os@community.qnx.com>
Subject: Re: RE: QT with composite windows

Nick-  If you build your own Qt libraries, you "may" have to set this environment variable to keep the app from taking 
the full screen.  (Building against Apps & Media Qt libraries does not require this!)   

export QT_QPA_PLATFORM=qnx:no-fullscreen

Of course its hard to "share" the screen with multiple apps if one component covers it all.





_______________________________________________

OSTech
http://community.qnx.com/sf/go/post115685
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com
RE: RE: QT with composite windows  
Thanks Dennis

All that was actually needed was to set export the environmental variable (which I added to my BSP build), then  set the
 Qt window size  and position and that worked. No need to re-compile the Qt libraries.

Thanks again
Nick

-----Original Message-----
From: Dennis Kellly [mailto:community-noreply@qnx.com] 
Sent: 05 February 2016 15:11
To: ostech-core_os <ostech-core_os@community.qnx.com>
Subject: Re: RE: QT with composite windows

Nick-  If you build your own Qt libraries, you "may" have to set this environment variable to keep the app from taking 
the full screen.  (Building against Apps & Media Qt libraries does not require this!)   

export QT_QPA_PLATFORM=qnx:no-fullscreen

Of course its hard to "share" the screen with multiple apps if one component covers it all.





_______________________________________________

OSTech
http://community.qnx.com/sf/go/post115685
To cancel your subscription to this discussion, please e-mail ostech-core_os-unsubscribe@community.qnx.com