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

REG->Qt 6/dc4e5af752810d4f02b0485ecef2f1247b22beaa : QMetaProperty::write() no longer accepts int for flag types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 6.0.0
    • Core: Object Model
    • None
    • All
    • 26a0a8942135fed725ec3067ba05bae31bb4e645 (qt/qtbase/dev)

    Description

       int v = QDialogButtonBox::Ok | QDialogButtonBox::Cancel;
        QDialogButtonBox bb(QDialogButtonBox::Close);
          int index = bb.metaObject()->indexOfProperty("standardButtons");
          auto prop =  bb.metaObject()->property(index);
          bool ok = prop.write(&bb, QVariant(v));
      

      produces

      Qt 6.0.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 8.3.0)
      standardButtons isEnumType= true isFlagType true
      QMetaType(1046, "QFlags<QDialogButtonBox::StandardButton>", size=4, r
        egistered, flags=0x4/QFlags(0x4), data=0xe03bf58c6d7f0000)
      
      standardButtons QFlags<QDialogButtonBox::StandardButton>(Close)
      prop.write(int) false standardButtons= QFlags<QDialogButtonBox::StandardButton>(Close)
      

      vs

      Qt 5.15.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
      standardButtons isEnumType= true isFlagType true
      prop.write(int) true standardButtons= QFlags<QDialogButtonBox::StandardButton>(Ok|Cancel)
      

      This manifests as Qt Designer not showing QDialogButtonBoxes since the buttons are 0.

      Note: It still works with enums (qtbug83689_enum.zip) ; at least this is inconsistent:

      Qt 6.0.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 8.3.0)
      orientation isEnumType= true isFlagType false
      prop.write(int) true orientation= Qt::Vertical
      

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            kleint Friedemann Kleint
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes