Skip to content

Commit

Permalink
Added Qt::PenCapStyle and QPen::set_cap_style
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical committed Jan 17, 2025
1 parent ac6b620 commit ac6ec14
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion qttypes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,18 @@ impl From<QImage> for QPixmap {
}
}

/// Bindings for [`Qt::PenCapStyle`][enum] enum.
///
/// [enum]: https://doc.qt.io/qt-5/qt.html#PenCapStyle-enum
#[repr(C)]
#[derive(Clone, Copy, PartialEq, Debug)]
#[allow(non_camel_case_types)]
pub enum PenCapStyle {
FlatCap = 0x00,
SquareCap = 0x10,
RoundCap = 0x20,
}

/// Bindings for [`Qt::PenStyle`][enum] enum.
///
/// [enum]: https://doc.qt.io/qt-5/qt.html#PenStyle-enum
Expand Down Expand Up @@ -1166,6 +1178,9 @@ impl QPen {
pub fn set_width_f(&mut self, width: qreal) {
cpp!(unsafe [self as "QPen*", width as "qreal"] { return self->setWidthF(width); });
}
pub fn set_cap_style(&mut self, style: PenCapStyle) {
cpp!(unsafe [self as "QPen*", style as "Qt::PenCapStyle"] { return self->setCapStyle(style); });
}

// QBrush brush() const
// Qt::PenCapStyle capStyle() const
Expand All @@ -1177,7 +1192,6 @@ impl QPen {
// Qt::PenJoinStyle joinStyle() const
// qreal miterLimit() const
// void setBrush(const QBrush &brush)
// void setCapStyle(Qt::PenCapStyle style)
// void setCosmetic(bool cosmetic)
// void setDashOffset(qreal offset)
// void setDashPattern(const QVector<qreal> &pattern)
Expand Down

0 comments on commit ac6ec14

Please sign in to comment.