Skip to content

Commit 81e9ad1

Browse files
tronicalogoffart
authored andcommitted
Added Qt::PenCapStyle and QPen::set_cap_style
1 parent ac6b620 commit 81e9ad1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

qttypes/src/lib.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,18 @@ impl From<QImage> for QPixmap {
11241124
}
11251125
}
11261126

1127+
/// Bindings for [`Qt::PenCapStyle`][enum] enum.
1128+
///
1129+
/// [enum]: https://doc.qt.io/qt-5/qt.html#PenCapStyle-enum
1130+
#[repr(C)]
1131+
#[derive(Clone, Copy, PartialEq, Debug)]
1132+
#[allow(non_camel_case_types)]
1133+
pub enum PenCapStyle {
1134+
FlatCap = 0x00,
1135+
SquareCap = 0x10,
1136+
RoundCap = 0x20,
1137+
}
1138+
11271139
/// Bindings for [`Qt::PenStyle`][enum] enum.
11281140
///
11291141
/// [enum]: https://doc.qt.io/qt-5/qt.html#PenStyle-enum
@@ -1166,6 +1178,9 @@ impl QPen {
11661178
pub fn set_width_f(&mut self, width: qreal) {
11671179
cpp!(unsafe [self as "QPen*", width as "qreal"] { return self->setWidthF(width); });
11681180
}
1181+
pub fn set_cap_style(&mut self, style: PenCapStyle) {
1182+
cpp!(unsafe [self as "QPen*", style as "Qt::PenCapStyle"] { return self->setCapStyle(style); });
1183+
}
11691184

11701185
// QBrush brush() const
11711186
// Qt::PenCapStyle capStyle() const
@@ -1177,7 +1192,6 @@ impl QPen {
11771192
// Qt::PenJoinStyle joinStyle() const
11781193
// qreal miterLimit() const
11791194
// void setBrush(const QBrush &brush)
1180-
// void setCapStyle(Qt::PenCapStyle style)
11811195
// void setCosmetic(bool cosmetic)
11821196
// void setDashOffset(qreal offset)
11831197
// void setDashPattern(const QVector<qreal> &pattern)

0 commit comments

Comments
 (0)