Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qdrawutil.cpp File Reference

(df24438e6a2adb344d78628e7a79432f88fab5e9)

#include "qdrawutil.h"
#include "qbitmap.h"
#include "qpixmapcache.h"
#include "qpainter.h"
#include "qpalette.h"
#include <private/qpaintengineex_p.h>
#include <qvarlengtharray.h>
#include <qmath.h>
#include <private/qhexstring_p.h>
+ Include dependency graph for qdrawutil.cpp:

Go to the source code of this file.

Classes

class  QT_BEGIN_NAMESPACE::PainterStateGuard
 

Namespaces

namespace  QT_BEGIN_NAMESPACE
 Combined button and popup list for selecting options.
 

Typedefs

typedef QVarLengthArray< QPainter::PixmapFragment, 16 > QPixmapFragmentsArray
 

Functions

void qDrawShadeLine (QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
 
void qDrawShadeRect (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
 
void qDrawShadePanel (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
 
static void qDrawWinShades (QPainter *p, int x, int y, int w, int h, const QColor &c1, const QColor &c2, const QColor &c3, const QColor &c4, const QBrush *fill)
 
void qDrawWinButton (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
 
void qDrawWinPanel (QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, const QBrush *fill)
 
void qDrawPlainRect (QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
 
void qDrawPlainRoundedRect (QPainter *p, int x, int y, int w, int h, qreal rx, qreal ry, const QColor &c, int lineWidth, const QBrush *fill)
 
void qDrawShadeLine (QPainter *p, const QPoint &p1, const QPoint &p2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
 
void qDrawShadeRect (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
 
void qDrawShadePanel (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
 
void qDrawWinButton (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill)
 
void qDrawWinPanel (QPainter *p, const QRect &r, const QPalette &pal, bool sunken, const QBrush *fill)
 
void qDrawPlainRect (QPainter *p, const QRect &r, const QColor &c, int lineWidth, const QBrush *fill)
 

Typedef Documentation

◆ QPixmapFragmentsArray

Function Documentation

◆ qDrawPlainRect() [1/2]

void qDrawPlainRect ( QPainter * p,
const QRect & r,
const QColor & c,
int lineWidth,
const QBrush * fill )

Definition at line 881 of file qdrawutil.cpp.

References fill(), and qDrawPlainRect().

+ Here is the call graph for this function:

◆ qDrawPlainRect() [2/2]

void qDrawPlainRect ( QPainter * p,
int x,
int y,
int w,
int h,
const QColor & c,
int lineWidth,
const QBrush * fill )

Definition at line 574 of file qdrawutil.cpp.

References fill(), i, Qt::NoBrush, Qt::NoPen, Q_UNLIKELY, qFuzzyCompare(), qRound(), and qWarning.

Referenced by QAndroidStyle::AndroidControl::drawControl(), QCommonStyle::drawControl(), QCommonStyle::drawPrimitive(), and qDrawPlainRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawPlainRoundedRect()

void qDrawPlainRoundedRect ( QPainter * p,
int x,
int y,
int w,
int h,
qreal rx,
qreal ry,
const QColor & c,
int lineWidth,
const QBrush * fill )

Definition at line 640 of file qdrawutil.cpp.

References fill(), i, Qt::NoBrush, Qt::NoPen, Q_UNLIKELY, qFuzzyCompare(), qRound(), qWarning, rect, rx(), and ry().

Referenced by QWindows11Style::drawControl(), and qDrawPlainRoundedRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawShadeLine() [1/2]

void qDrawShadeLine ( QPainter * p,
const QPoint & p1,
const QPoint & p2,
const QPalette & pal,
bool sunken,
int lineWidth,
int midLineWidth )

Definition at line 716 of file qdrawutil.cpp.

References p1, p2, and qDrawShadeLine().

+ Here is the call graph for this function:

◆ qDrawShadeLine() [2/2]

void qDrawShadeLine ( QPainter * p,
int x1,
int y1,
int x2,
int y2,
const QPalette & pal,
bool sunken,
int lineWidth,
int midLineWidth )

Definition at line 86 of file qdrawutil.cpp.

References QBrush::color(), QPalette::color(), QPalette::Dark, QPalette::dark(), i, QPalette::light(), QPalette::mid(), Q_UNLIKELY, qFuzzyCompare(), qRound(), qWarning, and QPolygon::setPoints().

Referenced by QCommonStyle::drawControl(), QAndroidStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), and qDrawShadeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawShadePanel() [1/2]

void qDrawShadePanel ( QPainter * p,
const QRect & r,
const QPalette & pal,
bool sunken,
int lineWidth,
const QBrush * fill )

Definition at line 792 of file qdrawutil.cpp.

References fill(), and qDrawShadePanel().

+ Here is the call graph for this function:

◆ qDrawShadePanel() [2/2]

void qDrawShadePanel ( QPainter * p,
int x,
int y,
int w,
int h,
const QPalette & pal,
bool sunken,
int lineWidth,
const QBrush * fill )

Definition at line 329 of file qdrawutil.cpp.

References QBrush::color(), QPalette::dark(), fill(), i, QPalette::light(), QPalette::midlight(), Q_UNLIKELY, qFuzzyCompare(), qRound(), qWarning, and QPalette::shadow().

Referenced by QAndroidStyle::AndroidControl::drawControl(), QCommonStyle::drawControl(), QWindows11Style::drawControl(), QCommonStyle::drawPrimitive(), QtPrivate::QColorLuminancePicker::paintEvent(), and qDrawShadePanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawShadeRect() [1/2]

void qDrawShadeRect ( QPainter * p,
const QRect & r,
const QPalette & pal,
bool sunken,
int lineWidth,
int midLineWidth,
const QBrush * fill )

Definition at line 755 of file qdrawutil.cpp.

References fill(), and qDrawShadeRect().

+ Here is the call graph for this function:

◆ qDrawShadeRect() [2/2]

void qDrawShadeRect ( QPainter * p,
int x,
int y,
int w,
int h,
const QPalette & pal,
bool sunken,
int lineWidth,
int midLineWidth,
const QBrush * fill )

Definition at line 213 of file qdrawutil.cpp.

References QBrush::color(), QPalette::dark(), fill(), i, j, QPalette::light(), QPalette::mid(), Qt::NoPen, Q_UNLIKELY, qFuzzyCompare(), qRound(), and qWarning.

Referenced by QCommonStyle::drawControl(), QWindows11Style::drawControl(), QAndroidStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), and qDrawShadeRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawWinButton() [1/2]

void qDrawWinButton ( QPainter * p,
const QRect & r,
const QPalette & pal,
bool sunken,
const QBrush * fill )

Definition at line 823 of file qdrawutil.cpp.

References fill(), and qDrawWinButton().

+ Here is the call graph for this function:

◆ qDrawWinButton() [2/2]

void qDrawWinButton ( QPainter * p,
int x,
int y,
int w,
int h,
const QPalette & pal,
bool sunken,
const QBrush * fill )

Definition at line 498 of file qdrawutil.cpp.

References QPalette::button(), QBrush::color(), QPalette::dark(), fill(), QPalette::light(), qDrawWinShades(), and QPalette::shadow().

Referenced by QWindowsVistaStyle::drawPrimitive(), and qDrawWinButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawWinPanel() [1/2]

void qDrawWinPanel ( QPainter * p,
const QRect & r,
const QPalette & pal,
bool sunken,
const QBrush * fill )

Definition at line 854 of file qdrawutil.cpp.

References fill(), and qDrawWinPanel().

+ Here is the call graph for this function:

◆ qDrawWinPanel() [2/2]

void qDrawWinPanel ( QPainter * p,
int x,
int y,
int w,
int h,
const QPalette & pal,
bool sunken,
const QBrush * fill )

Definition at line 538 of file qdrawutil.cpp.

References QBrush::color(), QPalette::dark(), fill(), QPalette::light(), QPalette::midlight(), qDrawWinShades(), and QPalette::shadow().

Referenced by QCommonStyle::drawComplexControl(), QCommonStyle::drawControl(), QCommonStyle::drawPrimitive(), and qDrawWinPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qDrawWinShades()

static void qDrawWinShades ( QPainter * p,
int x,
int y,
int w,
int h,
const QColor & c1,
const QColor & c2,
const QColor & c3,
const QColor & c4,
const QBrush * fill )
static

This function draws a rectangle with two pixel line width. It is called from qDrawWinButton() and qDrawWinPanel().

c1..c4 and fill are used:

1 1 1 1 1 2 1 3 3 3 4 2 1 3 F F 4 2 1 3 F F 4 2 1 4 4 4 4 2 2 2 2 2 2 2

Definition at line 426 of file qdrawutil.cpp.

References c2, d, fill(), qFuzzyCompare(), and qRound().

Referenced by qDrawWinButton(), and qDrawWinPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: