Open byteit101 opened 4 years ago
QStringList
is technically unsupported, because it inherits from QList<QString>
which in turn inherits from QListSpecialMethods<QString>
, where several methods are ultimately defined:
template <typename T> struct QListSpecialMethods { };
template <> struct QListSpecialMethods<QString>;
template <typename T>
class QList : public QListSpecialMethods<T> {
// ...
};
template <> struct QListSpecialMethods<QString> {
public:
inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive);
inline int removeDuplicates();
inline QString join(const QString &sep) const;
inline QStringList filter(const QString &str, Qt::CaseSensitivity cs = Qt::CaseSensitive) const;
inline QStringList &replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
// ...
};
Bindgen doesn't consider template specializations at the moment. That said, all these methods can be reimplemented on Crystal easily, since we have Enumerable
.
If passing data to Qt is all that's needed, Bindgen master should be enough; wrapping QStringList
normally gives a default constructor and #<<
. This means you can do the following:
classes:
QStringList: StringList
# ...
Qt::Completer.new(Qt::StringList{"Option 1", "Option 2"}, parent)
This is making it much more difficult to do stuff, such as:
Qt::Completer.new(["Option 1", "Option 2"], parent)
must be replaced with a full blown model.