[][src]Function qt_widgets::q_draw_shade_line_q_painter4_int_q_palette_bool_int

pub unsafe fn q_draw_shade_line_q_painter4_int_q_palette_bool_int(
    p: impl CastInto<Ptr<QPainter>>,
    x1: c_int,
    y1: c_int,
    x2: c_int,
    y2: c_int,
    pal: impl CastInto<Ref<QPalette>>,
    sunken: bool,
    line_width: c_int
)

Draws a horizontal (y1 == y2) or vertical (x1 == x2) shaded line using the given painter. Note that nothing is drawn if y1 != y2 and x1 != x2 (i.e. the line is neither horizontal nor vertical).

Calls C++ function: void qDrawShadeLine(QPainter* p, int x1, int y1, int x2, int y2, const QPalette& pal, bool sunken = …, int lineWidth = …).

C++ documentation:

Draws a horizontal (y1 == y2) or vertical (x1 == x2) shaded line using the given painter. Note that nothing is drawn if y1 != y2 and x1 != x2 (i.e. the line is neither horizontal nor vertical).

The provided 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 given midLineWidth specifies the width of a middle line drawn in the QPalette::mid() color.

The line 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 line:

QFrame frame: frame.setFrameStyle(QFrame::HLine | QFrame::Sunken);

See also qDrawShadeRect(), qDrawShadePanel(), and QStyle.