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

Including QAxFactory causes compilation error when QT_NO_CAST_FROM_ASCII is defined

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.6.0 RC
    • 5.5.1, 5.6.0 Beta
    • ActiveX Support
    • None
    • 2af645d0678afe0fa0ea214d0557c32bfbbdf93b (qtactive/5.6, 14.1.2016,5.6)

    Description

      When defining QT_NO_CAST_FROM_ASCII for project which uses Qt, including <QAxFactory> leads to compilation error (here building Transmission with MSVS 2015):

      c:\buildslave-transmission\local-x64-msvc14\include\activeqt\qaxfactory.h(192): error C2248: 'QString::QString': cannot access private member declared in class 'QString'
      C:\buildslave-transmission\local-x64-msvc14\include\QtCore/qstring.h(771): note: see declaration of 'QString::QString'
      c:\buildslave-transmission\windows-x64\src\qt\ComInteropHelper.h(17): note: see declaration of 'QString'
      c:\buildslave-transmission\local-x64-msvc14\include\activeqt\qaxfactory.h(192): note: while compiling class template member function 'QStringList QAxClass<InteropObject>::featureList(void) const'
      C:\buildslave-transmission\windows-x64\src\qt\ComInteropHelper.cc(22): note: see reference to class template instantiation 'QAxClass<InteropObject>' being compiled
      

      The fix in qaxfactory.h seems staightforward:

      --- a/qaxfactory.h
      +++ b/qaxfactory.h
      @@ -189,7 +189,7 @@
           {}
       
           const QMetaObject *metaObject(const QString &) const { return &T::staticMetaObject; }
      -    QStringList featureList() const { return QStringList(QString(T::staticMetaObject.className())); }
      +    QStringList featureList() const { return QStringList(QLatin1String(T::staticMetaObject.className())); }
           QObject *createObject(const QString &key)
           {
               const QMetaObject &mo = T::staticMetaObject;
      

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              mike.dld Mike Gelfand
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes