JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
JKQTPEnhancedPainter Class Reference

this class extends the QPainter More...

#include <jkqtpenhancedpainter.h>

Inheritance diagram for JKQTPEnhancedPainter:
[legend]
Collaboration diagram for JKQTPEnhancedPainter:
[legend]

Public Types

enum  PainterFlag {
  DefaultPaintMode = 0x00 ,
  VectorPainting = 0x01
}
 flags that are used to configure a JKQTPEnhancedPainter More...
 
typedef QFlags< PainterFlagPainterFlags
 specifies the plot styles for the error information, e.g. error bars, boxes, lines ...
 

Public Member Functions

 JKQTPEnhancedPainter ()
 
 JKQTPEnhancedPainter (QPaintDevice *device)
 
void drawComplexRoundedRect (const QRectF &r, double rTopLeft, double rTopRight, double rBottomLeft, double rBottomRight, Qt::SizeMode mode=Qt::AbsoluteSize)
 draw a rounded rect, where each corner has a separate radius
 
void drawPolylineFast (const QPoint *points, int pointCount)
 
void drawPolylineFast (const QPointF *points, int pointCount)
 faster variant of QPainter::drawPolyline(),it turns out that drawing single lines is way faster than drawing with drawPolyLine()
 
void drawPolylineFast (const QPolygon &polyline)
 
void drawPolylineFast (const QPolygonF &polyline)
 
void drawRoundedRectOrRect (const QRectF &r, double radius, Qt::SizeMode mode=Qt::AbsoluteSize)
 draw a rounded rect (radius >0 ), or a simple rect (radius <=0 )
 
PainterFlags painterFlags () const
 flags, specifying how the JKQTPEnhancedPainter works
 
void setPainterFlag (PainterFlag flag, bool enabled=true)
 flags, specifying how the JKQTPEnhancedPainter works
 
void setPainterFlag (PainterFlags flags)
 flags, specifying how the JKQTPEnhancedPainter works
 

Protected Member Functions

void initQEnhacedPainter ()
 

Private Attributes

PainterFlags m_flags
 flags, specifying how the JKQTPEnhancedPainter works
 

Detailed Description

this class extends the QPainter

Member Enumeration Documentation

◆ PainterFlag

flags that are used to configure a JKQTPEnhancedPainter

Enumerator
DefaultPaintMode 

the default mode, the JKQTPEnhancedPainter draws on a pixel-device

VectorPainting 

if set, the JKQTPEnhancedPainter draws onto a vector-device, like a printer, PDF or SVG-output

Constructor & Destructor Documentation

◆ JKQTPEnhancedPainter() [1/2]

JKQTPEnhancedPainter::JKQTPEnhancedPainter ( QPaintDevice *  device)

◆ JKQTPEnhancedPainter() [2/2]

JKQTPEnhancedPainter::JKQTPEnhancedPainter ( )

Member Function Documentation

◆ drawComplexRoundedRect()

void JKQTPEnhancedPainter::drawComplexRoundedRect ( const QRectF &  r,
double  rTopLeft,
double  rTopRight,
double  rBottomLeft,
double  rBottomRight,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)

draw a rounded rect, where each corner has a separate radius

◆ drawPolylineFast() [1/4]

void JKQTPEnhancedPainter::drawPolylineFast ( const QPoint *  points,
int  pointCount 
)

◆ drawPolylineFast() [2/4]

void JKQTPEnhancedPainter::drawPolylineFast ( const QPointF *  points,
int  pointCount 
)

faster variant of QPainter::drawPolyline(),it turns out that drawing single lines is way faster than drawing with drawPolyLine()

At least for thin (1 Pixel) lines on non-vector-devices, this does not make much difference in appearance

◆ drawPolylineFast() [3/4]

void JKQTPEnhancedPainter::drawPolylineFast ( const QPolygon &  polyline)
inline

◆ drawPolylineFast() [4/4]

void JKQTPEnhancedPainter::drawPolylineFast ( const QPolygonF &  polyline)
inline

◆ drawRoundedRectOrRect()

void JKQTPEnhancedPainter::drawRoundedRectOrRect ( const QRectF &  r,
double  radius,
Qt::SizeMode  mode = Qt::AbsoluteSize 
)

draw a rounded rect (radius >0 ), or a simple rect (radius <=0 )

◆ initQEnhacedPainter()

void JKQTPEnhancedPainter::initQEnhacedPainter ( )
protected

◆ painterFlags()

PainterFlags JKQTPEnhancedPainter::painterFlags ( ) const

flags, specifying how the JKQTPEnhancedPainter works

See also
PainterFlags

◆ setPainterFlag() [1/2]

void JKQTPEnhancedPainter::setPainterFlag ( PainterFlag  flag,
bool  enabled = true 
)

flags, specifying how the JKQTPEnhancedPainter works

See also
PainterFlags

◆ setPainterFlag() [2/2]

void JKQTPEnhancedPainter::setPainterFlag ( PainterFlags  flags)

flags, specifying how the JKQTPEnhancedPainter works

See also
PainterFlags

Member Data Documentation

◆ m_flags

PainterFlags JKQTPEnhancedPainter::m_flags
private

flags, specifying how the JKQTPEnhancedPainter works

See also
PainterFlags

The documentation for this class was generated from the following file: