Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
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)