Skip to contentSkip to conversation

qt5: Add an option to select default platform

PATCH Superseded Jérôme Pouiller 4 participants 5 messages Jul 4, 2014 – Jul 15, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qt5: Add an option to select default platform

Whithout this path, default platform is automaticaly set (generally set to "eglfs" as defined in qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice is not always what the user would like. Thus, user have to manually appends "-platform <BACKEND>" to command line when running any qt5 application.

This patch allows user to choose default platform explicitly.

---
 package/qt5/qt5base/Config.in  | 43 ++++++++++++++++++++++++++++++++++++++++++
 package/qt5/qt5base/qt5base.mk |  6 ++++++
 2 files changed, 49 insertions(+)
package/qt5/qt5base/Config.in +43 -0
index 70ddcd3..5fa7c02 100644
@@ -144,6 +144,49 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	help
+	  Notice you may choose platform at runtime using -platform (-platform
+	  help to get list of compiled platforms).
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	bool "minimal"
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN
+	bool "offscreen"
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB
+	bool "linuxfb"
+	depends on BR2_PACKAGE_QT5BASE_LINUXFB
+
+comment 'linuxfb needs linuxfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_LINUXFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_DIRECTFB
+	bool "directfb"
+	depends on BR2_PACKAGE_QT5BASE_DIRECTFB
+
+comment 'directfb needs directfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_DIRECTFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB
+	bool "xcb"
+	depends on BR2_PACKAGE_QT5BASE_XCB
+
+comment 'xcb needs X.org XCB support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_XCB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS
+	bool "eglfs"
+	depends on BR2_PACKAGE_QT5BASE_EGLFS
+
+comment 'eglfs needs eglfs support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_EGLFS
+
+endchoice
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
package/qt5/qt5base/qt5base.mk +6 -0
index 618251e..9018ff8 100644
@@ -96,6 +96,12 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL),-qpa minimalb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN),-qpa offscreen)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB),-qpa linuxfb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB),-qpa xcb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS),-qpa eglfs)
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
Signature · 1 line
2.0.0
#1 lore raw

PATCH 1/1 qt5: Add an option to select default platform

Dear J?r?me Pouiller,

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_EGLFS · line 155

Quoted 9 lines · J?r?me Pouiller
package/qt5/qt5base/Config.in +9 -0
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	help
+	  Notice you may choose platform at runtime using -platform (-platform
+	  help to get list of compiled platforms).
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	bool "minimal"

Maybe some help text would be appropriate here...

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_EGLFS · line 158

Quoted 3 lines
package/qt5/qt5base/Config.in +3 -0
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN
+	bool "offscreen"

... and here, to describe what those platforms are.

Are they actually useful in practice? What do they do?

Quoted 1 line

+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL),-qpa minimalb)

is "minimalb" intended here, as opposed to "minimal"?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 qt5: Add an option to select default platform

In reply to Jérôme Pouiller
Quoted 20 lines · J?r?me Pouiller

Whithout this path, default platform is automaticaly set (generally set to "eglfs" as defined in qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice is not always what the user would like. Thus, user have to manually appends "-platform <BACKEND>" to command line when running any qt5 application.

This patch allows user to choose default platform explicitly.

---
 package/qt5/qt5base/Config.in  | 43 ++++++++++++++++++++++++++++++++++++++++++
 package/qt5/qt5base/qt5base.mk |  6 ++++++
 2 files changed, 49 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 70ddcd3..5fa7c02 100644

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_EGLFS · line 149

Quoted 6 lines
package/qt5/qt5base/Config.in +3 -0
@@ -144,6 +144,49 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL

I wonder if it is really worthwhile to make this a choice. That means that
whenever a new platform is added (wayland, vnc, ...) we have to update the choice. And one could imagine a user implementing their own QPA plugin...

So I would propose to make this a string, default to empty, and when it's empty
don't pass the -qpa option.

Help text could be something like

Choose the default platform abstraction to use for graphical application. If this is empty, the default for your architecture will be used (usually this is eglfs).

You can get a list of supported platform by running a Qt application with the option "-platform help" on your target. You can choose a different platform at runtime with the -platform option.

Regards,
Arnout

Quoted 61 lines
package/qt5/qt5base/Config.in +40 -0
+	help
+	  Notice you may choose platform at runtime using -platform (-platform
+	  help to get list of compiled platforms).
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL
+	bool "minimal"
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN
+	bool "offscreen"
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB
+	bool "linuxfb"
+	depends on BR2_PACKAGE_QT5BASE_LINUXFB
+
+comment 'linuxfb needs linuxfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_LINUXFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_DIRECTFB
+	bool "directfb"
+	depends on BR2_PACKAGE_QT5BASE_DIRECTFB
+
+comment 'directfb needs directfb support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_DIRECTFB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB
+	bool "xcb"
+	depends on BR2_PACKAGE_QT5BASE_XCB
+
+comment 'xcb needs X.org XCB support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_XCB
+
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS
+	bool "eglfs"
+	depends on BR2_PACKAGE_QT5BASE_EGLFS
+
+comment 'eglfs needs eglfs support enabled'
+	depends on !BR2_PACKAGE_QT5BASE_EGLFS
+
+endchoice
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
package/qt5/qt5base/qt5base.mk +6 -0
index 618251e..9018ff8 100644
@@ -96,6 +96,12 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL),-qpa minimalb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_OFFSCREEN),-qpa offscreen)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_LINUXFB),-qpa linuxfb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_XCB),-qpa xcb)
+QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_DEFAULT_QPA_EGLFS),-qpa eglfs)
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/1 qt5: Add an option to select default platform

Hello Arnout,

Quoted 36 lines · On Friday 04 July 2014 22:03:09 Arnout Vandecappelle wrote:
Quoted 22 lines · J?r?me Pouiller

Whithout this path, default platform is automaticaly set (generally set to "eglfs" as defined in qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice is not always what the user would like. Thus, user have to manually appends "-platform <BACKEND>" to command line when running any qt5 application.

This patch allows user to choose default platform explicitly.

---

 package/qt5/qt5base/Config.in  | 43
 ++++++++++++++++++++++++++++++++++++++++++
 package/qt5/qt5base/qt5base.mk |  6 ++++++
 2 files changed, 49 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 70ddcd3..5fa7c02 100644

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_EGLFS · line 151

Quoted 8 lines
package/qt5/qt5base/Config.in +3 -0
@@ -144,6 +144,49 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL

I wonder if it is really worthwhile to make this a choice. That means that
whenever a new platform is added (wayland, vnc, ...) we have to update the choice. And one could imagine a user implementing their own QPA plugin...

Quoted 2 lines

So I would propose to make this a string, default to empty, and when it's
empty don't pass the -qpa option.

I have no opinion on that. If nobody has any arguments against, I am going to implement this idea.

Signature · 3 lines
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
#4 lore raw

PATCH 1/1 qt5: Add an option to select default platform

J?r?me, All,

On 2014-07-07 09:58 +0200, J?r?me Pouiller spake thusly:

Quoted 37 lines · On Friday 04 July 2014 22:03:09 Arnout Vandecappelle wrote:
Quoted 36 lines · J?r?me Pouiller
Quoted 22 lines

Whithout this path, default platform is automaticaly set (generally set to "eglfs" as defined in qt5base/mkspecs/devices/common/linux_device_pre.conf:1). This choice is not always what the user would like. Thus, user have to manually appends "-platform <BACKEND>" to command line when running any qt5 application.

This patch allows user to choose default platform explicitly.

---

 package/qt5/qt5base/Config.in  | 43
 ++++++++++++++++++++++++++++++++++++++++++
 package/qt5/qt5base/qt5base.mk |  6 ++++++
 2 files changed, 49 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 70ddcd3..5fa7c02 100644

package/qt5/qt5base/Config.in config BR2_PACKAGE_QT5BASE_EGLFS · line 151

Quoted 8 lines
package/qt5/qt5base/Config.in +3 -0
@@ -144,6 +144,49 @@ config BR2_PACKAGE_QT5BASE_EGLFS
 
 comment "eglfs backend available if OpenGLES and EGL are enabled"
 
 	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGLES
 
+choice
+	prompt "default graphical platform"
+	default BR2_PACKAGE_QT5BASE_DEFAULT_QPA_MINIMAL

I wonder if it is really worthwhile to make this a choice. That means that
whenever a new platform is added (wayland, vnc, ...) we have to update the choice. And one could imagine a user implementing their own QPA plugin...

Quoted 4 lines
Quoted 2 lines

So I would propose to make this a string, default to empty, and when it's
empty don't pass the -qpa option.

I have no opinion on that. If nobody has any arguments against, I am going to implement this idea.

Yes, I concur with Arnout: that would be a better solution.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'