summaryrefslogtreecommitdiffstats
path: root/kexi/widget/relations/kexirelationview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/widget/relations/kexirelationview.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/widget/relations/kexirelationview.cpp')
-rw-r--r--kexi/widget/relations/kexirelationview.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/kexi/widget/relations/kexirelationview.cpp b/kexi/widget/relations/kexirelationview.cpp
index 9d68a755..ae35334b 100644
--- a/kexi/widget/relations/kexirelationview.cpp
+++ b/kexi/widget/relations/kexirelationview.cpp
@@ -20,15 +20,15 @@
#include <kdebug.h>
-#include <qstringlist.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qheader.h>
-#include <qevent.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qlineedit.h>
-#include <qpopupmenu.h>
+#include <tqstringlist.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqheader.h>
+#include <tqevent.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqlineedit.h>
+#include <tqpopupmenu.h>
#include <klocale.h>
#include <kaction.h>
@@ -45,20 +45,20 @@
#include "kexirelationviewconnection.h"
#include <kexi.h>
-KexiRelationView::KexiRelationView(QWidget *parent, const char *name)
- : QScrollView(parent, name, WStaticContents)
+KexiRelationView::KexiRelationView(TQWidget *tqparent, const char *name)
+ : TQScrollView(tqparent, name, WStaticContents)
{
// m_relation=relation;
// m_relation->incUsageCount();
m_selectedConnection = 0;
m_readOnly=false;
m_focusedTableView = 0;
- setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
-// connect(relation, SIGNAL(relationListUpdated(QObject *)), this, SLOT(slotListUpdate(QObject *)));
+// connect(relation, TQT_SIGNAL(relationListUpdated(TQObject *)), this, TQT_SLOT(slotListUpdate(TQObject *)));
- viewport()->setPaletteBackgroundColor(colorGroup().mid());
- setFocusPolicy(WheelFocus);
+ viewport()->setPaletteBackgroundColor(tqcolorGroup().mid());
+ setFocusPolicy(TQ_WheelFocus);
setResizePolicy(Manual);
/*MOVED TO KexiRelationDialog
//actions
@@ -70,18 +70,18 @@ KexiRelationView::KexiRelationView(QWidget *parent, const char *name)
plugSharedAction("edit_delete", i18n("Hide Table"), m_tableQueryPopup);
plugSharedAction("edit_delete",m_connectionPopup);
- plugSharedAction("edit_delete",this, SLOT(removeSelectedObject()));
+ plugSharedAction("edit_delete",this, TQT_SLOT(removeSelectedObject()));
*/
#if 0
m_removeSelectedTableQueryAction = new KAction(i18n("&Hide Selected Table/Query"), "editdelete", "",
- this, SLOT(removeSelectedTableQuery()), parent->actionCollection(), "relationsview_removeSelectedTableQuery");
+ this, TQT_SLOT(removeSelectedTableQuery()), tqparent->actionCollection(), "relationsview_removeSelectedTableQuery");
m_removeSelectedConnectionAction = new KAction(i18n("&Remove Selected Relationship"), "button_cancel", "",
- this, SLOT(removeSelectedConnection()), parent->actionCollection(), "relationsview_removeSelectedConnection");
+ this, TQT_SLOT(removeSelectedConnection()), tqparent->actionCollection(), "relationsview_removeSelectedConnection");
m_openSelectedTableQueryAction = new KAction(i18n("&Open Selected Table/Query"), "", "",
- this, SLOT(openSelectedTableQuery()), 0/*parent->actionCollection()*/, "relationsview_openSelectedTableQuery");
+ this, TQT_SLOT(openSelectedTableQuery()), 0/*tqparent->actionCollection()*/, "relationsview_openSelectedTableQuery");
#endif
-// invalidateActions();
+// tqinvalidateActions();
#if 0
@@ -91,10 +91,10 @@ KexiRelationView::KexiRelationView(QWidget *parent, const char *name)
m_removeSelectedTableQueryAction->plug( m_popup );
m_removeSelectedConnectionAction->plug( m_popup );
- invalidateActions();
+ tqinvalidateActions();
#endif
- setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding, true);
+ tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding, true);
}
KexiRelationView::~KexiRelationView()
@@ -116,11 +116,11 @@ KexiRelationView::containerForTable(KexiDB::TableSchema* tableSchema)
KexiRelationViewTableContainer *
KexiRelationView::tableContainer(KexiDB::TableSchema *t) const
{
- return t ? m_tables.find(t->name()) : 0;
+ return t ? m_tables.tqfind(t->name()) : 0;
}
KexiRelationViewTableContainer*
-KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect)
+KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const TQRect &rect)
{
if(!t)
return 0;
@@ -137,22 +137,22 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect)
/*! @todo what about query? */
new KexiDB::TableOrQuerySchema(t)
);
- connect(c, SIGNAL(endDrag()), this, SLOT(slotTableViewEndDrag()));
- connect(c, SIGNAL(gotFocus()), this, SLOT(slotTableViewGotFocus()));
-// connect(c, SIGNAL(headerContextMenuRequest(const QPoint&)),
-// this, SLOT(tableHeaderContextMenuRequest(const QPoint&)));
- connect(c, SIGNAL(contextMenuRequest(const QPoint&)),
- this, SIGNAL(tableContextMenuRequest(const QPoint&)));
+ connect(c, TQT_SIGNAL(endDrag()), this, TQT_SLOT(slotTableViewEndDrag()));
+ connect(c, TQT_SIGNAL(gotFocus()), this, TQT_SLOT(slotTableViewGotFocus()));
+// connect(c, TQT_SIGNAL(headerContextMenuRequest(const TQPoint&)),
+// this, TQT_SLOT(tableHeaderContextMenuRequest(const TQPoint&)));
+ connect(c, TQT_SIGNAL(contextMenuRequest(const TQPoint&)),
+ this, TQT_SIGNAL(tableContextMenuRequest(const TQPoint&)));
addChild(c, 100,100);
if (rect.isValid()) {//predefined size
- QSize finalSize = c->size().expandedTo( c->sizeHint() );
- QRect r = rect;
- r.setSize( finalSize + QSize(0,10) );
+ TQSize finalSize = c->size().expandedTo( c->tqsizeHint() );
+ TQRect r = rect;
+ r.setSize( finalSize + TQSize(0,10) );
moveChild( c, rect.left(), rect.top() );
//we're doing this instead of setGeometry(rect)
//because the geomenty might be saved on other system with bigger fonts :)
- c->resize(c->sizeHint());
+ c->resize(c->tqsizeHint());
// c->setGeometry(r);
//TODO
@@ -164,14 +164,14 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect)
updateGeometry();
if (!rect.isValid()) {
c->updateGeometry();
- c->resize(c->sizeHint());
+ c->resize(c->tqsizeHint());
}
int x, y;
if(m_tables.count() > 0)
{
int place = -10;
- QDictIterator<KexiRelationViewTableContainer> it(m_tables);
+ TQDictIterator<KexiRelationViewTableContainer> it(m_tables);
for(; it.current(); ++it)
{
int right = (*it)->x() + (*it)->width();
@@ -187,7 +187,7 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect)
}
y = 5;
- QPoint p = viewportToContents(QPoint(x, y));
+ TQPoint p = viewportToContents(TQPoint(x, y));
recalculateSize(p.x() + c->width(), p.y() + c->height());
if (!rect.isValid()) {
moveChild(c, x, y);
@@ -195,8 +195,8 @@ KexiRelationView::addTableContainer(KexiDB::TableSchema *t, const QRect &rect)
m_tables.insert(t->name(), c);
- connect(c, SIGNAL(moved(KexiRelationViewTableContainer *)), this,
- SLOT(containerMoved(KexiRelationViewTableContainer *)));
+ connect(c, TQT_SIGNAL(moved(KexiRelationViewTableContainer *)), this,
+ TQT_SLOT(containerMoved(KexiRelationViewTableContainer *)));
if (hasFocus()) //ok?
c->setFocus();
@@ -240,10 +240,10 @@ KexiRelationView::addConnection(const SourceConnection& _conn)
KexiRelationViewTableContainer *tmp = master;
master = details;
details = tmp;
- QString tmp_masterTable = conn.masterTable;
+ TQString tmp_masterTable = conn.masterTable;
conn.masterTable = conn.detailsTable;
conn.detailsTable = tmp_masterTable;
- QString tmp_masterField = conn.masterField;
+ TQString tmp_masterField = conn.masterField;
conn.masterField = conn.detailsField;
conn.detailsField = tmp_masterField;
}
@@ -275,12 +275,12 @@ KexiRelationView::addConnection(const SourceConnection& _conn)
}
void
-KexiRelationView::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
+KexiRelationView::drawContents(TQPainter *p, int cx, int cy, int cw, int ch)
{
KexiRelationViewConnection *cview;
// p->translate(0, (double)contentsY());
- QRect clipping(cx, cy, cw, ch);
+ TQRect clipping(cx, cy, cw, ch);
for(cview = m_connectionViews.first(); cview; cview = m_connectionViews.next())
{
if(clipping.intersects(cview->oldRect() | cview->connectionRect()))
@@ -289,7 +289,7 @@ KexiRelationView::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
}
void
-KexiRelationView::slotTableScrolling(const QString& table)
+KexiRelationView::slotTableScrolling(const TQString& table)
{
KexiRelationViewTableContainer *c = m_tables[table];
@@ -301,7 +301,7 @@ void
KexiRelationView::containerMoved(KexiRelationViewTableContainer *c)
{
KexiRelationViewConnection *cview;
- QRect r;
+ TQRect r;
for (ConnectionListIterator it(m_connectionViews); ((cview=it.current())); ++it) {
//! @todo optimize
if(cview->masterTable() == c || cview->detailsTable() == c
@@ -320,10 +320,10 @@ KexiRelationView::containerMoved(KexiRelationViewTableContainer *c)
//didn't work well: updateContents(r);
updateContents();
-// QRect w(c->x() - 5, c->y() - 5, c->width() + 5, c->height() + 5);
+// TQRect w(c->x() - 5, c->y() - 5, c->width() + 5, c->height() + 5);
// updateContents(w);
- QPoint p = viewportToContents(QPoint(c->x(), c->y()));
+ TQPoint p = viewportToContents(TQPoint(c->x(), c->y()));
recalculateSize(p.x() + c->width(), p.y() + c->height());
emit tablePositionChanged(c);
@@ -334,19 +334,19 @@ KexiRelationView::setReadOnly(bool b)
{
m_readOnly=b;
//TODO
-// invalidateActions();
+// tqinvalidateActions();
/* TableList::Iterator it, end( m_tables.end() );
for ( it=m_tables.begin(); it != end; ++it)
{
// (*it)->setReadOnly(b);
-#ifndef Q_WS_WIN
+#ifndef TQ_WS_WIN
#warning readonly needed
#endif
}*/
}
void
-KexiRelationView::slotListUpdate(QObject *)
+KexiRelationView::slotListUpdate(TQObject *)
{
#if 0
if(s != this)
@@ -368,7 +368,7 @@ KexiRelationView::slotListUpdate(QObject *)
}
void
-KexiRelationView::contentsMousePressEvent(QMouseEvent *ev)
+KexiRelationView::contentsMousePressEvent(TQMouseEvent *ev)
{
KexiRelationViewConnection *cview;
for(cview = m_connectionViews.first(); cview; cview = m_connectionViews.next())
@@ -381,11 +381,11 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev)
updateContents(cview->connectionRect());
m_selectedConnection = cview;
emit connectionViewGotFocus();
-// invalidateActions();
+// tqinvalidateActions();
- if(ev->button() == RightButton) {//show popup
+ if(ev->button() == Qt::RightButton) {//show popup
kdDebug() << "KexiRelationView::contentsMousePressEvent(): context" << endl;
-// QPopupMenu m;
+// TQPopupMenu m;
// m_removeSelectedTableQueryAction->plug( &m );
// m_removeSelectedConnectionAction->plug( &m );
emit connectionContextMenuRequest( ev->globalPos() );
@@ -395,9 +395,9 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev)
}
//connection not found
clearSelection();
-// invalidateActions();
- if(ev->button() == RightButton) {//show popup on view background area
-// QPopupMenu m;
+// tqinvalidateActions();
+ if(ev->button() == Qt::RightButton) {//show popup on view background area
+// TQPopupMenu m;
// m_removeSelectedConnectionAction->plug( &m );
emit emptyAreaContextMenuRequest( ev->globalPos() );
// executePopup(ev->globalPos());
@@ -406,7 +406,7 @@ KexiRelationView::contentsMousePressEvent(QMouseEvent *ev)
emit emptyAreaGotFocus();
}
setFocus();
-// QScrollView::contentsMousePressEvent(ev);
+// TQScrollView::contentsMousePressEvent(ev);
}
void KexiRelationView::clearSelection()
@@ -415,18 +415,18 @@ void KexiRelationView::clearSelection()
m_focusedTableView->unsetFocus();
m_focusedTableView = 0;
// setFocus();
-// invalidateActions();
+// tqinvalidateActions();
}
if (m_selectedConnection) {
m_selectedConnection->setSelected(false);
updateContents(m_selectedConnection->connectionRect());
m_selectedConnection = 0;
-// invalidateActions();
+// tqinvalidateActions();
}
}
void
-KexiRelationView::keyPressEvent(QKeyEvent *ev)
+KexiRelationView::keyPressEvent(TQKeyEvent *ev)
{
kdDebug() << "KexiRelationView::keyPressEvent()" << endl;
@@ -467,14 +467,14 @@ void
KexiRelationView::stretchExpandSize()
{
int max_x=-1, max_y=-1;
- QDictIterator<KexiRelationViewTableContainer> it(m_tables);
+ TQDictIterator<KexiRelationViewTableContainer> it(m_tables);
for (;it.current(); ++it) {
if (it.current()->right()>max_x)
max_x = it.current()->right();
if (it.current()->bottom()>max_y)
max_y = it.current()->bottom();
}
- QPoint p = viewportToContents(QPoint(max_x, max_y) + QPoint(3,3)); //3 pixels margin
+ TQPoint p = viewportToContents(TQPoint(max_x, max_y) + TQPoint(3,3)); //3 pixels margin
resizeContents(p.x(), p.y());
}
@@ -516,7 +516,7 @@ KexiRelationView::removeSelectedObject()
#endif
delete m_selectedConnection;
m_selectedConnection = 0;
-// invalidateActions();
+// tqinvalidateActions();
}
else if (m_focusedTableView) {
KexiRelationViewTableContainer *tmp = m_focusedTableView;
@@ -531,7 +531,7 @@ KexiRelationView::hideTable(KexiRelationViewTableContainer* tableView)
/*! @todo what about query? */
KexiDB::TableSchema *ts = tableView->schema()->table();
//for all connections: find and remove all connected with this table
- QPtrListIterator<KexiRelationViewConnection> it(m_connectionViews);
+ TQPtrListIterator<KexiRelationViewConnection> it(m_connectionViews);
for (;it.current();) {
if (it.current()->masterTable() == tableView
|| it.current()->detailsTable() == tableView)
@@ -554,7 +554,7 @@ KexiRelationView::hideAllTablesExcept( KexiDB::TableSchema::List* tables )
//! @todo what about queries?
for (TablesDictIterator it(m_tables); it.current();) {
KexiDB::TableSchema *table = it.current()->schema()->table();
- if (!table || tables->findRef( table )!=-1) {
+ if (!table || tables->tqfindRef( table )!=-1) {
++it;
continue;
}
@@ -580,13 +580,13 @@ void KexiRelationView::slotTableViewGotFocus()
// if (m_focusedTableView)
// m_focusedTableView->unsetFocus();
m_focusedTableView = (KexiRelationViewTableContainer*)sender();
-// invalidateActions();
+// tqinvalidateActions();
emit tableViewGotFocus();
}
-QSize KexiRelationView::sizeHint() const
+TQSize KexiRelationView::tqsizeHint() const
{
- return QSize(QScrollView::sizeHint());//.width(), 600);
+ return TQSize(TQScrollView::tqsizeHint());//.width(), 600);
}
void KexiRelationView::clear()
@@ -609,24 +609,24 @@ void KexiRelationView::removeAllConnections()
/*
-void KexiRelationView::tableHeaderContextMenuRequest(const QPoint& pos)
+void KexiRelationView::tableHeaderContextMenuRequest(const TQPoint& pos)
{
if (m_focusedTableView != sender())
return;
kdDebug() << "HEADER CTXT MENU!" <<endl;
- invalidateActions();
+ tqinvalidateActions();
m_tableQueryPopup->exec(pos);
}
//! Invalidates all actions availability
-void KexiRelationView::invalidateActions()
+void KexiRelationView::tqinvalidateActions()
{
setAvailable("edit_delete", m_selectedConnection || m_focusedTableView);
}
-void KexiRelationView::executePopup( QPoint pos )
+void KexiRelationView::executePopup( TQPoint pos )
{
- if (pos==QPoint(-1,-1)) {
+ if (pos==TQPoint(-1,-1)) {
pos = mapToGlobal( m_focusedTableView ? m_focusedTableView->pos() + m_focusedTableView->rect().center() : rect().center() );
}
if (m_focusedTableView)