diff --git a/crates/cxx-qt-lib/src/gui/qpolygon.rs b/crates/cxx-qt-lib/src/gui/qpolygon.rs index 8a6b21d64..1e3442312 100644 --- a/crates/cxx-qt-lib/src/gui/qpolygon.rs +++ b/crates/cxx-qt-lib/src/gui/qpolygon.rs @@ -19,6 +19,8 @@ mod ffi { type QPoint = crate::QPoint; include!("cxx-qt-lib/qrect.h"); type QRect = crate::QRect; + include!("cxx-qt-lib/qstring.h"); + type QString = crate::QString; include!("cxx-qt-lib/qpolygon.h"); type QPolygon = super::QPolygon; @@ -81,6 +83,10 @@ mod ffi { #[doc(hidden)] #[rust_name = "qpolygon_eq"] fn operatorEq(a: &QPolygon, b: &QPolygon) -> bool; + + #[doc(hidden)] + #[rust_name = "qpolygon_to_qstring"] + fn toQString(value: &QPolygon) -> QString; } } @@ -131,6 +137,12 @@ impl PartialEq for QPolygon { } } +impl std::fmt::Display for QPolygon { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}", ffi::qpolygon_to_qstring(self)) + } +} + impl Eq for QPolygon {} // Safety: diff --git a/crates/cxx-qt-lib/src/gui/qpolygonf.rs b/crates/cxx-qt-lib/src/gui/qpolygonf.rs index f67a67fac..4d0b33ced 100644 --- a/crates/cxx-qt-lib/src/gui/qpolygonf.rs +++ b/crates/cxx-qt-lib/src/gui/qpolygonf.rs @@ -20,6 +20,8 @@ mod ffi { type QRectF = crate::QRectF; include!("cxx-qt-lib/qpolygon.h"); type QPolygon = crate::QPolygon; + include!("cxx-qt-lib/qstring.h"); + type QString = crate::QString; include!("cxx-qt-lib/qpolygonf.h"); type QPolygonF = super::QPolygonF; @@ -79,6 +81,10 @@ mod ffi { #[doc(hidden)] #[rust_name = "qpolygonf_eq"] fn operatorEq(a: &QPolygonF, b: &QPolygonF) -> bool; + + #[doc(hidden)] + #[rust_name = "qpolygonf_to_qstring"] + fn toQString(value: &QPolygonF) -> QString; } } @@ -120,6 +126,12 @@ impl PartialEq for QPolygonF { } } +impl std::fmt::Display for QPolygonF { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(f, "{}", ffi::qpolygonf_to_qstring(self)) + } +} + impl Eq for QPolygonF {} // Safety: