Results 1 to 7 of 7

Thread: Qt program uses wrong video card

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2012
    Posts
    232
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Platforms
    Windows Android

    Default Re: Qt program uses wrong video card

    You can active your Geforce/Radeon video by adding this code:

    Qt Code:
    1. #ifdef _WIN32
    2. #include <windows.h>
    3. extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
    4. extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
    5. #endif
    6.  
    7. #include "widget.h"
    8.  
    9. #include <QApplication>
    10.  
    11. int main(int argc, char *argv[])
    12. {
    13. QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
    14. QApplication a(argc, argv);
    15.  
    16. Widget w;
    17. w.show();
    18.  
    19. return a.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by 8Observer8; 12th June 2020 at 10:37.

Similar Threads

  1. Replies: 0
    Last Post: 8th December 2015, 06:11
  2. sd card
    By dmartino in forum Newbie
    Replies: 6
    Last Post: 19th January 2011, 21:34
  3. Qt and graphics card
    By leoalvesmachado in forum Newbie
    Replies: 2
    Last Post: 21st May 2010, 20:57
  4. wrong connection? program crashes altough it compiles
    By cbarmpar in forum Qt Programming
    Replies: 7
    Last Post: 30th September 2008, 12:48
  5. change gamma ramp in video card
    By hvengel in forum Qt Programming
    Replies: 5
    Last Post: 10th April 2007, 00:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.