Details
-
Task
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
Windows XP/7, Linux(Ubuntu)
-
38be0d13830efd2d98281c645c3a60afe05ffece
Description
Problem:
QDir::Filters is not a meta-type
Impact:
QDir::Filters 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(QDir::Filters filters READ filters WRITE setFilters)
public:
...
void setFilters(const QDir::Filters& filters);
const QDir::Filters& filters()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 'QDir::Filters' for property 'MyCustomWidget::filters'
Solution:
Call Q_FLAGS(Filter Filters) inside qdir.h in addition to the already existing Q_DECLARE_FLAGS(Filters, Filter) and Q_DECLARE_OPERATORS_FOR_FLAGS(QDir::Filters)