[SOLVED] How to use QtWinExtras in cross-platform application



  • Should i seperate module and header includes with conditionals like

    /// .pro file
    win32:QT += winextras
    
    /// .cpp file
    #ifdef Q_OS_WIN
    #include <QtWin>
    #endif
    /// ... later
    #ifdef Q_OS_WIN
    QWinTaskbarButton *taskbarButton = new QWinTaskbarButton(this);
    #endif
    

    or can i omit those conditionals?


  • Lifetime Qt Champion

    Hi,

    Yes you should, these are platform dependent code



  • Hi,

    if you implement all and only your Windows specific functions in one .cpp file you can also avoid to compile it with

    win32:SOURCES += myfunctions_win.cpp
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.