Skip to content

Commit 34f381b

Browse files
authored
Add missing QFont methods (#817)
1 parent 3fd68b2 commit 34f381b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

crates/cxx-qt-lib/src/gui/qfont.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ mod ffi {
116116
#[rust_name = "letter_spacing_type"]
117117
fn letterSpacingType(self: &QFont) -> QFontSpacingType;
118118

119+
/// Returns true if overline has been set; otherwise returns false.
120+
fn overline(self: &QFont) -> bool;
121+
119122
/// Returns the pixel size of the font if it was set with setPixelSize(). Returns -1 if the size was set with setPointSize() or setPointSizeF().
120123
#[rust_name = "pixel_size"]
121124
fn pixelSize(self: &QFont) -> i32;
@@ -159,6 +162,18 @@ mod ffi {
159162
#[rust_name = "set_letter_spacing"]
160163
fn setLetterSpacing(self: &mut QFont, spacingType: QFontSpacingType, spacing: f64);
161164

165+
/// If enable is true, sets overline on; otherwise sets overline off.
166+
#[rust_name = "set_overline"]
167+
fn setOverline(self: &mut QFont, enable: bool);
168+
169+
/// Sets the font size to pixelSize pixels.
170+
#[rust_name = "set_pixel_size"]
171+
fn setPixelSize(self: &mut QFont, pixelSize: i32);
172+
173+
/// Sets the stretch factor for the font.
174+
#[rust_name = "set_stretch"]
175+
fn setStretch(self: &mut QFont, factor: i32);
176+
162177
/// If enable is true, sets strikeout on; otherwise sets strikeout off.
163178
#[rust_name = "set_strikeout"]
164179
fn setStrikeOut(self: &mut QFont, enable: bool);
@@ -178,6 +193,14 @@ mod ffi {
178193
#[rust_name = "set_underline"]
179194
fn setUnderline(self: &mut QFont, enable: bool);
180195

196+
/// Returns the stretch factor for the font.
197+
fn stretch(self: &QFont) -> i32;
198+
199+
/// Returns the requested font style name. This can be used to match the font
200+
/// with irregular styles (that can't be normalized in other style properties).
201+
#[rust_name = "style_name"]
202+
fn styleName(self: &QFont) -> QString;
203+
181204
/// Returns true if underline has been set; otherwise returns false.
182205
fn underline(self: &QFont) -> bool;
183206
}

0 commit comments

Comments
 (0)