LCDPaintDevice Class Reference

The LCDPaintDevice class provides a device to draw on a LCD. More...

#include <lcdpaintengine.h>

Collaboration diagram for LCDPaintDevice:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int width () const
int height () const
int widthMM () const
int heightMM () const
int logicalDpiX () const
int logicalDpiY () const
int physicalDpiX () const
int physicalDpiY () const
int numColors () const
int depth () const
QPaintEngine * paintEngine () const
void setSize (int, int)
void setController (ControllerInterface *)

Static Public Member Functions

static bool isControllerInit ()
static ControllerInterfacecontroller ()

Protected Member Functions

int metric (PaintDeviceMetric metric) const

Static Private Attributes

static ControllerInterfacem_controller = 0
static QSize m_size

Detailed Description

With this class you can use QPainter or QPainterPath native.

You don't need to learn another API is this not wonderfull, isn't it?

For example you draw a filled dotted circle with a bounding rectangle you can do it like this:

 LCDPaintDevice device;
 QPainter p;
 p.begin(&device);
   p.drawRect(QRect(0,0,100,100));
   p.setBrush(Qt::Dense7Pattern);
   p.drawEllipse(QRect(0,0,100,100));
 p.end();

If you wan't direct access to the controller you can do it with the static controller() method but check it before with isControllerInit() that the controller is valid an initialized.

See also:
LCDPaintEngine


Member Function Documentation

ControllerInterface * LCDPaintDevice::controller (  )  [static]

This method gives you a direct access to the active controller.

Note:
check with isControllerInit() if the controller is valid and initialized
Exceptions:
InternalException is thrown when no controller is available
Returns:
the active controller
See also:
isControllerInit()

int LCDPaintDevice::depth (  )  const [inline]

int LCDPaintDevice::height (  )  const [inline]

int LCDPaintDevice::heightMM (  )  const [inline]

bool LCDPaintDevice::isControllerInit (  )  [static]

Returns:
true if the controller is initialized otherwise false

int LCDPaintDevice::logicalDpiX (  )  const [inline]

int LCDPaintDevice::logicalDpiY (  )  const [inline]

int LCDPaintDevice::metric ( PaintDeviceMetric  metric  )  const [protected]

Exceptions:
UnsupportedException is thrown when you wan't a metric type that the paint device don't know
Parameters:
metric type which you want to know
Returns:
the value of the metric type

int LCDPaintDevice::numColors (  )  const [inline]

QPaintEngine * LCDPaintDevice::paintEngine (  )  const

Returns:
our custom made paint engine
See also:
LCDPaintEngine

int LCDPaintDevice::physicalDpiX (  )  const [inline]

int LCDPaintDevice::physicalDpiY (  )  const [inline]

void LCDPaintDevice::setController ( ControllerInterface controller  ) 

Set a new active controller to the device

Parameters:
controller is the new controller

void LCDPaintDevice::setSize ( int  width,
int  height 
)

Set the display size of the LCD in pixel.

Parameters:
width of the LCD
height of the LCD

int LCDPaintDevice::width (  )  const [inline]

int LCDPaintDevice::widthMM (  )  const [inline]


Member Data Documentation

ControllerInterface * LCDPaintDevice::m_controller = 0 [static, private]

Hold the active controller

QSize LCDPaintDevice::m_size [static, private]


The documentation for this class was generated from the following files:
Generated on Thu Apr 5 13:12:51 2007 for LCDBuilder by  doxygen 1.4.7