Important: Please read the Qt Code of Conduct -

[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>
    /// ... later
    #ifdef Q_OS_WIN
    QWinTaskbarButton *taskbarButton = new QWinTaskbarButton(this);

    or can i omit those conditionals?

  • Lifetime Qt Champion


    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