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

dumpcpp generates incorrect .h .cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.0
    • ActiveX Support
    • None
    • Win7, MinGW

    Description

      Dumpcpp shades the method signature in auto generated files if the property name and the method name are the same.

      Example of idl file:

      interface ISimpletest : IUnknown{
      
      	[helpstring("method SetMode")] HRESULT SetMode([out,retval] LONG* Value);
      	[helpstring("method Print")] HRESULT Print([in] BSTR str);
      	[propget, helpstring("property Mode")] HRESULT Mode([out, retval] LONG* pVal);
      	[propput, helpstring("property Mode")] HRESULT Mode([in] LONG newVal);
      };
      

      Example of auto generated files:

      // Actual coclasses
      class SIMPLECOMLIB_EXPORT Simpletest : public QAxObject
      {
      public:
          Simpletest(QObject *parent = 0)
          : QAxObject(parent)
          {
              setControl("{e4b7d28c-6401-471b-b24c-06e0e2e8f8e3}");
          }
      
          Simpletest(ISimpletest *iface)
          : QAxObject()
          {
              initializeFrom(iface);
              delete iface;
          }
      
          /*
          Property Mode
      
          property Mode
      
          */
          inline int Mode() const; //Returns the value of Mode
          inline void SetMode(int value); //Sets the value of the Mode property
      
          /*
          Method Print
      
          method Print
      
          */
          inline void Print(const QString& str);
      
      // meta object functions
          static const QMetaObject staticMetaObject;
          virtual const QMetaObject *metaObject() const { return &staticMetaObject; }
          virtual void *qt_metacast(const char *);
      };
      

      It may be fixed by these ways:
      1)more sophisticated check signature of methods and property
      (signature of setter is "inline void SetMode(int value);" signature of method would be "inline int SetMode();")
      2)allow to rename methods by passing command-line parameter
      3)allow to rename setter prefix by passing command-line parameter

      Attachments

        1. simplecom.idl
          1.0 kB
        2. simplecom.tlb
          2 kB
        3. simplecomlib.cpp
          3 kB
        4. simplecomlib.h
          3 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              StarPilgrim Maxim Baytel
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes