<qdrawutil.h> - Drawing Utility Functions

Header: #include <qdrawutil.h>

기능

void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap)
void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules = QTileRules())
void qDrawPlainRect(QPainter *painter, int x, int y, int width, int height, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)
void qDrawPlainRect(QPainter *painter, const QRect &rect, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)
(since 6.7) void qDrawPlainRoundedRect(QPainter *painter, int x, int y, int width, int height, qreal rx, qreal ry, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)
(since 6.7) void qDrawPlainRoundedRect(QPainter *painter, const QRect &rect, qreal rx, qreal ry, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)
void qDrawShadeLine(QPainter *painter, int x1, int y1, int x2, int y2, const QPalette &palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0)
void qDrawShadeLine(QPainter *painter, const QPoint &p1, const QPoint &p2, const QPalette &palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0)
void qDrawShadePanel(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, int lineWidth = 1, const QBrush *fill = nullptr)
void qDrawShadePanel(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, int lineWidth = 1, const QBrush *fill = nullptr)
void qDrawShadeRect(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush *fill = nullptr)
void qDrawShadeRect(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush *fill = nullptr)
void qDrawWinButton(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)
void qDrawWinButton(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)
void qDrawWinPanel(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)
void qDrawWinPanel(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)

상세 설명

QPainter도 참조하십시오 .

함수 문서

void qDrawBorderPixmap(QPainter *painter, const QRect &target, const QMargins &margins, const QPixmap &pixmap)

qDrawBorderPixmap 함수는 직사각형의 여백에 픽스맵을 그리는 데 사용됩니다.

지정된 pixmap 을, 지정된 painter 을 사용하여 지정된 target 사각형 내에 그립니다. 픽스맵은 9개의 세그먼트로 분할되며, margins 구조에 따라 그려집니다.

void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules = QTileRules())

지정된 sourceRect 사각형을, 주어진 pixmap 에서 가져와 주어진 targetRect 사각형에, 주어진 painter 을 사용하여 그립니다. 픽스맵은 주어진 targetMargins 및 sourceMargins 구조에 따라 9개의 세그먼트로 분할됩니다. 마지막으로, 픽스맵은 주어진 rules 에 따라 그려집니다.

이 함수는 CSS3의 border-images와 유사하게, 크기가 조정된 픽스맵을 그리는 데 사용됩니다.

Qt::TileRule, QTileRules 및 QMargins도 참조하십시오 .

void qDrawPlainRect(QPainter *painter, int x, int y, int width, int height, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)

(x, y)을 기점으로 하여, 주어진 width 및 height 를 사용하고, 지정된 painter, lineColor 및 lineWidth 를 적용하여 일반 사각형을 그립니다. fill 가 nullptr 가 아닌 경우, 사각형 내부는 fill 브러시로 채워집니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 단순한 사각형을 표시할 수도 있습니다:

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

qDrawShadeRect() 및 QStyle도 참조하십시오 .

void qDrawPlainRect(QPainter *painter, const QRect &rect, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)

rect 로 지정된 일반 사각형을, 주어진 painter, lineColor 및 lineWidth 를 사용하여 그립니다. fill 가 nullptr 가 아닌 경우, 사각형 내부는 fill 브러시로 채워집니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 의 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 단순한 사각형을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

qDrawShadeRect() 및 QStyle도 참조하십시오 .

[since 6.7] void qDrawPlainRoundedRect(QPainter *painter, int x, int y, int width, int height, qreal rx, qreal ry, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)

(x, y) 지점을 시작점으로 하여, 지정된 width 및 height 값을 사용하며, 수평 반경 rx 및 수직 반경 ry, 지정된 painter, lineColor 및 lineWidth 값을 사용하여 평범한 둥근 사각형을 그립니다. fill 가 nullptr 가 아닌 경우, 사각형 내부는 fill 브러시로 채워집니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 단순한 사각형을 표시할 수도 있습니다:

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

이 함수는 Qt 6.7에서 도입되었습니다.

qDrawShadeRect() 및 QStyle도 참조하십시오 .

[since 6.7] void qDrawPlainRoundedRect(QPainter *painter, const QRect &rect, qreal rx, qreal ry, const QColor &lineColor, int lineWidth = 1, const QBrush *fill = nullptr)

rect 로 지정된 일반 사각형을, 수평 반경 rx 과 수직 반경 ry, 주어진 painter, lineColor 및 lineWidth 을 사용하여 그립니다. fill 가 nullptr 가 아닌 경우, 사각형 내부는 fill 브러시로 채워집니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 의 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 단순한 사각형을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

이 함수는 Qt 6.7에서 도입되었습니다.

qDrawShadeRect() 및 QStyle도 참조하십시오 .

void qDrawShadeLine(QPainter *painter, int x1, int y1, int x2, int y2, const QPalette &palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0)

주어진 painter 를 사용하여 수평(y1 == y2) 또는 수직(x1 == x2) 음영 선을 그립니다. y1!= y2 이고 x1!= x2 인 경우(즉, 선이 수평도 수직도 아닌 경우)에는 아무것도 그려지지 않는다는 점에 유의하십시오.

제공된 palette 는 음영 색상(light, dark 및 middle 색상)을 지정합니다. 지정된 lineWidth 는 각 선의 선폭을 나타내며, 전체 선폭을 의미하지는 않습니다. 지정된 midLineWidth 는 QPalette::mid() 색상으로 그려지는 중간 선의 너비를 지정합니다.

sunken 가 true인 경우 선은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 선을 표시할 수도 있습니다:

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

qDrawShadeRect(), qDrawShadePanel() 및 QStyle도 참조하십시오 .

void qDrawShadeLine(QPainter *painter, const QPoint &p1, const QPoint &p2, const QPalette &palette, bool sunken = true, int lineWidth = 1, int midLineWidth = 0)

지정된 painter 를 사용하여 p1 와 p2 사이에 수평 또는 수직의 음영 선을 그립니다. 두 점 사이의 선이 수평도 수직도 아닌 경우에는 아무것도 그려지지 않는다는 점에 유의하십시오.

제공된 palette 는 음영 색상(light, dark 및 middle 색상)을 지정합니다. 주어진 lineWidth 는 각 선의 선폭을 지정하며, 전체 선폭을 의미하지는 않습니다. 주어진 midLineWidth 는 QPalette::mid() 색상으로 그려지는 가운데 선의 폭을 지정합니다.

sunken 가 true인 경우 선은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 선을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

qDrawShadeRect(), qDrawShadePanel(), QStyle도 참조하십시오 .

void qDrawShadePanel(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, int lineWidth = 1, const QBrush *fill = nullptr)

(x, y) 지점에서 시작하여, 제공된 width 및 height 을 사용하여, 제공된 painter 와 지정된 lineWidth 을 적용해 음영 처리된 패널을 그립니다.

주어진 palette 은 음영 색상(light, dark 및 middle 색상)을 지정합니다. fill 가 nullptr 가 아닌 경우, 패널 내부는 fill 브러시로 채워집니다.

sunken 가 true인 경우 패널은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 패널을 표시할 수도 있습니다:

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

qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), QStyle도 참조하십시오 .

void qDrawShadePanel(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, int lineWidth = 1, const QBrush *fill = nullptr)

rect 로 지정된 직사각형 영역에, 주어진 painter 와 lineWidth 를 사용하여 음영 처리된 패널을 그립니다.

지정된 ` palette `는 음영 색상(`light`, ` dark `, ` middle ` 색상)을 지정합니다. ` fill `가 ` nullptr`가 아닌 경우, 패널 내부는 ` fill ` 브러시로 채워집니다.

sunken 가 true인 경우 패널은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 ` QFrame ` 위젯을 사용하고 ` QFrame::setFrameStyle()` 함수를 적용하여 음영 처리된 패널을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), QStyle도 참조하십시오 .

void qDrawShadeRect(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush *fill = nullptr)

제공된 painter 를 사용하여 (x, y)에서 시작하는 음영 처리된 사각형을, 지정된 width 및 height 를 적용하여 그립니다.

제공된 palette 는 음영 색상(light, dark 및 middle )을 지정합니다. 주어진 lineWidth 는 각 선의 선폭을 지정하며, 이는 전체 선폭이 아닙니다. midLineWidth 는 QPalette::mid() 색상으로 그려지는 중간 선의 너비를 지정합니다. fill 가 nullptr 가 아닌 경우, 직사각형 내부는 fill 브러시로 채워집니다.

sunken 가 true인 경우 사각형은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 사각형을 표시할 수도 있습니다:

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

qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), QStyle도 참조하십시오 .

void qDrawShadeRect(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, int lineWidth = 1, int midLineWidth = 0, const QBrush *fill = nullptr)

rect 로 지정된 음영 처리된 사각형을, 주어진 painter 를 사용하여 그립니다.

지정된 ` palette `는 음영 색상(`light`, ` dark ` 및 ` middle ` 색상)을 지정합니다. 주어진 ` lineWidth `는 각 선의 선 너비를 지정하며, 이는 전체 선 너비가 아닙니다. ` midLineWidth `는 ` QPalette::mid()` 색상으로 그려지는 중간 선의 너비를 지정합니다. ` fill `가 ` nullptr`가 아닌 경우, 사각형 내부는 ` fill ` 브러시로 채워집니다.

sunken 가 true인 경우 사각형은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 참조하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 사각형을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), QStyle도 참조하십시오 .

void qDrawWinButton(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)

주어진 점(x, y}, width 및 height )으로 지정된 Windows 스타일 버튼을, 제공된 painter 을 사용하여 선 너비 2픽셀로 그립니다. fill 가 nullptr 가 아닌 경우, 버튼 내부는 fill 브러시로 채워집니다.

지정된 palette 는 음영 색상(light, dark 및 middle 색상)을 지정합니다.

sunken 가 true인 경우 버튼은 오목하게 표시되고, 그렇지 않은 경우 돌출되어 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 의 그리기 함수를 사용하십시오.

qDrawWinPanel() 및 QStyle도 참조하십시오 .

void qDrawWinButton(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)

rect 로 지정된 사각형 영역에, 주어진 painter 를 사용하여 선 너비 2 픽셀의 Windows 스타일 버튼을 그립니다. fill 가 nullptr 이 아닌 경우, 버튼 내부는 fill 브러시로 채워집니다.

지정된 palette 는 음영 색상(light, dark 및 middle 색상)을 지정합니다.

sunken 가 true인 경우 버튼은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 의 그리기 함수를 사용하십시오.

이 함수는 오버로드된 함수입니다.

qDrawWinPanel() 및 QStyle도 참조하십시오 .

void qDrawWinPanel(QPainter *painter, int x, int y, int width, int height, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)

주어진 점(x, y), width 및 height 으로 지정된 Windows 스타일 패널을, 제공된 painter 을 사용하여 선 너비 2 픽셀로 그립니다. fill 이 nullptr 가 아닌 경우, 버튼 내부는 fill 브러시로 채워집니다.

지정된 palette 는 음영 색상을 지정합니다. sunken 가 true인 경우 패널은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 패널을 표시할 수도 있습니다:

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

qDrawShadePanel(), qDrawWinButton() 및 QStyle도 참조하십시오 .

void qDrawWinPanel(QPainter *painter, const QRect &rect, const QPalette &palette, bool sunken = false, const QBrush *fill = nullptr)

rect 로 지정된 사각형 영역에, 주어진 painter 를 사용하여 선 두께 2픽셀의 Windows 스타일 패널을 그립니다. fill 가 nullptr 가 아닌 경우, 버튼 내부는 fill 브러시로 채워집니다.

지정된 palette 는 음영 색상을 지정합니다. sunken 가 true인 경우 패널은 오목하게 표시되고, 그렇지 않은 경우 볼록하게 표시됩니다.

경고: 이 함수는 QWidget::style()이나 QApplication::style()을 고려하지 않습니다. 현재 GUI 스타일을 따르는 위젯을 만들려면 QStyle 에 있는 그리기 함수를 사용하십시오.

또는 QFrame 위젯을 사용하고 QFrame::setFrameStyle() 함수를 적용하여 음영 처리된 패널을 표시할 수도 있습니다:

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

이 함수는 오버로드된 함수입니다.

qDrawShadePanel(), qDrawWinButton() 및 QStyle도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.