[][src]Function qt_widgets::q_draw_shade_rect_q_painter_q_rect_q_palette_bool_int

pub unsafe fn q_draw_shade_rect_q_painter_q_rect_q_palette_bool_int(
    p: impl CastInto<Ptr<QPainter>>,
    r: impl CastInto<Ref<QRect>>,
    pal: impl CastInto<Ref<QPalette>>,
    sunken: bool,
    line_width: c_int
)

This is an overloaded function.

Calls C++ function: void qDrawShadeRect(QPainter* p, const QRect& r, const QPalette& pal, bool sunken = …, int lineWidth = …).

C++ documentation:

This is an overloaded function.

Draws the shaded rectangle specified by rect using the given 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.