[][src]Function qt_widgets::q_draw_shade_rect_q_painter4_int_q_palette_bool2_int_q_brush

pub unsafe fn q_draw_shade_rect_q_painter4_int_q_palette_bool2_int_q_brush(
    p: impl CastInto<Ptr<QPainter>>,
    x: c_int,
    y: c_int,
    w: c_int,
    h: c_int,
    pal: impl CastInto<Ref<QPalette>>,
    sunken: bool,
    line_width: c_int,
    mid_line_width: c_int,
    fill: impl CastInto<Ptr<QBrush>>
)

Draws the shaded rectangle beginning at (x, y) with the given width and height using the provided painter.

Calls C++ function: void qDrawShadeRect(QPainter* p, int x, int y, int w, int h, const QPalette& pal, bool sunken = …, int lineWidth = …, int midLineWidth = …, const QBrush* fill = …).

C++ documentation:

Draws the shaded rectangle beginning at (x, y) with the given width and height using the provided painter.

The provide palette specifies the shading colors (light, dark and middle colors. The given lineWidth specifies the line width for each of the lines; it is not the total line width. The midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color. The rectangle's interior is filled with the fill brush unless fill is 0.

The rectangle appears sunken if sunken is true, otherwise raised.

Warning: This function does not look at QWidget::style() or QApplication::style(). Use the drawing functions in QStyle to make widgets that follow the current GUI style.

Alternatively you can use a QFrame widget and apply the QFrame::setFrameStyle() function to display a shaded rectangle:

QFrame frame: frame.setFrameStyle(QFrame::Box | QFrame::Raised);

See also qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), and QStyle.