diff options
Diffstat (limited to 'kexi/widget/relations/kexirelationviewconnection.cpp')
-rw-r--r-- | kexi/widget/relations/kexirelationviewconnection.cpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/kexi/widget/relations/kexirelationviewconnection.cpp b/kexi/widget/relations/kexirelationviewconnection.cpp index 2c27de87..7c813298 100644 --- a/kexi/widget/relations/kexirelationviewconnection.cpp +++ b/kexi/widget/relations/kexirelationviewconnection.cpp @@ -18,11 +18,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpixmap.h> -#include <qcolor.h> -#include <qapplication.h> -#include <qpointarray.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqcolor.h> +#include <tqapplication.h> +#include <tqpointarray.h> #include <kdebug.h> @@ -40,9 +40,9 @@ KexiRelationViewConnection::KexiRelationViewConnection( KexiRelationViewTableContainer *masterTbl, KexiRelationViewTableContainer *detailsTbl, - SourceConnection &c, KexiRelationView *parent) + SourceConnection &c, KexiRelationView *tqparent) { - m_parent = parent; + m_parent = tqparent; // kdDebug() << "KexiRelationViewConnection::KexiRelationViewConnection()" << endl; m_masterTable = masterTbl; @@ -65,22 +65,22 @@ KexiRelationViewConnection::~KexiRelationViewConnection() } void -KexiRelationViewConnection::drawConnection(QPainter *p) +KexiRelationViewConnection::drawConnection(TQPainter *p) { - p->setPen(m_parent->palette().active().foreground()); + p->setPen(m_parent->tqpalette().active().foreground()); int sx = m_masterTable->x() + m_masterTable->width() + m_parent->contentsX(); int sy = m_masterTable->globalY(m_masterField); int rx = m_detailsTable->x() + m_parent->contentsX(); int ry = m_detailsTable->globalY(m_detailsField); - QFont f( Kexi::smallFont( m_parent ) ); - QFontMetrics fm(f); + TQFont f( Kexi::smallFont( m_parent ) ); + TQFontMetrics fm(f); int side1x=0, side1y=sy - fm.height(), sideNx=0, sideNy=ry - fm.height(); //! @todo details char can be also just a '1' for some cases - QChar sideNChar(0x221E); //infinity char + TQChar sideNChar(0x221E); //infinity char uint sideNCharWidth = 2+2+ fm.width( sideNChar ); - QChar side1Char('1'); + TQChar side1Char('1'); uint side1CharWidth = 2+2+ fm.width( side1Char ); p->setBrush(p->pen().color()); @@ -88,11 +88,11 @@ KexiRelationViewConnection::drawConnection(QPainter *p) { //det. side p->drawLine(rx - sideNCharWidth, ry, rx, ry); - QPointArray pa(3); + TQPointArray pa(3); pa.setPoint(0, rx - 4, ry - 3); pa.setPoint(1, rx - 4, ry + 3); pa.setPoint(2, rx - 1, ry); - p->drawPolygon(pa, true); + p->tqdrawPolygon(pa, true); //master side p->drawLine(sx, sy - 1, sx + side1CharWidth -1, sy - 1); @@ -105,10 +105,10 @@ KexiRelationViewConnection::drawConnection(QPainter *p) sideNx = rx - sideNCharWidth - 1; // sideNy = ry - 6; - QPen pen(p->pen()); + TQPen pen(p->pen()); if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(2); p->setPen(pen); } @@ -117,7 +117,7 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(1); p->setPen(pen); } @@ -130,11 +130,11 @@ KexiRelationViewConnection::drawConnection(QPainter *p) //det. side p->drawLine(lx, ry, lx + sideNCharWidth, ry); - QPointArray pa(3); + TQPointArray pa(3); pa.setPoint(0, lx + 3, ry - 3); pa.setPoint(1, lx + 3, ry + 3); pa.setPoint(2, lx, ry); - p->drawPolygon(pa, true); + p->tqdrawPolygon(pa, true); // p->drawLine(lx, ry, lx + 8, ry); // p->drawPoint(lx + 1, ry - 1); @@ -154,7 +154,7 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(2); p->setPen(pen); } @@ -163,20 +163,20 @@ KexiRelationViewConnection::drawConnection(QPainter *p) if(m_selected) { - QPen pen(p->pen()); + TQPen pen(p->pen()); pen.setWidth(1); p->setPen(pen); } } - p->drawText(side1x, side1y, side1CharWidth, fm.height(), Qt::AlignCenter, side1Char); - p->drawText(sideNx, sideNy, sideNCharWidth, fm.height(), Qt::AlignCenter, sideNChar); - //p->drawRect(QRect(connectionRect().topLeft(), QSize(50,50))); -// p->drawPixmap(side1, QPixmap(r1_xpm)); -// p->drawPixmap(sideN, QPixmap(rn_xpm)); + p->drawText(side1x, side1y, side1CharWidth, fm.height(), TQt::AlignCenter, side1Char); + p->drawText(sideNx, sideNy, sideNCharWidth, fm.height(), TQt::AlignCenter, sideNChar); + //p->drawRect(TQRect(connectionRect().topLeft(), TQSize(50,50))); +// p->drawPixmap(side1, TQPixmap(r1_xpm)); +// p->drawPixmap(sideN, TQPixmap(rn_xpm)); } -const QRect +const TQRect KexiRelationViewConnection::connectionRect() { int sx = m_masterTable->x() + m_parent->contentsX(); @@ -200,15 +200,15 @@ KexiRelationViewConnection::connectionRect() } - int dx = QABS((leftX + width) - rightX); - int dy = QABS(sy - ry) + 2; + int dx = TQABS((leftX + width) - rightX); + int dy = TQABS(sy - ry) + 2; - int top = QMIN(sy, ry); + int top = TQMIN(sy, ry); int left = leftX + width; -// return QRect(sx - 1, sy - 1, (rx + m_detailsTable->width()) - sx + 1, ry - sy + 1); - QRect rect(left - 150, top - 150, dx + 150, dy + 150); +// return TQRect(sx - 1, sy - 1, (rx + m_detailsTable->width()) - sx + 1, ry - sy + 1); + TQRect rect(left - 150, top - 150, dx + 150, dy + 150); // kdDebug() << "KexiRelationViewConnection::connectionRect():" << m_oldRect << "," << rect << endl; m_oldRect = rect; @@ -217,11 +217,11 @@ KexiRelationViewConnection::connectionRect() } bool -KexiRelationViewConnection::matchesPoint(const QPoint &p, int tolerance) +KexiRelationViewConnection::matchesPoint(const TQPoint &p, int tolerance) { - QRect we = connectionRect(); + TQRect we = connectionRect(); - if(!we.contains(p)) + if(!we.tqcontains(p)) return false; /** get our coordinats @@ -282,17 +282,17 @@ KexiRelationViewConnection::matchesPoint(const QPoint &p, int tolerance) return false; } -QString +TQString KexiRelationViewConnection::toString() const { - QString str; + TQString str; /*! @todo what about query? */ if (m_masterTable && m_masterTable->schema()->table()) { - str += (QString(m_masterTable->schema()->name()) + "." + m_masterField); + str += (TQString(m_masterTable->schema()->name()) + "." + m_masterField); } if (m_detailsTable && m_detailsTable->schema()->table()) { str += " - "; - str += (QString(m_detailsTable->schema()->name()) + "." + m_detailsField); + str += (TQString(m_detailsTable->schema()->name()) + "." + m_detailsField); } return str; } |