UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
QzqArea Class Reference

#include <qzq_area.hpp>

Inheritance diagram for QzqArea:
ZqbLongJobProcessor

Public Types

enum  DrawObjectSelection {
  DrawAll, DrawNonInteractive, DrawInteractive, DrawAll,
  DrawNonInteractive, DrawInteractive
}
 
enum  DrawObjectSelection {
  DrawAll, DrawNonInteractive, DrawInteractive, DrawAll,
  DrawNonInteractive, DrawInteractive
}
 

Signals

void toolTipDelivered (const QString &qsShort, const QString &qsLong)
 

Public Member Functions

 QzqArea (QWidget *parent=NULL, const char *name=NULL, WFlags f=0)
 
virtual ~QzqArea ()
 
ZqbPlaceholderplaceholder ()
 
const ZqbPlaceholderplaceholder () const
 
virtual void redraw (bool bForce=false, QPaintDevice *pdev=NULL, QRect *pCustomRect=NULL, bool bHardcopy=false)
 
virtual void redrawOnSetCoord (ZqbNatGroup *pNatGrp)
 
virtual bool isHardcopy () const
 
virtual ZqbEventHint input (QEvent *qev)
 
virtual bool updateGeometry (QPainter *paint=NULL, bool bForce=false, QRect *pCustomRect=NULL)
 
virtual bool tip (const QPoint &p, QString &qsShort, QString &qsLong)
 
virtual void interactiveRedraw ()
 
DrawObjectSelection getDrawObjectSelection () const
 
 QzqArea (QWidget *parent=NULL, const char *name=NULL, Qt::WFlags f=0)
 
virtual ~QzqArea ()
 
void setDrawable (const bool drawable=true)
 
ZqbPlaceholderplaceholder ()
 
const ZqbPlaceholderplaceholder () const
 
virtual void redraw (bool bForce=false, QPaintDevice *pdev=NULL)
 
virtual void redrawOnSetCoord (ZqbNatGroup *pNatGrp)
 
virtual bool isHardcopy () const
 
virtual ZqbEventHint input (QEvent *qev)
 
virtual bool updateGeometry (QPainter *paint=NULL, bool bForce=false, QRect *pCustomRect=NULL)
 
virtual bool tip (const QPoint &p, QString &qsShort, QString &qsLong)
 
virtual void interactiveRedraw ()
 
DrawObjectSelection getDrawObjectSelection () const
 
void setDrawObjectSelection (const DrawObjectSelection &mode)
 
QMainWindow * getMainWindow () const
 
void setBackgroundColor (const QColor &color)
 
const QColor & getBackgroundColor () const
 
virtual void startLongJob () const
 
virtual void finishLongJob () const
 
virtual void longJobProgerss (double progress)
 
- Public Member Functions inherited from ZqbLongJobProcessor
 ZqbLongJobProcessor ()
 
virtual ~ZqbLongJobProcessor ()
 
virtual void longJobProgerss (double progress) const
 

Protected Slots

void resizeEventTimeout ()
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *qev)
 
virtual void mouseReleaseEvent (QMouseEvent *qev)
 
virtual void mouseDoubleClickEvent (QMouseEvent *qev)
 
virtual void mouseMoveEvent (QMouseEvent *qev)
 
virtual void wheelEvent (QWheelEvent *qev)
 
virtual void keyPressEvent (QKeyEvent *qev)
 
virtual void keyReleaseEvent (QKeyEvent *qev)
 
virtual void enterEvent (QEvent *qev)
 
virtual void leaveEvent (QEvent *qev)
 
virtual void paintEvent (QPaintEvent *qev)
 
virtual void resizeEvent (QResizeEvent *qev)
 
virtual void mousePressEvent (QMouseEvent *qev)
 
virtual void mouseReleaseEvent (QMouseEvent *qev)
 
virtual void mouseDoubleClickEvent (QMouseEvent *qev)
 
virtual void mouseMoveEvent (QMouseEvent *qev)
 
virtual void wheelEvent (QWheelEvent *qev)
 
virtual void keyPressEvent (QKeyEvent *qev)
 
virtual void keyReleaseEvent (QKeyEvent *qev)
 
virtual void enterEvent (QEvent *qev)
 
virtual void leaveEvent (QEvent *qev)
 
virtual void resizeEvent (QResizeEvent *qev)
 
virtual void paintEvent (QPaintEvent *qev)
 
virtual bool event (QEvent *qev)
 

Protected Attributes

ZqbPixGroup m_pgx
 
ZqbPixGroup m_pgy
 
ZqbContainer m_Container
 
ZqObjectm_pGrabber
 
ZqbPlaceholder m_AreaPh
 
QPainter m_qPainter
 
QPixmap m_qPixBuf
 
QzqDynamicTipm_qDynTip
 
ZqbNatGrpMembers m_vObservers
 
bool m_bHardcopy
 
QPixmap m_qStaticPixBuf
 
DrawObjectSelection m_eDrawObjectSelection
 
QColor m_bg_color
 
bool m_drawable
 

Friends

class QzqAreaPainter
 

Detailed Description

Implements bridge between Qt and Zqools.

Two main features are implemented in the class:

To provide facility for connection of Zqools objects a built-in placeholder is implemented. One may use this placeholder in two ways. The first one is a direct connection of objects to the built-in placeholder which takes the whole bounding box of the area. This method is very easy and it allows to draw objects one over another on the same place.

The second way is to connect objects via intermediate layout. Layout allows to organize area as a non-uniform grid of cells. Each cell in this case represents some placeholder with attached objects. The second way is much more powerful than the first one.

Member Enumeration Documentation

Select which objects should be drawn. Such differentiation is needed for interactive redraw feature.

Enumerator
DrawAll 

Usual mode: draw all objects.

DrawNonInteractive 

Draw only non-interactive objects.

DrawInteractive 

Draw only interactive objects.

DrawAll 

Usual mode: draw all objects.

DrawNonInteractive 

Draw only non-interactive objects.

DrawInteractive 

Draw only interactive objects.

Select which objects should be drawn. Such differentiation is needed for interactive redraw feature.

Enumerator
DrawAll 

Usual mode: draw all objects.

DrawNonInteractive 

Draw only non-interactive objects.

DrawInteractive 

Draw only interactive objects.

DrawAll 

Usual mode: draw all objects.

DrawNonInteractive 

Draw only non-interactive objects.

DrawInteractive 

Draw only interactive objects.

Constructor & Destructor Documentation

QzqArea::QzqArea ( QWidget *  parent = NULL,
const char *  name = NULL,
WFlags  f = 0 
)

Create viewport for Zqools.

virtual QzqArea::~QzqArea ( )
virtual

Destroy the viwport.

QzqArea::QzqArea ( QWidget *  parent = NULL,
const char *  name = NULL,
Qt::WFlags  f = 0 
)

Create viewport for Zqools.

virtual QzqArea::~QzqArea ( )
virtual

Destroy the viwport.

Member Function Documentation

virtual void QzqArea::finishLongJob ( ) const
virtual

Finish job.

Reimplemented from ZqbLongJobProcessor.

const QColor& QzqArea::getBackgroundColor ( ) const
inline

Get current background color.

DrawObjectSelection QzqArea::getDrawObjectSelection ( ) const

Get object selection mode used for drawing.

DrawObjectSelection QzqArea::getDrawObjectSelection ( ) const

Get object selection mode used for drawing.

QMainWindow* QzqArea::getMainWindow ( ) const

Return pointer to QMainWindow if this object has a parent of this type or NULL otherwise.

virtual ZqbEventHint QzqArea::input ( QEvent *  qev)
virtual

Process the event.

virtual ZqbEventHint QzqArea::input ( QEvent *  qev)
virtual

Process the event.

virtual void QzqArea::interactiveRedraw ( )
virtual

Special kind of redraw for dynamic interactive functions when some objects are not changed and rest the same (static image) but other, so called interactive ( ZqObject::setInteractive(bool) and ZqObject::isInteractive()), are drawn dynamically. Non-interactive objects are not drawn during this call. Paint device is taken as screen one.

virtual void QzqArea::interactiveRedraw ( )
virtual

Special kind of redraw for dynamic interactive functions when some objects are not changed and rest the same (static image) but other, so called interactive ( ZqObject::setInteractive(bool) and ZqObject::isInteractive()), are drawn dynamically. Non-interactive objects are not drawn during this call. Paint device is taken as screen one.

virtual bool QzqArea::isHardcopy ( ) const
virtual

Return redraw purpose: for screen update or for hardcopy. The returned value reflects the bHardcopy flag passed in redraw(). The returned value is meaningless if called not inside redraw() processing.

virtual bool QzqArea::isHardcopy ( ) const
virtual

Return redraw purpose: for screen update or for hardcopy. The returned value reflects the bHardcopy flag passed in redraw(). The returned value is meaningless if called not inside redraw() processing.

ZqbPlaceholder* QzqArea::placeholder ( )

Return pointer to the placeholder. Used for direct ZqObject linkage.

const ZqbPlaceholder* QzqArea::placeholder ( ) const

Return constant pointer to the placeholder. Used for direct ZqObject linkage.

ZqbPlaceholder* QzqArea::placeholder ( )

Return pointer to the placeholder. Used for direct ZqObject linkage.

const ZqbPlaceholder* QzqArea::placeholder ( ) const

Return constant pointer to the placeholder. Used for direct ZqObject linkage.

virtual void QzqArea::redraw ( bool  bForce = false,
QPaintDevice *  pdev = NULL,
QRect *  pCustomRect = NULL,
bool  bHardcopy = false 
)
virtual

Redraw the area in given paint device. Paint device will be default (screen) if NULL is passed. Passing true forces redrawing even no changes were made. Custom geometry can be specified. If the method is called for hardcopy purpose (and painting device is tuned to be printer, pixmap or other special object) set hardcopy flag to true.

virtual void QzqArea::redraw ( bool  bForce = false,
QPaintDevice *  pdev = NULL 
)
virtual

Redraw the area in given paint device. Paint device will be default (screen) if NULL is passed. Passing true forces redrawing even no changes were made. Custom geometry can be specified.

virtual void QzqArea::redrawOnSetCoord ( ZqbNatGroup pNatGrp)
virtual

Register forced redraw() on change of coordinates in given natural group. This method may be used for many groups. Passed natural group object must be persistent!!!

virtual void QzqArea::redrawOnSetCoord ( ZqbNatGroup pNatGrp)
virtual

Register forced redraw() on change of coordinates in given natural group. This method may be used for many groups. Passed natural group object must be persistent!!!

void QzqArea::resizeEventTimeout ( )
protectedslot

Resize event timed out slot.

void QzqArea::setBackgroundColor ( const QColor &  color)
inline

Set background color.

void QzqArea::setDrawable ( const bool  drawable = true)
inline

Set drawable flag. If false => drawing is disabled.

void QzqArea::setDrawObjectSelection ( const DrawObjectSelection mode)

Set object selection mode used for drawing.

virtual void QzqArea::startLongJob ( ) const
virtual

Long operations processing.

Reimplemented from ZqbLongJobProcessor.

virtual bool QzqArea::tip ( const QPoint &  p,
QString &  qsShort,
QString &  qsLong 
)
virtual

Display tip at this point (short and long forms) and return true or return false if no tips are associated with this point. Processed the same manner as usual input events except for grab facility. Not inputable objects are not processed.

virtual bool QzqArea::tip ( const QPoint &  p,
QString &  qsShort,
QString &  qsLong 
)
virtual

Display tip at this point (short and long forms) and return true or return false if no tips are associated with this point. Processed the same manner as usual input events except for grab facility. Not inputable objects are not processed.

void QzqArea::toolTipDelivered ( const QString &  qsShort,
const QString &  qsLong 
)
signal

The signal emited when tooltip delivered from ZqObject inside area.

virtual bool QzqArea::updateGeometry ( QPainter *  paint = NULL,
bool  bForce = false,
QRect *  pCustomRect = NULL 
)
virtual

Update the geometry. Optional painter may be used to obtain device specific information. Return true if there were some changes in geometry. It's possible to force geometry recalculation. It's possible to set custom geometry if one is sure the painter fits it.

virtual bool QzqArea::updateGeometry ( QPainter *  paint = NULL,
bool  bForce = false,
QRect *  pCustomRect = NULL 
)
virtual

Update the geometry. Optional painter may be used to obtain device specific information. Return true if there were some changes in geometry. It's possible to force geometry recalculation. It's possible to set custom geometry if one is sure the painter fits it.

Member Data Documentation

ZqbPlaceholder QzqArea::m_AreaPh
protected

Placeholder for the whole area.

QColor QzqArea::m_bg_color
protected

Background color.

bool QzqArea::m_bHardcopy
protected

Redraw purpose. The value is actual only during redraw() processing.

ZqbContainer QzqArea::m_Container
protected

Container for all objects.

bool QzqArea::m_drawable
protected

Drawable flag. True by default. If false => drawing is turned off.

DrawObjectSelection QzqArea::m_eDrawObjectSelection
protected

Current selection for drawing. It's needed by placeholders to provide proper selection of objects.

ZqObject * QzqArea::m_pGrabber
protected

Pointer to object who grabs the inpout or NULL if noone grab the input.

ZqbPixGroup QzqArea::m_pgx
protected

The only group for placement along X axis

ZqbPixGroup QzqArea::m_pgy
protected

The only group for placement along Y axis

QzqDynamicTip * QzqArea::m_qDynTip
protected

The pointer to dynamic tip display object.

QPainter QzqArea::m_qPainter
protected

Default graphics context.

QPixmap QzqArea::m_qPixBuf
protected

Pixmap buffer for fast drawing if nothing changes.

QPixmap QzqArea::m_qStaticPixBuf
protected

Pixmap buffer used for storing statically drawn non-interactive objects. Interactive objects are drawn always dynamically (by calling their redraw())

ZqbNatGrpMembers QzqArea::m_vObservers
protected

The list of pointers to ZqbNatGrpObserver objects


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