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

Q_PROPERTY of type enum without RESET is read only, if using a user defined editor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 4.8.4
    • None
    • Mac OS 10.7.5

    Description

      Properties P and PR show a dropdown list in the properties sheet of the designer, but only PR let the user change the value. Here are some excerpts from the toy project, which is attached.

      Q_PROPERTY(E P READ getP WRITE setP)
      Q_PROPERTY(ER PR READ getPR WRITE setPR RESET resetPR)

      Q_ENUMS for E and ER are set. The corresponding plugin registers a property sheet extension:

      QExtensionManager* manager = i_formEditor->extensionManager();
      if(!manager) {
      std::cerr << "No extension manager." << std::endl;
      return;
      }
      manager->registerExtensions(new EnumEditorFactory(manager),
      Q_TYPEID(QDesignerPropertySheetExtension));

      The constructor of the editor created by the factory temporarily unregisters:

      i_manager->unregisterExtensions(i_factory,
      Q_TYPEID(QDesignerPropertySheetExtension));
      m_defaultEditor = qt_extension<QDesignerPropertySheetExtension*>
      (i_manager, m_owner);
      i_manager->registerExtensions(i_factory,
      Q_TYPEID(QDesignerPropertySheetExtension));

      The library is moved to the designer folder of the "Qt Creator.app" and links are adopted with install_name_tool. The rest looks to me uncritical.

      Attachments

        1. QPropertyEditorReset.zip
          22 kB
          Stephan Leibbrandt
        2. qtbug31848.tar
          40 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              mmatrainer Stephan Leibbrandt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes