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

Setting property visibility to false in the property sheet does not change visibility

    XMLWordPrintable

Details

    Description

      This can be reproduced by creating a custom widget. Get the property sheet and call setVisible with false, this does not change the visibility.

      This applies to both built-in properties and custom properties.

      Example:

       

       

      QDesignerFormWindowInterface* form_window = nullptr;
      form_window = QDesignerFormWindowInterface::findFormWindow(this);
      if (!form_window)
          return;
      QDesignerFormEditorInterface* form_editor = nullptr;
      form_editor = form_window->core();
      if (!form_editor)
          return;
      QExtensionManager* manager = nullptr;
      manager = form_editor->extensionManager();
      if (!manager)
          return;
      QDesignerPropertySheetExtension* sheet = nullptr;
      property_sheet = qt_extension<QDesignerPropertySheetExtension*>(manager, this);
      if (!sheet)
          return;
      qInfo() << sheet->isVisible(sheet->indexOf("objectName"));
      qInfo() << sheet->isVisible(sheet->indexOf("customProperty"));
      sheet->setVisibility(sheet->indexOf("objectName"), false);
      sheet->setVisibility(sheet->indexOf("customProperty"), false);
      qInfo() << sheet->isVisible(sheet->indexOf("objectName"));
      qInfo() << sheet->isVisible(sheet->indexOf("customProperty"));
      

       

       

      This outputs:

      true
      true
      true
      true

      The properties are also still visible.

      Attachments

        1. qtbug126993_repro.diff
          4 kB
          Friedemann Kleint
        2. 0001.diff
          2 kB
          Sebastian Rampe
        For Gerrit Dashboard: QTBUG-126993
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            bertreynolds bertreynolds
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are 2 open Gerrit changes