// NOTE: in order to avoid ambiguities with non-explicit constructors of objects taking a QFlag as an argument,
// we compare int's explicitly. An example for such an ambiguity is QSurfaceFormat in Qt 5.5.1 which takes a QFlags<FormatOption>
// object in a non-explicit constructor.
returnint_repr(*self)==int_repr(other);
}
staticgsi::Methodsmethods()
{
return
gsi::constructor("new",&new_from_i,gsi::arg("i"),"@brief Creates a flag set from an integer value")+
gsi::constructor("new",&new_from_s,gsi::arg("s"),"@brief Creates a flag set from a string")+
gsi::constructor("new",&new_from_e1,gsi::arg("e"),"@brief Creates a flag set from an enum")+
gsi::constructor("new",&new_from_e1f,gsi::arg("e"),"@brief Creates a flag set from a QFlags set")+
gsi::constructor("new",&new_from_e2,gsi::arg("e"),"@brief Creates a flag set from an enum")+
gsi::constructor("new",&new_from_e2f,gsi::arg("e"),"@brief Creates a flag set from a QFlags set")+
gsi::method_ext("to_s",&to_s,"@brief Converts the flag set to a string")+
gsi::method_ext("to_i",&to_i,"@brief Converts the flag set to an integer")+
gsi::method_ext("testFlag1",&test_flag1,gsi::arg("flag"),"@brief Tests whether the flag set contains the given flag")+
gsi::method_ext("testFlag2",&test_flag2,gsi::arg("flag"),"@brief Tests whether the flag set contains the given flag")+
gsi::method_ext("inspect",&inspect,"@brief Converts the flag set to a visual string")+
gsi::method_ext("|",&or_op,gsi::arg("other"),"@brief Computes the union of two flag sets")+
gsi::method_ext("|",&or_op_with_e1,gsi::arg("flag"),"@brief Adds the given flag to the flag set and returns the new flag set")+
gsi::method_ext("|",&or_op_with_e2,gsi::arg("flag"),"@brief Adds the given flag to the flag set and returns the new flag set")+
gsi::method_ext("&",&and_op,gsi::arg("other"),"@brief Computes the intersection between the two flag sets")+
gsi::method_ext("&",&and_op_with_e1,gsi::arg("flag"),"@brief Tests whether the given flag is contained in the flag set and returns a null flag set if not")+
gsi::method_ext("&",&and_op_with_e2,gsi::arg("flag"),"@brief Tests whether the given flag is contained in the flag set and returns a null flag set if not")+
gsi::method_ext("^",&xor_op,gsi::arg("other"),"@brief Computes the exclusive-or between the flag set and the other flag set")+
gsi::method_ext("^",&xor_op_with_e1,gsi::arg("flag"),"@brief Inverts the given flag in the flag set and returns the new flag set")+
gsi::method_ext("^",&xor_op_with_e2,gsi::arg("flag"),"@brief Inverts the given flag in the flag set and returns the new flag set")+
gsi::method_ext("==",&equal_with_i,gsi::arg("other"),"@brief Returns true if the flag set equals the given integer value")+
gsi::method_ext("==",&equal,gsi::arg("i"),"@brief Returns true if the flag set equals the given other flag set")+
gsi::method_ext("!=",¬_equal_with_i,gsi::arg("other"),"@brief Returns true if the flag set is not equal to the given integer value")+
gsi::method_ext("!=",¬_equal,gsi::arg("i"),"@brief Returns true if the flag set is not equal to the given other flag set")+
gsi::method_ext("~",&invert,"@brief Returns the inverted flag set");
}
};
staticQUrlTwoFlagsClass<QUrl::UrlFormattingOption,QUrl::ComponentFormattingOption>decl_QUrlTwoFlags("QUrl_FormattingOptions","@brief Binding of QUrl::FormattingOptions");
// inject as QUrl::FormattingOptions
staticgsi::ClassExt<QUrl>decl_QUrlTwoFlags_as_child(decl_QUrlTwoFlags,"FormattingOptions","@brief Binding of QUrl::FormattingOptions");