Skip to content

Commit

Permalink
Add missing qpainter methods (#834)
Browse files Browse the repository at this point in the history
* Add missing qpainter methods

* Remove unsafe endNativePainting/beginNativePainting + rename method
  • Loading branch information
Montel authored Feb 9, 2024
1 parent 056d93e commit bf7c760
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/cxx-qt-lib/src/gui/qpainter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ mod ffi {
#[rust_name = "draw_polyline"]
fn drawPolyline(self: Pin<&mut QPainter>, points: &QPolygon);

/// Draws the current rectangle with the current pen and brush.
#[rust_name = "draw_rect_f"]
fn drawRect(self: Pin<&mut QPainter>, rectangle: &QRectF);

/// Draws the given text with the currently defined text direction, beginning at the given position.
#[rust_name = "draw_text"]
fn drawText(self: Pin<&mut QPainter>, point: &QPoint, text: &QString);
Expand Down Expand Up @@ -212,6 +216,10 @@ mod ffi {
/// Translates the coordinate system by the given offset.
fn translate(self: Pin<&mut QPainter>, offset: &QPoint);

/// Returns true if view transformation is enabled; otherwise returns false.
#[rust_name = "view_transform_enabled"]
fn viewTransformEnabled(self: &QPainter) -> bool;

/// Returns the window rectangle.
fn window(self: &QPainter) -> QRect;
}
Expand Down

0 comments on commit bf7c760

Please sign in to comment.