[Development] QPA platform and plugin selection (was: QCommandLineParser)

Thiago Macieira thiago.macieira at intel.com
Tue Jul 30 03:10:34 CEST 2013

On segunda-feira, 29 de julho de 2013 23:01:08, Robin Burchell wrote:
> On Mon, Jul 29, 2013 at 10:46 PM, Thiago Macieira
> <thiago.macieira at intel.com> wrote:
> > PS: the -plugin option has to go. Its name is too generic.
> I argued for that, and -platform to be 'namespaced' a long long time
> ago[1]. The idea was shot down, and while I wasn't exactly thrilled,
> I'd disagree with changing it now. Scripts, software, and whole
> distributions (speaking from personal experience) are making use of
> that argument in a lot of places. If you change it, a lot of things
> will break, and people will be unhappy.
> [1]: https://codereview.qt-project.org/#change,26325

Those things should be handled in the environment. Command-line use of -
platform and -plugin are *ONLY* for software developers to test things out.

Here's why: suppose I am on my traditional X11-based Linux desktop and start a 
Wayland compositor (e.g., Weston) and want to test a Qt Gui application, which 
spawns a second application from inside (QProcess proc; proc.start("app-

If I do:
	./appname -platform wayland

The parent application will show on Wayland, but the child application will 
will show on X, since it has no command-line arguments telling it to use 

If I do:
	QT_QPA_PLATFORM=wayland ./appname

Then both the parent and child applications will show on Wayland.

Now, since both forms are equally easy for a developer to type, I'd argue we 
should deprecate and remove the command-line options in future versions.

Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130729/371c4c7d/attachment.sig>

More information about the Development mailing list