Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Static Qt build with multiple QPA plugins

    Installation and Deployment
    3
    5
    455
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AnatoliyS 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

      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?
      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply Reply Quote 3
        • A
          AnatoliyS 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:

          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'

          Pablo J. Rogina 1 Reply Last reply Reply Quote 0
          • Pablo J. Rogina
            Pablo J. Rogina @AnatoliyS last edited by

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

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 0
            • A
              AnatoliyS @SGaist 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 Reply Last reply Reply Quote 0
              • First post
                Last post