diff options
Diffstat (limited to 'kexi/plugins/reports/kexireportform.cpp')
-rw-r--r-- | kexi/plugins/reports/kexireportform.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kexi/plugins/reports/kexireportform.cpp b/kexi/plugins/reports/kexireportform.cpp index d5dd6f55..f77b41a5 100644 --- a/kexi/plugins/reports/kexireportform.cpp +++ b/kexi/plugins/reports/kexireportform.cpp @@ -18,20 +18,20 @@ * Boston, MA 02110-1301, USA. */ -#include <qobjectlist.h> -#include <qpainter.h> -#include <qcursor.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqcursor.h> #include <kdebug.h> #include "kexireportform.h" -KexiReportForm::KexiReportForm(QWidget *parent, const char *name/*, KexiDB::Connection *conn*/) - : QWidget(parent, name) +KexiReportForm::KexiReportForm(TQWidget *tqparent, const char *name/*, KexiDB::Connection *conn*/) + : TQWidget(tqparent, name) { //m_conn = conn; kexipluginsdbg << "KexiReportForm::KexiReportForm(): " << endl; - setCursor(QCursor(Qt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries + setCursor(TQCursor(TQt::ArrowCursor)); //to avoid keeping Size cursor when moving from form's boundaries setBackgroundColor(white); } @@ -40,47 +40,47 @@ KexiReportForm::~KexiReportForm() kexipluginsdbg << "KexiReportForm::~KexiReportForm(): close" << endl; } -//repaint all children widgets -static void repaintAll(QWidget *w) +//tqrepaint all tqchildren widgets +static void tqrepaintAll(TQWidget *w) { - QObjectList *list = w->queryList("QWidget"); - QObjectListIt it(*list); - for (QObject *obj; (obj=it.current()); ++it ) { - static_cast<QWidget*>(obj)->repaint(); + TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectListIt it(*list); + for (TQObject *obj; (obj=it.current()); ++it ) { + static_cast<TQWidget*>(obj)->tqrepaint(); } delete list; } void -KexiReportForm::drawRect(const QRect& r, int type) +KexiReportForm::drawRect(const TQRect& r, int type) { - QValueList<QRect> l; + TQValueList<TQRect> l; l.append(r); drawRects(l, type); } void -KexiReportForm::drawRects(const QValueList<QRect> &list, int type) +KexiReportForm::drawRects(const TQValueList<TQRect> &list, int type) { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, QRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); + p.drawPixmap( TQPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, TQRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); } - p.setBrush(QBrush::NoBrush); + p.setBrush(TQBrush::NoBrush); if(type == 1) // selection rect - p.setPen(QPen(white, 1, Qt::DotLine)); + p.setPen(TQPen(white, 1, TQt::DotLine)); else if(type == 2) // insert rect - p.setPen(QPen(white, 2)); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); - prev_rect = QRect(); - QValueList<QRect>::ConstIterator endIt = list.constEnd(); - for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + prev_rect = TQRect(); + TQValueList<TQRect>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { p.drawRect(*it); prev_rect = prev_rect.unite(*it); } @@ -93,58 +93,58 @@ KexiReportForm::drawRects(const QValueList<QRect> &list, int type) void KexiReportForm::initBuffer() { - repaintAll(this); + tqrepaintAll(this); buffer.resize( width(), height() ); - buffer = QPixmap::grabWindow( winId() ); - prev_rect = QRect(); + buffer = TQPixmap::grabWindow( winId() ); + prev_rect = TQRect(); } void KexiReportForm::clearForm() { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); //redraw entire form surface - p.drawPixmap( QPoint(0,0), buffer, QRect(0,0,buffer.width(), buffer.height()) ); + p.drawPixmap( TQPoint(0,0), buffer, TQRect(0,0,buffer.width(), buffer.height()) ); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); - repaintAll(this); + tqrepaintAll(this); } void -KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point) +KexiReportForm::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point) { - QPoint fromPoint, toPoint; - if(from && from->parentWidget() && (from != this)) - fromPoint = from->parentWidget()->mapTo(this, from->pos()); - if(to && to->parentWidget() && (to != this)) - toPoint = to->parentWidget()->mapTo(this, to->pos()); + TQPoint fromPoint, toPoint; + if(from && from->tqparentWidget() && (from != this)) + fromPoint = from->tqparentWidget()->mapTo(this, from->pos()); + if(to && to->tqparentWidget() && (to != this)) + toPoint = to->tqparentWidget()->mapTo(this, to->pos()); - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x(), prev_rect.y()), buffer, QRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); + p.drawPixmap( TQPoint(prev_rect.x(), prev_rect.y()), buffer, TQRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); } - p.setPen( QPen(Qt::red, 2) ); + p.setPen( TQPen(TQt::red, 2) ); if(to) { - QPixmap pix1 = QPixmap::grabWidget(from); - QPixmap pix2 = QPixmap::grabWidget(to); + TQPixmap pix1 = TQPixmap::grabWidget(from); + TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); + p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); @@ -161,7 +161,7 @@ KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5); if((to == this) || (from == this)) - prev_rect = QRect(0, 0, buffer.width(), buffer.height()); + prev_rect = TQRect(0, 0, buffer.width(), buffer.height()); else if(to) { prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) ); @@ -170,18 +170,18 @@ KexiReportForm::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ; } else - prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); + prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); } -QSize -KexiReportForm::sizeHint() const +TQSize +KexiReportForm::tqsizeHint() const { //todo: find better size (user configured?) - return QSize(400,300); + return TQSize(400,300); } #include "kexireportform.moc" |