summaryrefslogtreecommitdiffstats
path: root/kexi/widget/tableview/kexitableedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/tableview/kexitableedit.cpp')
-rw-r--r--kexi/widget/tableview/kexitableedit.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/widget/tableview/kexitableedit.cpp b/kexi/widget/tableview/kexitableedit.cpp
index 8c3f56123..6a9008f1c 100644
--- a/kexi/widget/tableview/kexitableedit.cpp
+++ b/kexi/widget/tableview/kexitableedit.cpp
@@ -23,44 +23,44 @@
#include <kexidb/field.h>
#include <kexidb/utils.h>
-#include <qpalette.h>
-#include <qpainter.h>
+#include <tqpalette.h>
+#include <tqpainter.h>
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
-KexiTableEdit::KexiTableEdit(KexiTableViewColumn &column, QWidget* parent)
-: QWidget(dynamic_cast<QScrollView*>(parent) ? dynamic_cast<QScrollView*>(parent)->viewport() : parent)
+KexiTableEdit::KexiTableEdit(KexiTableViewColumn &column, TQWidget* tqparent)
+: TQWidget(dynamic_cast<TQScrollView*>(tqparent) ? dynamic_cast<TQScrollView*>(tqparent)->viewport() : tqparent)
,m_column(&column)
// ,m_field(&f)
// ,m_type(f.type()) //copied because the rest of code uses m_type
- ,m_scrollView(dynamic_cast<QScrollView*>(parent))
+ ,m_scrollView(dynamic_cast<TQScrollView*>(tqparent))
,m_usesSelectedTextColor(true)
,m_view(0)
// ,m_hasFocusableWidget(true)
// ,m_acceptEditorAfterDeleteContents(false)
{
- setPaletteBackgroundColor( palette().color(QPalette::Active, QColorGroup::Base) );
+ setPaletteBackgroundColor( palette().color(TQPalette::Active, TQColorGroup::Base) );
installEventFilter(this);
//margins
if (displayedField()->isFPNumericType()) {
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
m_leftMargin = 0;
#else
m_leftMargin = 0;
#endif
}
else if (displayedField()->isIntegerType()) {
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
m_leftMargin = 1;
#else
m_leftMargin = 0;
#endif
}
else {//default
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
m_leftMargin = 5;
#else
m_leftMargin = 5;
@@ -83,7 +83,7 @@ KexiDB::Field *KexiTableEdit::displayedField() const
return m_column->field(); //typical case
}
-void KexiTableEdit::setViewWidget(QWidget *v)
+void KexiTableEdit::setViewWidget(TQWidget *v)
{
m_view = v;
m_view->move(0,0);
@@ -91,7 +91,7 @@ void KexiTableEdit::setViewWidget(QWidget *v)
setFocusProxy(m_view);
}
-void KexiTableEdit::moveChild( QWidget * child, int x, int y )
+void KexiTableEdit::moveChild( TQWidget * child, int x, int y )
{
if (m_scrollView)
m_scrollView->moveChild(child, x, y);
@@ -99,9 +99,9 @@ void KexiTableEdit::moveChild( QWidget * child, int x, int y )
void KexiTableEdit::resize(int w, int h)
{
- QWidget::resize(w, h);
+ TQWidget::resize(w, h);
if (m_view) {
- if (!layout()) { //if there is layout (eg. KexiInputTableEdit), resize is automatic
+ if (!tqlayout()) { //if there is tqlayout (eg. KexiInputTableEdit), resize is automatic
m_view->move(0,0);
m_view->resize(w, h);
}
@@ -109,22 +109,22 @@ void KexiTableEdit::resize(int w, int h)
}
bool
-KexiTableEdit::eventFilter(QObject* watched, QEvent* e)
+KexiTableEdit::eventFilter(TQObject* watched, TQEvent* e)
{
/* if (watched == m_view) {
- if(e->type() == QEvent::KeyPress) {
- QKeyEvent* ev = static_cast<QKeyEvent*>(e);
+ if(e->type() == TQEvent::KeyPress) {
+ TQKeyEvent* ev = static_cast<TQKeyEvent*>(e);
// if (ev->key()==Key_Tab) {
// }
}
}*/
- if(watched == this)
+ if(TQT_BASE_OBJECT(watched) == TQT_BASE_OBJECT(this))
{
- if(e->type() == QEvent::KeyPress)
+ if(e->type() == TQEvent::KeyPress)
{
- QKeyEvent* ev = static_cast<QKeyEvent*>(e);
+ TQKeyEvent* ev = TQT_TQKEYEVENT(e);
if(ev->key() == Key_Escape)
{
@@ -137,23 +137,23 @@ KexiTableEdit::eventFilter(QObject* watched, QEvent* e)
}
}
return false;
-// return QWidget::eventFilter(watched, e);
+// return TQWidget::eventFilter(watched, e);
}
-void KexiTableEdit::paintFocusBorders( QPainter *p, QVariant &, int x, int y, int w, int h )
+void KexiTableEdit::paintFocusBorders( TQPainter *p, TQVariant &, int x, int y, int w, int h )
{
p->drawRect(x, y, w, h);
}
-void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val,
- QString &txt, int &align, int &/*x*/, int &y_offset, int &w, int &h )
+void KexiTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val,
+ TQString &txt, int &align, int &/*x*/, int &y_offset, int &w, int &h )
{
Q_UNUSED(p);
Q_UNUSED(focused);
Q_UNUSED(h);
KexiDB::Field *realField = displayedField();
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
// x = 1;
y_offset = -1;
#else
@@ -171,11 +171,11 @@ void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& va
align |= AlignRight;
}
else if (realField->isIntegerType()) {
- Q_LLONG num = val.toLongLong();
+ TQ_LLONG num = val.toLongLong();
w -= 6;
align |= AlignRight;
if (!val.isNull())
- txt = QString::number(num);
+ txt = TQString::number(num);
}
else {//default:
if (!val.isNull()) {
@@ -185,18 +185,18 @@ void KexiTableEdit::setupContents( QPainter *p, bool focused, const QVariant& va
}
}
-void KexiTableEdit::paintSelectionBackground( QPainter *p, bool /*focused*/,
- const QString& txt, int align, int x, int y_offset, int w, int h, const QColor& fillColor,
- const QFontMetrics &fm, bool readOnly, bool fullRowSelection )
+void KexiTableEdit::paintSelectionBackground( TQPainter *p, bool /*focused*/,
+ const TQString& txt, int align, int x, int y_offset, int w, int h, const TQColor& fillColor,
+ const TQFontMetrics &fm, bool readOnly, bool fullRowSelection )
{
if (!readOnly && !fullRowSelection && !txt.isEmpty()) {
- QRect bound=fm.boundingRect(x, y_offset, w - (x+x), h, align, txt);
+ TQRect bound=fm.boundingRect(x, y_offset, w - (x+x), h, align, txt);
bound.setY(0);
- bound.setWidth( QMIN( bound.width()+2, w - (x+x)+1 ) );
- if (align & Qt::AlignLeft) {
+ bound.setWidth( TQMIN( bound.width()+2, w - (x+x)+1 ) );
+ if (align & TQt::AlignLeft) {
bound.setX(bound.x()-1);
}
- else if (align & Qt::AlignRight) {
+ else if (align & TQt::AlignRight) {
bound.moveLeft( w - bound.width() ); //move to left, if too wide
}
//TODO align center
@@ -208,18 +208,18 @@ void KexiTableEdit::paintSelectionBackground( QPainter *p, bool /*focused*/,
}
}
-int KexiTableEdit::widthForValue( QVariant &val, const QFontMetrics &fm )
+int KexiTableEdit::widthForValue( TQVariant &val, const TQFontMetrics &fm )
{
return fm.width( val.toString() );
}
-void KexiTableEdit::repaintRelatedCell()
+void KexiTableEdit::tqrepaintRelatedCell()
{
if (dynamic_cast<KexiDataAwareObjectInterface*>(m_scrollView))
dynamic_cast<KexiDataAwareObjectInterface*>(m_scrollView)->updateCurrentCell();
}
-bool KexiTableEdit::showToolTipIfNeeded(const QVariant& value, const QRect& rect, const QFontMetrics& fm,
+bool KexiTableEdit::showToolTipIfNeeded(const TQVariant& value, const TQRect& rect, const TQFontMetrics& fm,
bool focused)
{
Q_UNUSED(value);