QML causes switching to discrete graphics

Using Qt 5.1 on OSX Mountain Lion, I notice that my application forces the computer to switch from integrated energy-efficient graphics to a more powerful discrete card.

Is there any way to prevent this?

+4
source share
1 answer

Since Qt 5.3 can be used with a special key in Info.plist for your Qt application.

1) In order to use a custom Info.plist , set the QMAKE_INFO_PLIST variable in the * .pro file.

# qmake will copy this file to MyApp.app/Contents/Info.plist QMAKE_INFO_PLIST = MyInfo.plist 

By default, qmake generates a generic Info.plist file, so you can use it as a template. Here you can also see here .

2) Then add the following key to the "dict" section of your Info.plist:

 <dict> ... other keys here ... <key>NSSupportsAutomaticGraphicsSwitching</key> <true/> </dict> 

This key should work, since Qt 5.3 (see commit it ).

3) Make sure Qt will put your custom Info.plist file in MyApp.app/Contents/Info.plist.

For some reason, Qt Creator will not update Info.plist in the * .app file if it already exists. Thus, after changing Info.plist, delete the * .app file from the assembly directory and rebuild the project to apply the changes.

+2
source

Source: https://habr.com/ru/post/1493778/


All Articles