Kexi API Documentation (2.0 alpha)

KexiDBLabel Class Reference

#include <kexidblabel.h>

Inheritance diagram for KexiDBLabel:

QLabel KexiDBTextWidgetInterface KexiFormDataItemInterface KexiDataItemInterface List of all members.

Detailed Description

An extended, data-aware, read-only text label.

It's text may have a drop-shadow.

Author:
Christian Nitschkowski, Jaroslaw Staniek

Definition at line 42 of file kexidblabel.h.

Public Slots

void setDataSource (const QString &ds)
 Sets the datasource to ds.
void setDataSourceMimeType (const QCString &ds)
virtual void setText (const QString &text)
void setShadowEnabled (bool state)
virtual void setPalette (const QPalette &pal)
virtual void setFrameColor (const QColor &color)

Public Member Functions

 KexiDBLabel (QWidget *parent, const char *name=0, WFlags f=0)
 KexiDBLabel (const QString &text, QWidget *parent, const char *name=0, WFlags f=0)
virtual ~KexiDBLabel ()
QString dataSource () const
QCString dataSourceMimeType () const
virtual QVariant value ()
bool shadowEnabled () const
virtual void setInvalidState (const QString &displayText)
virtual bool valueIsNull ()
virtual bool valueIsEmpty ()
virtual bool isReadOnly () const
 always true
virtual QWidgetwidget ()
virtual bool cursorAtStart ()
 always false
virtual bool cursorAtEnd ()
 always false
virtual void clear ()
 clears item's data, so the data will contain NULL data
virtual bool setProperty (const char *name, const QVariant &value)
 used to catch setIndent(), etc.
virtual const QColor & frameColor () const

Protected Slots

virtual void setReadOnly (bool readOnly)
 empty
void updatePixmap ()

Protected Member Functions

void init ()
virtual void setColumnInfo (KexiDB::QueryColumnInfo *cinfo)
virtual void paintEvent (QPaintEvent *)
virtual void resizeEvent (QResizeEvent *e)
virtual void setValueInternal (const QVariant &add, bool removeOld)
 Sets value value for a widget.
virtual void fontChange (const QFont &font)
virtual void styleChange (QStyle &style)
virtual void enabledChange (bool enabled)
virtual void paletteChange (const QPalette &oldPal)
virtual void frameChanged ()
virtual void showEvent (QShowEvent *e)
virtual void drawFrame (QPainter *)
 Reimplemented to paint using real frame color instead of froeground.
void updatePixmapLater ()

Protected Attributes

Private * d

Properties

QString dataSource
QCString dataSourceMimeType
bool shadowEnabled
QColor frameColor


Constructor & Destructor Documentation

KexiDBLabel::KexiDBLabel QWidget parent,
const char *  name = 0,
WFlags  f = 0
 

Definition at line 398 of file kexidblabel.cpp.

References init().

KexiDBLabel::KexiDBLabel const QString text,
QWidget parent,
const char *  name = 0,
WFlags  f = 0
 

Definition at line 407 of file kexidblabel.cpp.

References init(), and setText().

KexiDBLabel::~KexiDBLabel  )  [virtual]
 

Definition at line 417 of file kexidblabel.cpp.

References d.


Member Function Documentation

void KexiDBLabel::clear  )  [virtual]
 

clears item's data, so the data will contain NULL data

Implements KexiDataItemInterface.

Definition at line 549 of file kexidblabel.cpp.

References setText().

bool KexiDBLabel::cursorAtEnd  )  [virtual]
 

always false

Implements KexiDataItemInterface.

Definition at line 544 of file kexidblabel.cpp.

bool KexiDBLabel::cursorAtStart  )  [virtual]
 

always false

Implements KexiDataItemInterface.

Definition at line 539 of file kexidblabel.cpp.

QString KexiDBLabel::dataSource  )  const [inline]
 

Returns:
the name of the data source for this widget. Data source usually means here a table or query, a field name or an expression.

Reimplemented from KexiFormDataItemInterface.

Definition at line 57 of file kexidblabel.h.

References KexiFormDataItemInterface::dataSource().

QCString KexiDBLabel::dataSourceMimeType  )  const [inline]
 

Returns:
the mime type of the data source for this widget. Data source mime type means here types like "kexi/table" or "kexi/query" in.the data source is set to object (as within form or subform) or is empty if the data source is set to table field or query column.

Reimplemented from KexiFormDataItemInterface.

Definition at line 58 of file kexidblabel.h.

References KexiFormDataItemInterface::dataSourceMimeType().

virtual void KexiDBLabel::drawFrame QPainter *   )  [protected, virtual]
 

Reimplemented to paint using real frame color instead of froeground.

Also allows to paint more types of frame.

void KexiDBLabel::enabledChange bool  enabled  )  [protected, virtual]
 

Definition at line 601 of file kexidblabel.cpp.

References d.

void KexiDBLabel::fontChange const QFont &  font  )  [protected, virtual]
 

Definition at line 590 of file kexidblabel.cpp.

References d.

void KexiDBLabel::frameChanged  )  [protected, virtual]
 

Definition at line 623 of file kexidblabel.cpp.

References d.

virtual const QColor& KexiDBLabel::frameColor  )  const [virtual]
 

void KexiDBLabel::init  )  [protected]
 

Definition at line 422 of file kexidblabel.cpp.

References d, and KexiDataItemInterface::m_hasFocusableWidget.

Referenced by KexiDBLabel().

bool KexiDBLabel::isReadOnly  )  const [virtual]
 

always true

Reimplemented from KexiDataItemInterface.

Definition at line 524 of file kexidblabel.cpp.

void KexiDBLabel::paintEvent QPaintEvent *  e  )  [protected, virtual]
 

If required, update the pixmap-cache.

If the part that should be redrawn intersects with our shadow, redraw the shadow where it intersects with e->rect(). Have to move the clipping rect around a bit because the shadow has to be drawn using an offset relative to the widgets border.

Definition at line 467 of file kexidblabel.cpp.

References d, KexiDBTextWidgetInterface::paint(), and updatePixmapLater().

void KexiDBLabel::paletteChange const QPalette &  oldPal  )  [protected, virtual]
 

Definition at line 607 of file kexidblabel.cpp.

References d.

void KexiDBLabel::resizeEvent QResizeEvent *  e  )  [protected, virtual]
 

Definition at line 583 of file kexidblabel.cpp.

References d.

void KexiDBLabel::setColumnInfo KexiDB::QueryColumnInfo cinfo  )  [protected, virtual]
 

Used internally to set database column information. Reimplement if you need to do additional actions, e.g. set data validator based on field type. Don't forget about calling superclass implementation.

Reimplemented from KexiFormDataItemInterface.

Definition at line 569 of file kexidblabel.cpp.

References KexiDBTextWidgetInterface::setColumnInfo(), and KexiFormDataItemInterface::setColumnInfo().

void KexiDBLabel::setDataSource const QString ds  )  [inline, slot]
 

Sets the datasource to ds.

Reimplemented from KexiFormDataItemInterface.

Definition at line 92 of file kexidblabel.h.

References KexiFormDataItemInterface::setDataSource().

void KexiDBLabel::setDataSourceMimeType const QCString &  ds  )  [inline, slot]
 

Sets the mime type of the data source for this widget. Data source usually means here a "kexi/table" or "kexi/query".

See also:
dataSourceMimeType()

Reimplemented from KexiFormDataItemInterface.

Definition at line 94 of file kexidblabel.h.

References KexiFormDataItemInterface::setDataSourceMimeType().

virtual void KexiDBLabel::setFrameColor const QColor &  color  )  [virtual, slot]
 

void KexiDBLabel::setInvalidState const QString displayText  )  [virtual]
 

Sets 'invalid' state, e.g. a text editor widget should display text displayText and become read only to prevent entering data, because updating at the database backend is not available. displayText is usually set to something i18n'd like "#NAME?". Note: that even widgets that usualy do not display texts (e.g. pixmaps) should display displayText too.

Implements KexiFormDataItemInterface.

Definition at line 509 of file kexidblabel.cpp.

References setText().

virtual void KexiDBLabel::setPalette const QPalette &  pal  )  [virtual, slot]
 

bool KexiDBLabel::setProperty const char *  name,
const QVariant &  value
[virtual]
 

used to catch setIndent(), etc.

Definition at line 554 of file kexidblabel.cpp.

References d, and updatePixmap().

void KexiDBLabel::setReadOnly bool  readOnly  )  [protected, virtual, slot]
 

empty

Implements KexiFormDataItemInterface.

Definition at line 529 of file kexidblabel.cpp.

void KexiDBLabel::setShadowEnabled bool  state  )  [slot]
 

Enable/Disable the shadow effect. KexiDBLabel acts just like a normal QLabel when shadow is disabled.

Definition at line 575 of file kexidblabel.cpp.

References d.

void KexiDBLabel::setText const QString text  )  [virtual, slot]
 

Definition at line 634 of file kexidblabel.cpp.

References d, and KexiDataItemInterface::valueChanged().

Referenced by clear(), KexiDBLabel(), setInvalidState(), and setValueInternal().

void KexiDBLabel::setValueInternal const QVariant &  add,
bool  removeOld
[protected, virtual]
 

Sets value value for a widget.

Implements KexiDataItemInterface.

Definition at line 498 of file kexidblabel.cpp.

References KexiDataItemInterface::m_origValue, and setText().

bool KexiDBLabel::shadowEnabled  )  const
 

void KexiDBLabel::showEvent QShowEvent *  e  )  [protected, virtual]
 

Definition at line 629 of file kexidblabel.cpp.

References d.

void KexiDBLabel::styleChange QStyle style  )  [protected, virtual]
 

Definition at line 596 of file kexidblabel.cpp.

References d.

void KexiDBLabel::updatePixmap  )  [protected, slot]
 

Whatever has changed in KexiDBLabel, every parameter is set to our private-label. Just in case...

Definition at line 447 of file kexidblabel.cpp.

References d, and size.

Referenced by setProperty(), and updatePixmapLater().

void KexiDBLabel::updatePixmapLater  )  [protected]
 

Definition at line 432 of file kexidblabel.cpp.

References d, and updatePixmap().

Referenced by paintEvent().

QVariant KexiDBLabel::value  )  [virtual]
 

Returns:
value currently represented by this item.

Implements KexiDataItemInterface.

Definition at line 505 of file kexidblabel.cpp.

bool KexiDBLabel::valueIsEmpty  )  [virtual]
 

Returns:
true if editor's value is empty (not necessary null). Only few data types can accept "EMPTY" property (use KexiDB::Field::hasEmptyProperty() to check this). Used for checking if a given constraint within table of form is met.

Implements KexiDataItemInterface.

Definition at line 519 of file kexidblabel.cpp.

bool KexiDBLabel::valueIsNull  )  [virtual]
 

Returns:
true if editor's value is null (not empty) Used for checking if a given constraint within table or form is met.

Implements KexiDataItemInterface.

Definition at line 514 of file kexidblabel.cpp.

QWidget * KexiDBLabel::widget  )  [virtual]
 

Convenience function: casts this item to a QWidget. Can return 0 if the item is not a QWidget-derived object.

Reimplemented from KexiFormDataItemInterface.

Definition at line 534 of file kexidblabel.cpp.


Member Data Documentation

Private* KexiDBLabel::d [protected]
 

Definition at line 136 of file kexidblabel.h.

Referenced by enabledChange(), fontChange(), frameChanged(), init(), paintEvent(), paletteChange(), resizeEvent(), setProperty(), setShadowEnabled(), setText(), showEvent(), styleChange(), updatePixmap(), updatePixmapLater(), and ~KexiDBLabel().


Property Documentation

QString KexiDBLabel::dataSource [read, write]
 

Definition at line 44 of file kexidblabel.h.

QCString KexiDBLabel::dataSourceMimeType [read, write]
 

Definition at line 45 of file kexidblabel.h.

QColor KexiDBLabel::frameColor [read, write]
 

Definition at line 50 of file kexidblabel.h.

bool KexiDBLabel::shadowEnabled [read, write]
 

Definition at line 46 of file kexidblabel.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:09 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003