Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting Qt application to honour dark theme on Lubuntu 26.04.1
Qt 6.12 LTS is out! See what's new in the release blog

Getting Qt application to honour dark theme on Lubuntu 26.04.1

Scheduled Pinned Locked Moved Unsolved General and Desktop
31 Posts 7 Posters 1.6k Views 4 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote last edited by
    #22

    Hi,

    You need to build that plug-in with the Qt version you use to build your application. What happens is that you have Qt 6.10.0 loaded in memory for your application but that plug-in was built for 6.10.2.

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

    1 Reply Last reply
    1
    • PerdrixP Offline
      PerdrixP Offline
      Perdrix
      wrote last edited by Perdrix
      #23

      @SGaist That makes sense, but OTOH I'd much prefer that Qt delivered it as part of the Qt distro ... and automatically searched for it. Hence the problem report I opened.

      D.

      SGaistS 1 Reply Last reply
      0
      • PerdrixP Perdrix

        @SGaist That makes sense, but OTOH I'd much prefer that Qt delivered it as part of the Qt distro ... and automatically searched for it. Hence the problem report I opened.

        D.

        SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #24

        @Perdrix The thing is: that plugin is not part of Qt hence cannot be distributed with it.

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

        1 Reply Last reply
        0
        • PerdrixP Offline
          PerdrixP Offline
          Perdrix
          wrote last edited by Perdrix
          #25

          So you are saying that the plugin for e.g. kde is part of Qt, and that you think it’s viable for me to tell my users to do their own build of the plugins, or that you think that I should build and ship them with my product??

          The only way that makes sense to me is for Qt to ship them.

          As things stand, the theme support just doesn’t work for any Lubuntu users.

          Christian EhrlicherC JKSHJ 2 Replies Last reply
          0
          • PerdrixP Perdrix

            So you are saying that the plugin for e.g. kde is part of Qt, and that you think it’s viable for me to tell my users to do their own build of the plugins, or that you think that I should build and ship them with my product??

            The only way that makes sense to me is for Qt to ship them.

            As things stand, the theme support just doesn’t work for any Lubuntu users.

            Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote last edited by
            #26

            @Perdrix said in Getting Qt application to honour dark theme on Lubuntu 26.04.1:

            The only way that makes sense to me is for Qt to ship them.

            Again: it's a third party plugin. How can Qt ship this at all? Ask your distribution to ship it as this is the right place.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0
            • PerdrixP Offline
              PerdrixP Offline
              Perdrix
              wrote last edited by
              #27

              The distro cannot ship it as it has to be built with the exact level of Qt that is used to build and package my application. It needs a different build of the plugin for every Qt release.

              1 Reply Last reply
              0
              • PerdrixP Perdrix

                So you are saying that the plugin for e.g. kde is part of Qt, and that you think it’s viable for me to tell my users to do their own build of the plugins, or that you think that I should build and ship them with my product??

                The only way that makes sense to me is for Qt to ship them.

                As things stand, the theme support just doesn’t work for any Lubuntu users.

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote last edited by
                #28

                @Perdrix said in Getting Qt application to honour dark theme on Lubuntu 26.04.1:

                I should build and ship them with my product??

                It looks like you already ship a copy of Qt and its official plugins. So, it makes sense to ship a copy of the 3rd-party plugin of interest too, right? @IgKh already found the source code for you in an earlier post, which contains compilation instructions.: https://github.com/lxqt/lxqt-qtplugin

                Alternatively, you could make your application depend on the distro's copy of Qt instead of your own copy. That way, the app can also load the distro's copy of libqtlxqt.so

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                0
                • PerdrixP Offline
                  PerdrixP Offline
                  Perdrix
                  wrote last edited by Perdrix
                  #29

                  Alternatively, you could make your application depend on the distro's copy of Qt

                  That wouldn't work on most Linux distros, and the installed Qt would need to exactly match the verison of Qt I built my application with.

                  JKSHJ 1 Reply Last reply
                  0
                  • PerdrixP Perdrix

                    Alternatively, you could make your application depend on the distro's copy of Qt

                    That wouldn't work on most Linux distros, and the installed Qt would need to exactly match the verison of Qt I built my application with.

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote last edited by
                    #30

                    @Perdrix said in Getting Qt application to honour dark theme on Lubuntu 26.04.1:

                    That wouldn't work on most Linux distros, and the installed Qt would need to exactly match the verison of Qt I built my application with.

                    An exact match is not needed. Qt promises compatibility: If you build your application with an older version of Qt 6, then users can run it with a newer version of Qt 6.

                    There have been times when compatibility was accidentally broken. When this happens, it is treated as a critical bug and all effort will be made to restore compatibility (example: https://qt-project.atlassian.net/browse/QTBUG-135578 )

                    Anyway, building and shipping libqtlxqt.so remains a valid solution.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    2
                    • S Offline
                      S Offline
                      SimonSchroeder
                      wrote last edited by
                      #31

                      A different post I replied to surfaced a different idea: On Linux we are distributing our app as AppImage. This will package all dependencies into an executable image. It is not the ideal solution for Linux, but if you have a small software that is not included in official repositories of the distros it is the much better option for maintainability. This would package both Qt and libqtlxqt alongside your app. It also does not require any special installation. Though, once you go down that path it is quite easy to register your app through xdg.

                      Here is roughly how we deploy our AppImage:

                      #!/bin/bash
                      
                      LD_LIBRARY_PATH= # additional library paths if required
                      export LD_LIBRARY_PATH
                      
                      chmod u+x linuxdeploy*.AppImage # on CI/CD this might not have the executable flag when checked out
                      export VERSION=1.0.0
                      
                      echo == Remove old AppDir. ==
                      rm -rf AppDir
                      
                      echo == Generate new AppDir. ==
                      ./linuxdeploy-x86_64.AppImage --appdir=AppDir --executable=../release/MyApp --desktop-file=MyApp.desktop --icon-file=MyApp.svg
                      
                      echo == Bundle Qt libs and create AppImage. ==
                      cd AppDir
                      ../linuxdeployqt-6-x86_64.AppImage MyApp.desktop -qmake=/path/to/qmake -appimage
                      
                      echo == Done. ==
                      

                      You'll see that we use both linuxdeploy and linuxdeployqt. This is at least what worked for us. These tools require you not to use the newest version of Linux because they want to ensure broad portability.

                      I guess that LGPL conformance is given because the AppImage is just a regular image that can be mounted regularly and thus someone might be able to exchange the libraries inside it.

                      Just for completeness sake: Besides AppImage there is also Snap and Flatpack. My research at the time brought me to AppImages.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt
                      • Unsolved