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

QFileDialog is missing Q_FLAGS call for the property "Options"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.6.2
    • None
    • Linux Ubuntu
    • cb3f3858555bb5b385ee42bb51c4011b21779506

    Description

      Problem:
      QFileDialog::Options is not a meta-type
      Impact:
      QFileDialog::Options not being a meta-type, Qt Designer (or QtScript) can't handle the property as a type.

      As an example, I have a custom QWidget with the following body:
      class MyCustomWidget :public QWidget{
      Q_OBJECT
      Q_PROPERTY(QFileDialog::Options options READ options WRITE setOptions)
      public:
      ...
      void setOptions(const QFileDialog::Options& options);
      const QFileDialog::Options& options()const;
      };

      If the widget is inside a Designer plugin, then when the Qt Designer is started, the following message is printed:
      MetaProperty::read: Unable to handle unregistered datatype 'QFileDialog::Options' for property 'MyCustomWidget::options'

      Solution:
      Call Q_FLAGS(Option Options) inside QFileDialog.h in addition to the already existing Q_DECLARE_FLAGS(Options, Option) and Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options)

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            finetjul Julien Finet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes