Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Static Qt build with multiple QPA plugins



  • 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

    1. Is it possible to build multiple plugins statically? Like:
    -static
    -qpa minimal xcb
    
    1. Is it is possible, how two services should be configured to use corresponding plugin? Can we use --platform flag for this?

  • Lifetime Qt Champion

    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".



  • We resolved this by following configuration:

    Build with this: -qpa minimal;xcb

    And then at runtime we can select plugin in two ways:

    1. Add --platform xcb or --platform minimal as cmd line params to Qt application

    or
    2) By setting env variable export QT_QPA_PLATFORM='xcb'



  • @AnatoliyS glad you found a solution to your issue. Please don't forget to mark your post as such! Thanks.



  • @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.
    

Log in to reply