Static Qt build with multiple QPA plugins
-
wrote on 17 Jul 2019, 15:54 last edited by
Goal
We need to have a static build of Qt to be able to deploy it on our machines easily. This build will be used by two services (two separate deployments), one of them will use qminimal, another will use qxcb QPA plugins.We would like to have just one build, and then each service will use the plugin that it needs. For example, we could use --platform to select QPA plugin.
Problem
We are using these configuration flags for our build:-static -qpa xcb
or
-static -qpa minimal
This works for just one plugin, but we don't know how to combine plugins in one build.
Questions
- Is it possible to build multiple plugins statically? Like:
-static -qpa minimal xcb
- Is it is possible, how two services should be configured to use corresponding plugin? Can we use --platform flag for this?
-
Hi and welcome to devnet,
The
-qpa
parameter is either one value or a semi-colon separated list to prioritise which backend to use.If you call
/path/to/Qt_src/configure --help
you'll have a list of available backend that you can enable in your build under "Platform backends". -
wrote on 18 Jul 2019, 10:46 last edited by
We resolved this by following configuration:
Build with this:
-qpa minimal;xcb
And then at runtime we can select plugin in two ways:
- Add
--platform xcb
or--platform minimal
as cmd line params to Qt application
or
2) By setting env variableexport QT_QPA_PLATFORM='xcb'
- Add
-
We resolved this by following configuration:
Build with this:
-qpa minimal;xcb
And then at runtime we can select plugin in two ways:
- Add
--platform xcb
or--platform minimal
as cmd line params to Qt application
or
2) By setting env variableexport QT_QPA_PLATFORM='xcb'
wrote on 18 Jul 2019, 12:23 last edited by@AnatoliyS glad you found a solution to your issue. Please don't forget to mark your post as such! Thanks.
- Add
-
Hi and welcome to devnet,
The
-qpa
parameter is either one value or a semi-colon separated list to prioritise which backend to use.If you call
/path/to/Qt_src/configure --help
you'll have a list of available backend that you can enable in your build under "Platform backends".wrote on 19 Jul 2019, 08:38 last edited by@SGaist when we tried to use a list of values, it didn't work for us:
This application failed to start because it could not find or load the Qt platform plugin "minimal;xcb" in "". Available platform plugins are: minimal, xcb.
1/5