summaryrefslogtreecommitdiffstats
path: root/kexi/widget/tableview/kexibooltableedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/tableview/kexibooltableedit.cpp')
-rw-r--r--kexi/widget/tableview/kexibooltableedit.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/widget/tableview/kexibooltableedit.cpp b/kexi/widget/tableview/kexibooltableedit.cpp
index 7b7bc0aca..e85d0c73e 100644
--- a/kexi/widget/tableview/kexibooltableedit.cpp
+++ b/kexi/widget/tableview/kexibooltableedit.cpp
@@ -21,9 +21,9 @@
#include <kexidb/field.h>
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qclipboard.h>
+#include <tqpainter.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
#include <kglobal.h>
#include <klocale.h>
@@ -31,8 +31,8 @@
#include <kglobalsettings.h>
-KexiBoolTableEdit::KexiBoolTableEdit(KexiTableViewColumn &column, QWidget *parent)
- : KexiTableEdit(column, parent)
+KexiBoolTableEdit::KexiBoolTableEdit(KexiTableViewColumn &column, TQWidget *tqparent)
+ : KexiTableEdit(column, tqparent)
{
setName("KexiBoolTableEdit");
kdDebug() << "KexiBoolTableEdit: m_origValue.typeName()==" << m_origValue.typeName() << endl;
@@ -46,7 +46,7 @@ KexiBoolTableEdit::~KexiBoolTableEdit()
{
}
-void KexiBoolTableEdit::setValueInternal(const QVariant& /*add*/, bool /*removeOld*/)
+void KexiBoolTableEdit::setValueInternal(const TQVariant& /*add*/, bool /*removeOld*/)
{
m_currentValue = m_origValue;
//nothing to do more...
@@ -62,7 +62,7 @@ bool KexiBoolTableEdit::valueIsEmpty()
return m_currentValue.isNull();
}
-QVariant KexiBoolTableEdit::value()
+TQVariant KexiBoolTableEdit::value()
{
// ok = true;
return m_currentValue;
@@ -71,9 +71,9 @@ QVariant KexiBoolTableEdit::value()
void KexiBoolTableEdit::clear()
{
if (field()->isNotNull())
- m_currentValue = QVariant(false, 0);
+ m_currentValue = TQVariant(false, 0);
else
- m_currentValue = QVariant();
+ m_currentValue = TQVariant();
}
bool KexiBoolTableEdit::cursorAtStart()
@@ -86,14 +86,14 @@ bool KexiBoolTableEdit::cursorAtEnd()
return true;
}
-void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant& val,
- QString &txt, int &align, int &x, int &y_offset, int &w, int &h )
+void KexiBoolTableEdit::setupContents( TQPainter *p, bool focused, const TQVariant& val,
+ TQString &txt, int &align, int &x, int &y_offset, int &w, int &h )
{
Q_UNUSED(focused);
Q_UNUSED(txt);
Q_UNUSED(align);
Q_UNUSED(x);
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
// x = 1;
y_offset = -1;
#else
@@ -101,14 +101,14 @@ void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant
y_offset = 0;
#endif
if (p) {
- int s = QMAX(h - 5, 12);
- s = QMIN( h-3, s );
- s = QMIN( w-3, s );//avoid too large box
- QRect r( QMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s);
-//already set ouotside: p->setPen(QPen(colorGroup().text(), 1));
+ int s = TQMAX(h - 5, 12);
+ s = TQMIN( h-3, s );
+ s = TQMIN( w-3, s );//avoid too large box
+ TQRect r( TQMAX( w/2 - s/2, 0 ) , h/2 - s/2 /*- 1*/, s, s);
+//already set ouotside: p->setPen(TQPen(tqcolorGroup().text(), 1));
p->drawRect(r);
if (val.isNull()) { // && !field()->isNotNull()) {
- p->drawText( r, Qt::AlignCenter, "?" );
+ p->drawText( r, TQt::AlignCenter, "?" );
}
else if (val.toBool()) {
p->drawLine(r.x(), r.y(), r.right(), r.bottom());
@@ -120,53 +120,53 @@ void KexiBoolTableEdit::setupContents( QPainter *p, bool focused, const QVariant
void KexiBoolTableEdit::clickedOnContents()
{
if (field()->isNotNull())
- m_currentValue = QVariant( !m_currentValue.toBool(), 0 );
+ m_currentValue = TQVariant( !m_currentValue.toBool(), 0 );
else {
// null allowed: use the cycle: true -> false -> null
if (m_currentValue.isNull())
- m_currentValue = QVariant( true, 1 );
+ m_currentValue = TQVariant( true, 1 );
else
- m_currentValue = m_currentValue.toBool() ? QVariant( false, 1 ) : QVariant();
+ m_currentValue = m_currentValue.toBool() ? TQVariant( false, 1 ) : TQVariant();
}
}
-void KexiBoolTableEdit::handleAction(const QString& actionName)
+void KexiBoolTableEdit::handleAction(const TQString& actionName)
{
if (actionName=="edit_paste") {
emit editRequested();
bool ok;
- const int value = qApp->clipboard()->text( QClipboard::Clipboard ).toInt(&ok);
+ const int value = tqApp->tqclipboard()->text( TQClipboard::Clipboard ).toInt(&ok);
if (ok) {
- m_currentValue = (value==0) ? QVariant(false, 0) : QVariant(true, 1);
+ m_currentValue = (value==0) ? TQVariant(false, 0) : TQVariant(true, 1);
}
else {
m_currentValue = field()->isNotNull()
- ? QVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
- : QVariant();
+ ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
+ : TQVariant();
}
- repaintRelatedCell();
+ tqrepaintRelatedCell();
}
else if (actionName=="edit_cut") {
emit editRequested();
//! @todo handle defaultValue...
m_currentValue = field()->isNotNull()
- ? QVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
- : QVariant();
- handleCopyAction(m_origValue, QVariant());
- repaintRelatedCell();
+ ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
+ : TQVariant();
+ handleCopyAction(m_origValue, TQVariant());
+ tqrepaintRelatedCell();
}
}
-void KexiBoolTableEdit::handleCopyAction(const QVariant& value, const QVariant& visibleValue)
+void KexiBoolTableEdit::handleCopyAction(const TQVariant& value, const TQVariant& visibleValue)
{
Q_UNUSED(visibleValue);
- if (value.type()==QVariant::Bool)
- qApp->clipboard()->setText(value.toBool() ? "1" : "0");
+ if (value.type()==TQVariant::Bool)
+ tqApp->clipboard()->setText(value.toBool() ? "1" : "0");
else
- qApp->clipboard()->setText(QString::null);
+ tqApp->clipboard()->setText(TQString());
}
-int KexiBoolTableEdit::widthForValue( QVariant &val, const QFontMetrics &fm )
+int KexiBoolTableEdit::widthForValue( TQVariant &val, const TQFontMetrics &fm )
{
Q_UNUSED(fm);
return val.toPixmap().width();