QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表
QwtDialNeedle类 参考abstract

Base class for needles that can be used in a QwtDial 更多...

#include <qwt_dial_needle.h>

类 QwtDialNeedle 继承关系图:
QwtCompassMagnetNeedle QwtCompassWindArrow QwtDialSimpleNeedle

Public 成员函数

 QwtDialNeedle ()
 Constructor
 
virtual ~QwtDialNeedle ()
 Destructor
 
virtual void setPalette (const QPalette &)
 Set the palette for the needle
 
const QPalette & palette () const
 Return the palette of the needle
 
void setFlatStyle (bool)
 Set flat style
 
bool flatStyle () const
 Return flat style
 
virtual void draw (QPainter *, const QPointF &center, double length, double direction, QPalette::ColorGroup=QPalette::Active) const
 Draw the needle
 

Protected 成员函数

virtual void drawNeedle (QPainter *painter, double length, QPalette::ColorGroup colorGroup) const =0
 Draw the needle
 
virtual void drawKnob (QPainter *, double width, const QBrush &, bool sunken) const
 Draw the knob
 

Protected 属性

QPalette m_palette
 
bool m_flatStyle
 

详细描述

Base class for needles that can be used in a QwtDial

QwtDialNeedle is a pointer that indicates a value by pointing to a specific direction.

参见
QwtDial, QwtCompass

成员函数说明

◆ draw()

void QwtDialNeedle::draw ( QPainter *  painter,
const QPointF &  center,
double  length,
double  direction,
QPalette::ColorGroup  colorGroup = QPalette::Active 
) const
virtual

Draw the needle

参数
[in]painterPainter
[in]centerCenter of the dial, start position for the needle
[in]lengthLength of the needle
[in]directionDirection of the needle, in degrees counter clockwise
[in]colorGroupColor group, used for painting

◆ drawNeedle()

virtual void QwtDialNeedle::drawNeedle ( QPainter *  painter,
double  length,
QPalette::ColorGroup  colorGroup 
) const
protectedpure virtual

Draw the needle

The origin of the needle is at position (0.0, 0.0 ) pointing in direction 0.0 ( = east ).

The painter is already initialized with translation and rotation.

参数
painterPainter
lengthLength of the needle
colorGroupColor group, used for painting
参见
setPalette(), palette()

QwtDialSimpleNeedle, QwtCompassMagnetNeedle , 以及 QwtCompassWindArrow 内被实现.

◆ flatStyle()

bool QwtDialNeedle::flatStyle ( ) const

Return flat style

Return whether flat style is enabled

参见
setFlatStyle()

◆ palette()

const QPalette & QwtDialNeedle::palette ( ) const

Return the palette of the needle

返回
Palette of the needle

◆ setFlatStyle()

void QwtDialNeedle::setFlatStyle ( bool  on)

Set flat style

When enabled (default), needles and knobs are drawn with flat colors instead of 3D shaded effects (Light/Dark gradients).

参数
ontrue for flat style, false for classic 3D style
参见
flatStyle()

◆ setPalette()

void QwtDialNeedle::setPalette ( const QPalette &  palette)
virtual

Set the palette for the needle

Sets the palette for the needle

参数
[in]paletteNew Palette

该类的文档由以下文件生成: