Fix order of overloads for VersionInfo constructors.

This commit is contained in:
Mikaël Capelle
2020-07-14 13:21:30 +02:00
parent 0fbb88b3c1
commit a3e9916400
+4 -2
View File
@@ -177,10 +177,12 @@ BOOST_PYTHON_MODULE(mobase)
bpy::class_<VersionInfo>("VersionInfo")
.def(bpy::init<QString, VersionInfo::VersionScheme>(
(bpy::arg("value"), bpy::arg("scheme") = VersionInfo::SCHEME_DISCOVER)))
.def(bpy::init<int, int, int, VersionInfo::ReleaseType>(
(bpy::arg("major"), "minor", "subminor", bpy::arg("release_type") = VersionInfo::RELEASE_FINAL)))
// Note: Order of the two init<> below is important because ReleaseType is a simple enum with an
// implicit int conversion.
.def(bpy::init<int, int, int, int, VersionInfo::ReleaseType>(
(bpy::arg("major"), "minor", "subminor", "subsubminor", bpy::arg("release_type") = VersionInfo::RELEASE_FINAL)))
.def(bpy::init<int, int, int, VersionInfo::ReleaseType>(
(bpy::arg("major"), "minor", "subminor", bpy::arg("release_type") = VersionInfo::RELEASE_FINAL)))
.def("clear", &VersionInfo::clear)
.def("parse", &VersionInfo::parse,
(bpy::arg("value"), bpy::arg("scheme") = VersionInfo::SCHEME_DISCOVER, bpy::arg("is_manual") = false))