Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1670

Document how to make Qt applications use less battery on macOS

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P3: Somewhat important
    • None
    • None
    • Documentation
    • None

    Description

      I noticed that my app was using significant energy according to the battery menu thingy on macOS. I figured out that this is due to "Requires High Perf GPU" showing "Yes" in activity monitor. I looked around a bit and found QTCREATORBUG-11296​​​​​​​, with patches that fix it for Creator by setting NSSupportsAutomaticGraphicsSwitching to true in its Info.plist file. For my Qbs project, I did it like this:

          Properties {
              condition: qbs.targetOS.contains("macos")
              bundle.infoPlist: ({
                  "NSSupportsAutomaticGraphicsSwitching": "true"
              })
          }
      

      Now it's not listed as using significant energy or requiring a high performance GPU. I can't notice any difference in FPS in my app from (very) brief testing.

      This seems like a very important thing for developers to know about.

      This page could be a good place for it:

      https://doc.qt.io/qt-5/macos-issues.html

      Could also be good to link to any eventual documentation for this on https://doc.qt.io/qt-5/qtquick-performance.html.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rweickelt Richard Weickelt
            mitch_curtis Mitch Curtis
            Santtu Ahonen Santtu Ahonen
            Tor Arne Vestbø Tor Arne Vestbø
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes