Skip to contentSkip to conversation

qt5: Add an option to select default platform

PATCH New Jérôme Pouiller 3 participants 3 messages Jul 16, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 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.

---
v2:
* Use a string instead of a choice
* Improve help message

 package/qt5/qt5base/Config.in  | 11 +++++++++++
 package/qt5/qt5base/qt5base.mk |  3 +++
 2 files changed, 14 insertions(+)
package/qt5/qt5base/Config.in +11 -0
index 24e5902..632711c 100644
@@ -144,6 +144,17 @@ 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
 
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA
+	string "Default graphical platform"
+	help
+	  Choose the default platform abstraction to use for graphical
+	  application (e.g xcb, linuxfb, eglfs, ...). 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.
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
package/qt5/qt5base/qt5base.mk +3 -0
index 618251e..fecde13 100644
@@ -96,6 +96,9 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
+QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
Signature · 1 line
2.0.1
#1 lore raw

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

J?r?me, All,

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

Quoted 10 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.

Two very small nit-picks, below. Otherwise:

Quoted 15 lines

---
v2:
* Use a string instead of a choice
* Improve help message

 package/qt5/qt5base/Config.in  | 11 +++++++++++
 package/qt5/qt5base/qt5base.mk |  3 +++
 2 files changed, 14 insertions(+)
package/qt5/qt5base/Config.in +0 -0
index 24e5902..632711c 100644

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

Quoted 8 lines
package/qt5/qt5base/Config.in +5 -0
@@ -144,6 +144,17 @@ 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
 
+config BR2_PACKAGE_QT5BASE_DEFAULT_QPA
+	string "Default graphical platform"
+	help
+	  Choose the default platform abstraction to use for graphical
+	  application (e.g xcb, linuxfb, eglfs, ...). If this is empty, the

applications <- plural, no?

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

Quoted 3 lines
package/qt5/qt5base/Config.in +3 -0
+	  default for your architecture will be used (usually this is eglfs).
+
+	  You can get a list of supported platform by running a Qt application

platforms <- plural, too, no?

Regards,
Yann E. MORIN.

Quoted 23 lines
package/qt5/qt5base/Config.in +3 -0
+	  with the option "-platform help" on your target. You can choose a
+	  different platform at runtime with the -platform option.
+
 config BR2_PACKAGE_QT5BASE_PRINTSUPPORT
 	bool "print support module"
 	select BR2_PACKAGE_QT5BASE_WIDGETS
package/qt5/qt5base/qt5base.mk +3 -0
index 618251e..fecde13 100644
@@ -96,6 +96,9 @@ else
 QT5BASE_CONFIGURE_OPTS += -no-xcb
 endif
 
+QT5BASE_DEFAULT_QPA = $(call qstrip,$(BR2_PACKAGE_QT5BASE_DEFAULT_QPA))
+QT5BASE_CONFIGURE_OPTS += $(if $(QT5BASE_DEFAULT_QPA),-qpa $(QT5BASE_DEFAULT_QPA))
+
 ifeq ($(BR2_PACKAGE_QT5BASE_EGLFS),y)
 QT5BASE_CONFIGURE_OPTS += -opengl es2 -eglfs
 QT5BASE_DEPENDENCIES   += libgles libegl
Signature · 1 line
2.0.1
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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

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

In reply to Jérôme Pouiller

Dear J?r?me Pouiller,

Quoted 10 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.

Thanks, applied with the minor fixes suggested by Yann E. Morin.

Thomas

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