woboq/qmetaobject-rs

Guidelines about when to use Option with Qt return types

Ayush1325 opened this issue · 0 comments

I was writing a wrapper for a few functions in QStandardPaths which I need and a question popped up in my mind. Many Qt functions return a null QString (not to be confused with empty QString) when the value cannot be found. In such cases, should the bindings return Option<QString> instead of QString?

Similarly, most Qt functions will return empty QList when nothing is found. So I would like to hear everyone's opinions about using Option in the return type of such functions.