kexi
KexiDBLabel Class Reference
#include <kexidblabel.h>
Inheritance diagram for KexiDBLabel:

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 43 of file kexidblabel.h.
Public Slots | |
void | setDataSource (const QString &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 |
virtual QWidget * | widget () |
virtual bool | cursorAtStart () |
virtual bool | cursorAtEnd () |
virtual void | clear () |
virtual bool | setProperty (const char *name, const QVariant &value) |
virtual const QColor & | frameColor () const |
Protected Slots | |
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) |
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 *) |
void | updatePixmapLater () |
Protected Attributes | |
Private * | d |
Properties | |
QString | dataSource [] |
QCString | dataSourceMimeType [] |
bool | shadowEnabled [] |
QColor | frameColor [] |
Member Function Documentation
void KexiDBLabel::clear | ( | ) | [virtual] |
clears item's data, so the data will contain NULL data
Implements KexiDataItemInterface.
Definition at line 544 of file kexidblabel.cpp.
bool KexiDBLabel::cursorAtEnd | ( | ) | [virtual] |
bool KexiDBLabel::cursorAtStart | ( | ) | [virtual] |
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 58 of file kexidblabel.h.
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 59 of file kexidblabel.h.
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.
bool KexiDBLabel::isReadOnly | ( | ) | const [virtual] |
always true
Reimplemented from KexiDataItemInterface.
Definition at line 524 of file kexidblabel.cpp.
void KexiDBLabel::paintEvent | ( | QPaintEvent * | ) | [protected, virtual] |
Definition at line 467 of file kexidblabel.cpp.
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 564 of file kexidblabel.cpp.
void KexiDBLabel::setDataSource | ( | const QString & | ds | ) | [inline, slot] |
Sets the datasource to ds.
Reimplemented from KexiFormDataItemInterface.
Definition at line 93 of file kexidblabel.h.
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 95 of file kexidblabel.h.
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.
bool KexiDBLabel::setProperty | ( | const char * | name, | |
const QVariant & | value | |||
) | [virtual] |
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 570 of file kexidblabel.cpp.
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.
void KexiDBLabel::updatePixmap | ( | ) | [protected, slot] |
Definition at line 447 of file kexidblabel.cpp.
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 529 of file kexidblabel.cpp.
The documentation for this class was generated from the following files: