/***************************************************************************
copyright : (C) 1999 by Edwin Glaser
email : edwin@pannenleiter.de
version : $Id: dblabel.h,v 1.1.1.1 2000/02/07 21:41:58 ege Exp $
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DBLABEL_H
#define DBLABEL_H
#include <qwidget.h>
#include <qlabel.h>
#include "dbdatasource.h"
#include "dbpainter.h"
/**
* A data-aware label
*
*@author Edwin Glaser
*/
class DBLabel : public QLabel, public DBPainter
{
Q_OBJECT
protected:
DBDataSource *data;
int column;
DBDataSource *getDataSource() { return data; };
int getColumn() { return column; };
public:
DBLabel(DBDataSource *d, int col, QWidget *parent=0, const char *name=0);
virtual ~DBLabel();
virtual void paint (QPainter *p, int width, int height, int align = 0, const char *format = 0);
protected slots:
virtual void dbTextChanged();
virtual void dbTextChanged(int column);
};
class DBLabelFactory : public DBWidgetFactory
{
protected:
static DBLabelFactory *instance;
DBLabelFactory() {};
public:
static DBWidgetFactory *getFactory();
virtual QWidget *makeEditor(DBDataSource *d, int col, QWidget *parent);
virtual DBPainter *makePainter (QWidget *editor);
};
#endif
Documentation generated by eg@wonko on Sam Feb 19 00:09:53 MET 2000