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

uic does not support non-stdcppset properties of type QICon/QPixmap (was: uic generated code of the WRITE feature of Q_PROPERTY wrong)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.6.2
    • Tools: Designer
    • None
    • Windows 7
    • 26fbba6

    Description

      I have written a plugin, with a QIcon property.

      class ZLogWidget : public QWidget {
      Q_PROPERTY(QIcon browseButtonIcon READ browseIcon WRITE setBrowseIcon);
      QIcon browseIcon() const;
      void setBrowseIcon(const QIcon&);
      }

      The plugin loads perfectly in QtDesigner and the property can be set without any problem there.

      Now, when I create a form using this widget in a project and then compiler the project, it fails with following error:
      ui_TestForm.h(306) : error C2039: 'setBrowseButtonIcon' : is not a member of 'ZLogWidget'
      D:\Sources_QT\Plugins\ZLogWidget\src\ZLogWidget.h(54) : see declaration of 'ZLogWidget'

      The moc generated code contains setBrowseButtonIcon() instead of setBrowseIcon().

      Note: I use different names for the property name, the READ feature and the WRITE feature due to a limitation of doxygen, since it is not possible to comment a property and a function that have the same name.

      Attachments

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

        Activity

          People

            jkobus Jarek Kobus
            greisby Greisberger Christophe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes