Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120687

6.7/API review: QIcon theme API clashes with <windows.h>

    XMLWordPrintable

Details

    • Windows
    • b13c610f5 (dev), 1f3f99f67 (6.7)

    Description

      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
          qDebug() << qVersion() << QIcon::ThemeIcon::DocumentProperties;
          return 0;
      }
      

      does not compile on WIndows:

      ..\icontest\main.cpp(5): error C2039: 'DocumentPropertiesW': is not a member 
             of 'QIcon::ThemeIcon'
      C:\dev\qt-67\install-qt-67\include\QtGui/qicon.h(25): note: see declaration of 'QIcon::ThemeIcon'
      

      Reason being that <QtGui> pulls in <windows.h> via OpenGL / wgl.h (qopengl.h:13) and there is a (printer) Win32 API function DocumentProperties() which has a corresponding UNICODE define
      "#define DocumentProperties DocumentPropertiesW" which then triggers.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vhilshei Volker Hilsheimer
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes