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

    • Type: Task
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      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

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

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes