summaryrefslogtreecommitdiffstats
path: root/kexi/widget/tableview/kexidataawareobjectiface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/tableview/kexidataawareobjectiface.cpp')
-rw-r--r--kexi/widget/tableview/kexidataawareobjectiface.cpp298
1 files changed, 149 insertions, 149 deletions
diff --git a/kexi/widget/tableview/kexidataawareobjectiface.cpp b/kexi/widget/tableview/kexidataawareobjectiface.cpp
index 59edbed3..5c90eb06 100644
--- a/kexi/widget/tableview/kexidataawareobjectiface.cpp
+++ b/kexi/widget/tableview/kexidataawareobjectiface.cpp
@@ -25,9 +25,9 @@
#include "kexidataawareobjectiface.h"
-#include <qscrollview.h>
-#include <qlabel.h>
-#include <qtooltip.h>
+#include <tqscrollview.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
#include <kmessagebox.h>
@@ -79,13 +79,13 @@ KexiDataAwareObjectInterface::KexiDataAwareObjectInterface()
m_recentSearchDirection = KexiSearchAndReplaceViewInterface::Options::DefaultSearchDirection;
// setup scrollbar tooltip and related members
- m_scrollBarTip = new QLabel("",0, "vScrollBarToolTip",
- Qt::WStyle_Customize |Qt::WStyle_NoBorder|Qt::WX11BypassWM|Qt::WStyle_StaysOnTop|Qt::WStyle_Tool);
- m_scrollBarTip->setPalette(QToolTip::palette());
+ m_scrollBarTip = new TQLabel("",0, "vScrollBarToolTip",
+ TQt::WStyle_Customize |TQt::WStyle_NoBorder|TQt::WX11BypassWM|TQt::WStyle_StaysOnTop|TQt::WStyle_Tool);
+ m_scrollBarTip->setPalette(TQToolTip::palette());
m_scrollBarTip->setMargin(2);
m_scrollBarTip->setIndent(0);
- m_scrollBarTip->setAlignment(Qt::AlignCenter);
- m_scrollBarTip->setFrameStyle( QFrame::Plain | QFrame::Box );
+ m_scrollBarTip->tqsetAlignment(TQt::AlignCenter);
+ m_scrollBarTip->setFrameStyle( TQFrame::Plain | TQFrame::Box );
m_scrollBarTip->setLineWidth(1);
clearVariables();
@@ -142,7 +142,7 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner
wid=KEXI_DEFAULT_DATA_COLUMN_WIDTH;//default col width in pixels
//! @todo add col width configuration and storage
addHeaderColumn(it.current()->isHeaderTextVisible()
- ? it.current()->captionAliasOrName() : QString::null,
+ ? it.current()->captionAliasOrName() : TQString(),
f->description(), it.current()->icon(), wid);
}
}
@@ -158,29 +158,29 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner
if (m_data && !theSameData) {
//! @todo: store sorting settings?
setSorting(-1);
-// connect(m_data, SIGNAL(refreshRequested()), this, SLOT(slotRefreshRequested()));
- connectToReloadDataSlot(m_data, SIGNAL(reloadRequested()));
- QObject* thisObject = dynamic_cast<QObject*>(this);
+// connect(m_data, TQT_SIGNAL(refreshRequested()), this, TQT_SLOT(slotRefreshRequested()));
+ connectToReloadDataSlot(m_data, TQT_SIGNAL(reloadRequested()));
+ TQObject* thisObject = dynamic_cast<TQObject*>(this);
if (thisObject) {
- QObject::connect(m_data, SIGNAL(destroying()), thisObject, SLOT(slotDataDestroying()));
- QObject::connect(m_data, SIGNAL(rowsDeleted( const QValueList<int> & )),
- thisObject, SLOT(slotRowsDeleted( const QValueList<int> & )));
- QObject::connect(m_data, SIGNAL(aboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)),
- thisObject, SLOT(slotAboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)));
- QObject::connect(m_data, SIGNAL(rowDeleted()), thisObject, SLOT(slotRowDeleted()));
- QObject::connect(m_data, SIGNAL(rowInserted(KexiTableItem*,bool)),
- thisObject, SLOT(slotRowInserted(KexiTableItem*,bool)));
- QObject::connect(m_data, SIGNAL(rowInserted(KexiTableItem*,uint,bool)),
- thisObject, SLOT(slotRowInserted(KexiTableItem*,uint,bool))); //not db-aware
- QObject::connect(m_data, SIGNAL(rowRepaintRequested(KexiTableItem&)),
- thisObject, SLOT(slotRowRepaintRequested(KexiTableItem&)));
+ TQObject::connect(m_data, TQT_SIGNAL(destroying()), thisObject, TQT_SLOT(slotDataDestroying()));
+ TQObject::connect(m_data, TQT_SIGNAL(rowsDeleted( const TQValueList<int> & )),
+ thisObject, TQT_SLOT(slotRowsDeleted( const TQValueList<int> & )));
+ TQObject::connect(m_data, TQT_SIGNAL(aboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)),
+ thisObject, TQT_SLOT(slotAboutToDeleteRow(KexiTableItem&,KexiDB::ResultInfo*,bool)));
+ TQObject::connect(m_data, TQT_SIGNAL(rowDeleted()), thisObject, TQT_SLOT(slotRowDeleted()));
+ TQObject::connect(m_data, TQT_SIGNAL(rowInserted(KexiTableItem*,bool)),
+ thisObject, TQT_SLOT(slotRowInserted(KexiTableItem*,bool)));
+ TQObject::connect(m_data, TQT_SIGNAL(rowInserted(KexiTableItem*,uint,bool)),
+ thisObject, TQT_SLOT(slotRowInserted(KexiTableItem*,uint,bool))); //not db-aware
+ TQObject::connect(m_data, TQT_SIGNAL(rowRepaintRequested(KexiTableItem&)),
+ thisObject, TQT_SLOT(slotRowRepaintRequested(KexiTableItem&)));
// setup scrollbar's tooltip
- QObject::connect(verticalScrollBar(),SIGNAL(sliderReleased()),
- thisObject,SLOT(vScrollBarSliderReleased()));
- QObject::connect(verticalScrollBar(),SIGNAL(valueChanged(int)),
- thisObject,SLOT(vScrollBarValueChanged(int)));
- QObject::connect(&m_scrollBarTipTimer,SIGNAL(timeout()),
- thisObject,SLOT(scrollBarTipTimeout()));
+ TQObject::connect(verticalScrollBar(),TQT_SIGNAL(sliderReleased()),
+ thisObject,TQT_SLOT(vScrollBarSliderReleased()));
+ TQObject::connect(verticalScrollBar(),TQT_SIGNAL(valueChanged(int)),
+ thisObject,TQT_SLOT(vScrollBarValueChanged(int)));
+ TQObject::connect(&m_scrollBarTipTimer,TQT_SIGNAL(timeout()),
+ thisObject,TQT_SLOT(scrollBarTipTimeout()));
}
}
@@ -214,7 +214,7 @@ void KexiDataAwareObjectInterface::setData( KexiTableViewData *data, bool owner
void KexiDataAwareObjectInterface::initDataContents()
{
m_editor = 0;
-// QSize s(tableSize());
+// TQSize s(tableSize());
// resizeContents(s.width(),s.height());
m_navPanel->setRecordCount(rows());
@@ -306,7 +306,7 @@ bool KexiDataAwareObjectInterface::sort()
return true;
}
if (m_currentItem != m_insertItem) {
- m_curRow = m_data->findRef(m_currentItem);
+ m_curRow = m_data->tqfindRef(m_currentItem);
int jump = m_curRow - oldRow;
if (jump<0)
(*m_itemIterator) -= -jump;
@@ -440,20 +440,20 @@ void KexiDataAwareObjectInterface::setSpreadSheetMode()
void KexiDataAwareObjectInterface::selectNextRow()
{
- selectRow( QMIN( rows() - 1 +(isInsertingEnabled()?1:0), m_curRow + 1 ) );
+ selectRow( TQMIN( rows() - 1 +(isInsertingEnabled()?1:0), m_curRow + 1 ) );
}
void KexiDataAwareObjectInterface::selectPrevPage()
{
selectRow(
- QMAX( 0, m_curRow - rowsPerPage() )
+ TQMAX( 0, m_curRow - rowsPerPage() )
);
}
void KexiDataAwareObjectInterface::selectNextPage()
{
selectRow(
- QMIN(
+ TQMIN(
rows() - 1 + (isInsertingEnabled()?1:0),
m_curRow + rowsPerPage()
)
@@ -480,7 +480,7 @@ void KexiDataAwareObjectInterface::selectRow(int row)
void KexiDataAwareObjectInterface::selectPrevRow()
{
- selectRow( QMAX( 0, m_curRow - 1 ) );
+ selectRow( TQMAX( 0, m_curRow - 1 ) );
}
void KexiDataAwareObjectInterface::clearSelection()
@@ -524,23 +524,23 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo
if(col>=0)
{
- newcol = QMAX(0, col);
- newcol = QMIN(columns() - 1, newcol);
+ newcol = TQMAX(0, col);
+ newcol = TQMIN(columns() - 1, newcol);
}
else {
newcol = m_curCol; //no changes
- newcol = QMAX(0, newcol); //may not be < 0 !
+ newcol = TQMAX(0, newcol); //may not be < 0 !
}
- newrow = QMAX(0, row);
- newrow = QMIN(rows() - 1 + (isInsertingEnabled()?1:0), newrow);
+ newrow = TQMAX(0, row);
+ newrow = TQMIN(rows() - 1 + (isInsertingEnabled()?1:0), newrow);
// d->pCurrentItem = itemAt(d->curRow);
// kdDebug(44021) << "setCursorPosition(): d->curRow=" << d->curRow << " oldRow=" << oldRow << " d->curCol=" << d->curCol << " oldCol=" << oldCol << endl;
if ( forceSet || m_curRow != newrow || m_curCol != newcol )
{
- kexidbg << "setCursorPosition(): " <<QString("old:%1,%2 new:%3,%4").arg(m_curCol)
- .arg(m_curRow).arg(newcol).arg(newrow) << endl;
+ kexidbg << "setCursorPosition(): " <<TQString("old:%1,%2 new:%3,%4").tqarg(m_curCol)
+ .tqarg(m_curRow).tqarg(newcol).tqarg(newrow) << endl;
// cursor moved: get rid of editor
if (m_editor) {
@@ -549,7 +549,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo
return;
}
//update row num. again
- newrow = QMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow);
+ newrow = TQMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow);
}
}
if (m_errorMessagePopup) {
@@ -574,7 +574,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo
return;
}
//update row number, because number of rows changed
- newrow = QMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow);
+ newrow = TQMIN( rows() - 1 + (isInsertingEnabled()?1:0), newrow);
m_navPanel->setCurrentRecordNumber(newrow+1); //refresh
}
@@ -621,7 +621,7 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo
// //quite clever: ensure the cell is visible:
// ensureCellVisible(m_curRow, m_curCol);
-// QPoint pcenter = QRect( columnPos(d->curCol), rowPos(d->curRow), columnWidth(d->curCol), rh).center();
+// TQPoint pcenter = TQRect( columnPos(d->curCol), rowPos(d->curRow), columnWidth(d->curCol), rh).center();
// ensureVisible(pcenter.x(), pcenter.y(), columnWidth(d->curCol)/2, rh/2);
// ensureVisible(columnPos(d->curCol), rowPos(d->curRow) - contentsY(), columnWidth(d->curCol), rh);
@@ -644,8 +644,8 @@ void KexiDataAwareObjectInterface::setCursorPosition(int row, int col/*=-1*/, bo
m_currentItem = m_insertItem;
}
else {
- kdDebug(44021) << QString("NOW item at %1 (%2) is current")
- .arg(m_curRow).arg((ulong)itemAt(m_curRow)) << endl;
+ kdDebug(44021) << TQString("NOW item at %1 (%2) is current")
+ .tqarg(m_curRow).tqarg((ulong)itemAt(m_curRow)) << endl;
//NOT EFFECTIVE!!!!!!!!!!!
//set item iterator
if (!newRowInserted && isInsertingEnabled() && m_currentItem == m_insertItem && m_curRow == (rows()-1)) {
@@ -710,7 +710,7 @@ bool KexiDataAwareObjectInterface::acceptRowEdit()
// bool allow = true;
// int faultyColumn = -1; // will be !=-1 if cursor has to be moved to that column
const bool inserting = m_newRowEditing;
-// QString msg, desc;
+// TQString msg, desc;
// bool inserting = d->pInsertItem && d->pInsertItem==d->pCurrentItem;
if (m_data->rowEditBuffer()->isEmpty() && !m_newRowEditing) {
@@ -838,8 +838,8 @@ bool KexiDataAwareObjectInterface::cancelRowEdit()
// viewport()->width(), d->rowHeight*3 + (m_navPanel ? m_navPanel->height() : 0)*3 );
// updateContents(); //js: above did not work well so we do that dirty
updateWidgetContents();
-//TODO: still doesn't repaint properly!!
-// QSize s(tableSize());
+//TODO: still doesn't tqrepaint properly!!
+// TQSize s(tableSize());
// resizeContents(s.width(), s.height());
updateWidgetContentsSize();
// m_verticalHeader->update();
@@ -890,17 +890,17 @@ bool KexiDataAwareObjectInterface::cancelEditor()
}
//! @internal
-class KexiDataAwareObjectInterfaceToolTip : public QToolTip {
+class KexiDataAwareObjectInterfaceToolTip : public TQToolTip {
public:
- KexiDataAwareObjectInterfaceToolTip( const QString & text, const QPoint & pos, QWidget * widget )
- : QToolTip(widget), m_text(text)
+ KexiDataAwareObjectInterfaceToolTip( const TQString & text, const TQPoint & pos, TQWidget * widget )
+ : TQToolTip(widget), m_text(text)
{
- tip( QRect(pos, QSize(100, 100)), text );
+ tip( TQRect(pos, TQSize(100, 100)), text );
}
- virtual void maybeTip(const QPoint & p) {
- tip( QRect(p, QSize(100, 100)), m_text);
+ virtual void maybeTip(const TQPoint & p) {
+ tip( TQRect(p, TQSize(100, 100)), m_text);
}
- QString m_text;
+ TQString m_text;
};
bool KexiDataAwareObjectInterface::acceptEditor()
@@ -912,12 +912,12 @@ bool KexiDataAwareObjectInterface::acceptEditor()
m_inside_acceptEditor = true;//avoid recursion
- QVariant newval;
+ TQVariant newval;
Validator::Result res = Validator::Ok;
- QString msg, desc;
+ TQString msg, desc;
bool setNull = false;
// bool allow = true;
-// static const QString msg_NOT_NULL = i18n("\"%1\" column requires a value to be entered.");
+// static const TQString msg_NOT_NULL = i18n("\"%1\" column requires a value to be entered.");
//autoincremented field can be omitted (left as null or empty) if we're inserting a new row
const bool autoIncColumnCanBeOmitted = m_newRowEditing && m_editor->field()->isAutoIncrement();
@@ -931,19 +931,19 @@ bool KexiDataAwareObjectInterface::acceptEditor()
//used e.g. for date or time values - the value can be null but not necessary invalid
res = Validator::Error;
editCurrentCellAgain = true;
- QWidget *par = dynamic_cast<QScrollView*>(this) ? dynamic_cast<QScrollView*>(this)->viewport() :
- dynamic_cast<QWidget*>(this);
- QWidget *edit = dynamic_cast<QWidget*>(m_editor);
+ TQWidget *par = dynamic_cast<TQScrollView*>(this) ? dynamic_cast<TQScrollView*>(this)->viewport() :
+ dynamic_cast<TQWidget*>(this);
+ TQWidget *edit = dynamic_cast<TQWidget*>(m_editor);
if (par && edit) {
//! @todo allow displaying user-defined warning
//! @todo also use for other error messages
if (!m_errorMessagePopup) {
// m_errorMessagePopup->close();
m_errorMessagePopup = new KexiArrowTip(
- i18n("Error: %1").arg(m_editor->columnInfo()->field->typeName())+"?",
- dynamic_cast<QWidget*>(this));
+ i18n("Error: %1").tqarg(m_editor->columnInfo()->field->typeName())+"?",
+ dynamic_cast<TQWidget*>(this));
m_errorMessagePopup->move(
- par->mapToGlobal(edit->pos()) + QPoint(6, edit->height() + 0) );
+ par->mapToGlobal(edit->pos()) + TQPoint(6, edit->height() + 0) );
m_errorMessagePopup->show();
}
m_editor->setFocus();
@@ -954,8 +954,8 @@ bool KexiDataAwareObjectInterface::acceptEditor()
if (m_editor->field()->isNotNull() && !autoIncColumnCanBeOmitted) {
kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): NULL NOT ALLOWED!" << endl;
res = Validator::Error;
-// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName())
- msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName())
+// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName())
+ msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName())
+ "\n\n" + Kexi::msgYouCanImproveData();
desc = i18n("The column's constraint is declared as NOT NULL.");
editCurrentCellAgain = true;
@@ -976,8 +976,8 @@ bool KexiDataAwareObjectInterface::acceptEditor()
if (m_editor->field()->isNotEmpty() && !autoIncColumnCanBeOmitted) {
kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): EMPTY NOT ALLOWED!" << endl;
res = Validator::Error;
-// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName())
- msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName())
+// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName())
+ msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName())
+ "\n\n" + Kexi::msgYouCanImproveData();
desc = i18n("The column's constraint is declared as NOT EMPTY.");
editCurrentCellAgain = true;
@@ -994,8 +994,8 @@ bool KexiDataAwareObjectInterface::acceptEditor()
if (m_editor->field()->isNotNull() && !autoIncColumnCanBeOmitted) {
kdDebug() << "KexiDataAwareObjectInterface::acceptEditor(): NEITHER NULL NOR EMPTY VALUE CAN BE SET!" << endl;
res = Validator::Error;
-// msg = Validator::msgColumnNotEmpty().arg(m_editor->columnInfo()->field->captionOrName())
- msg = Validator::msgColumnNotEmpty().arg(m_editor->field()->captionOrName())
+// msg = Validator::msgColumnNotEmpty().tqarg(m_editor->columnInfo()->field->captionOrName())
+ msg = Validator::msgColumnNotEmpty().tqarg(m_editor->field()->captionOrName())
+ "\n\n" + Kexi::msgYouCanImproveData();
desc = i18n("The column's constraint is declared as NOT EMPTY and NOT NULL.");
editCurrentCellAgain = true;
@@ -1064,16 +1064,16 @@ bool KexiDataAwareObjectInterface::acceptEditor()
if (res == Validator::Error) {
if (!msg.isEmpty()) {
if (desc.isEmpty())
- KMessageBox::sorry(dynamic_cast<QWidget*>(this), msg);
+ KMessageBox::sorry(dynamic_cast<TQWidget*>(this), msg);
else
- KMessageBox::detailedSorry(dynamic_cast<QWidget*>(this), msg, desc);
+ KMessageBox::detailedSorry(dynamic_cast<TQWidget*>(this), msg, desc);
}
editCurrentCellAgain = true;
// allow = false;
}
else if (res == Validator::Warning) {
//js: todo: message!!!
- KMessageBox::messageBox(dynamic_cast<QWidget*>(this), KMessageBox::Sorry, msg + "\n" + desc);
+ KMessageBox::messageBox(dynamic_cast<TQWidget*>(this), KMessageBox::Sorry, msg + "\n" + desc);
editCurrentCellAgain = true;
}
@@ -1083,7 +1083,7 @@ bool KexiDataAwareObjectInterface::acceptEditor()
// emit aboutToChangeCell(d->pCurrentItem, newval, allow);
// if (allow) {
//send changes to the backend
- QVariant visibleValue;
+ TQVariant visibleValue;
if (!newval.isNull()/* visible value should be null if value is null */
&& currentTVColumn->visibleLookupColumnInfo)
{
@@ -1139,13 +1139,13 @@ bool KexiDataAwareObjectInterface::acceptEditor()
m_editor->showWidget();
m_editor->setFocus();
}
-// startEditCurrentCell(newval.type()==QVariant::String ? newval.toString() : QString::null);
+// startEditCurrentCell(newval.type()==TQVariant::String ? newval.toString() : TQString());
// m_editor->setFocus();
}
return false;
}
-void KexiDataAwareObjectInterface::startEditCurrentCell(const QString &setText)
+void KexiDataAwareObjectInterface::startEditCurrentCell(const TQString &setText)
{
kdDebug() << "** KexiDataAwareObjectInterface::startEditCurrentCell("<<setText<<")"<<endl;
// if (columnType(d->curCol) == KexiDB::Field::Boolean)
@@ -1180,7 +1180,7 @@ void KexiDataAwareObjectInterface::deleteAndStartEditCurrentCell()
// columnWidth(m_curCol), rowHeight());
//OK?
ensureCellVisible(m_curRow+1, m_curCol);
- createEditor(m_curRow, m_curCol, QString::null, false/*removeOld*/);
+ createEditor(m_curRow, m_curCol, TQString(), false/*removeOld*/);
if (!m_editor)
return;
m_editor->clear();
@@ -1208,7 +1208,7 @@ void KexiDataAwareObjectInterface::deleteCurrentRow()
case ImmediateDelete:
break;
case AskDelete:
- if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<QWidget*>(this),
+ if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<TQWidget*>(this),
i18n("Do you want to delete selected row?"), 0,
KGuiItem(i18n("&Delete Row"),"editdelete"),
"dontAskBeforeDeleteRow"/*config entry*/,
@@ -1251,7 +1251,7 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row)
m_curRow++;
}
- m_data->insertRow(*newItem, row, true /*repaint*/);
+ m_data->insertRow(*newItem, row, true /*tqrepaint*/);
if (changeCurrentRow) {
//update iter...
@@ -1259,7 +1259,7 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row)
(*m_itemIterator)+=m_curRow;
}
/*
- QSize s(tableSize());
+ TQSize s(tableSize());
resizeContents(s.width(),s.height());
//redraw only this row and below:
@@ -1281,15 +1281,15 @@ void KexiDataAwareObjectInterface::insertItem(KexiTableItem *newItem, int row)
*/
}
-void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem *item, bool repaint)
+void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem *item, bool tqrepaint)
{
- int row = m_data->findRef(item);
- slotRowInserted( item, row, repaint );
+ int row = m_data->tqfindRef(item);
+ slotRowInserted( item, row, tqrepaint );
}
-void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uint row, bool repaint)
+void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uint row, bool tqrepaint)
{
- if (repaint && (int)row<rows()) {
+ if (tqrepaint && (int)row<rows()) {
updateWidgetContentsSize();
/* updateAllVisibleRowsBelow() used instead
@@ -1317,7 +1317,7 @@ void KexiDataAwareObjectInterface::slotRowInserted(KexiTableItem * /*item*/, uin
}
}
-tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint)
+tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool tqrepaint)
{
if (!hasData())
return true;
@@ -1325,13 +1325,13 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint)
return true;
if (ask) {
- QString tableName = m_data->dbTableName();
+ TQString tableName = m_data->dbTableName();
if (!tableName.isEmpty()) {
tableName.prepend(" \"");
tableName.append("\"");
}
- if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<QWidget*>(this),
- i18n("Do you want to clear the contents of table %1?").arg(tableName),
+ if (KMessageBox::Cancel == KMessageBox::warningContinueCancel(dynamic_cast<TQWidget*>(this),
+ i18n("Do you want to clear the contents of table %1?").tqarg(tableName),
0, KGuiItem(i18n("&Clear Contents")) ))
return cancelled;
}
@@ -1339,10 +1339,10 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint)
cancelRowEdit();
// acceptRowEdit();
// m_verticalHeader->clear();
- const bool repaintLater = repaint && m_spreadSheetMode;
+ const bool tqrepaintLater = tqrepaint && m_spreadSheetMode;
const int oldRows = rows();
- bool res = m_data->deleteAllRows(repaint && !repaintLater);
+ bool res = m_data->deleteAllRows(tqrepaint && !tqrepaintLater);
if (res) {
if (m_spreadSheetMode) {
@@ -1352,28 +1352,28 @@ tristate KexiDataAwareObjectInterface::deleteAllRows(bool ask, bool repaint)
}
}
}
- if (repaintLater)
+ if (tqrepaintLater)
m_data->reload();
// d->clearVariables();
// m_verticalHeader->setCurrentRow(-1);
// d->pUpdateTimer->start(1,true);
-// if (repaint)
-// viewport()->repaint();
+// if (tqrepaint)
+// viewport()->tqrepaint();
return res;
}
-void KexiDataAwareObjectInterface::clearColumns(bool repaint)
+void KexiDataAwareObjectInterface::clearColumns(bool tqrepaint)
{
cancelRowEdit();
m_data->clearInternal();
- clearColumnsInternal(repaint);
+ clearColumnsInternal(tqrepaint);
updateIndicesForVisibleValues();
- if (repaint)
-// viewport()->repaint();
+ if (tqrepaint)
+// viewport()->tqrepaint();
//OK?
updateWidgetContents();
@@ -1393,7 +1393,7 @@ void KexiDataAwareObjectInterface::clearColumns(bool repaint)
m_verticalHeader->setCurrentRow(-1);
- viewport()->repaint();
+ viewport()->tqrepaint();
// d->pColumnTypes.resize(0);
// d->pColumnModes.resize(0);
@@ -1419,7 +1419,7 @@ void KexiDataAwareObjectInterface::reloadData()
if (m_verticalHeader)
m_verticalHeader->setCurrentRow(-1);
- if (dynamic_cast<QWidget*>(this) && dynamic_cast<QWidget*>(this)->isVisible())
+ if (dynamic_cast<TQWidget*>(this) && dynamic_cast<TQWidget*>(this)->isVisible())
initDataContents();
else
m_initDataContentsOnShow = true;
@@ -1456,9 +1456,9 @@ int KexiDataAwareObjectInterface::dataColumns() const
return m_data->columns.count();
}
-QVariant KexiDataAwareObjectInterface::columnDefaultValue(int /*col*/) const
+TQVariant KexiDataAwareObjectInterface::columnDefaultValue(int /*col*/) const
{
- return QVariant(0);
+ return TQVariant(0);
//TODO(js)
// return m_data->columns[col].defaultValue;
}
@@ -1490,10 +1490,10 @@ void KexiDataAwareObjectInterface::setEmptyRowInsertingEnabled(bool set)
}
void KexiDataAwareObjectInterface::slotAboutToDeleteRow(KexiTableItem& item,
- KexiDB::ResultInfo* /*result*/, bool repaint)
+ KexiDB::ResultInfo* /*result*/, bool tqrepaint)
{
- if (repaint) {
- m_rowWillBeDeleted = m_data->findRef(&item);
+ if (tqrepaint) {
+ m_rowWillBeDeleted = m_data->tqfindRef(&item);
}
}
@@ -1529,12 +1529,12 @@ bool KexiDataAwareObjectInterface::deleteItem(KexiTableItem *item)/*, bool moveC
if (!item || !beforeDeleteItem(item))
return false;
- QString msg, desc;
+ TQString msg, desc;
// bool current = (item == d->pCurrentItem);
const bool lastRowDeleted = m_spreadSheetMode && m_data->last() == item; //we need to know this so we
//can return to the last row
//after reinserting it
- if (!m_data->deleteRow(*item, true /*repaint*/)) {
+ if (!m_data->deleteRow(*item, true /*tqrepaint*/)) {
/*const int button =*/
showErrorMessageForResult( m_data->result() );
// if (KMessageBox::No == button) {
@@ -1547,7 +1547,7 @@ bool KexiDataAwareObjectInterface::deleteItem(KexiTableItem *item)/*, bool moveC
//d->pCurrentItem = m_data->current();
}
-// repaintAfterDelete();
+// tqrepaintAfterDelete();
if (m_spreadSheetMode) { //append empty row for spreadsheet mode
m_data->append(m_data->createItem());//new KexiTableItem(m_data->columns.count()));
if (m_verticalHeader)
@@ -1572,7 +1572,7 @@ bool KexiDataAwareObjectInterface::hasDefaultValueAt(const KexiTableViewColumn&
return false;
}
-const QVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useDefaultValueIfPossible)
+const TQVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useDefaultValueIfPossible)
{
if (m_rowEditing && m_data->rowEditBuffer())
{
@@ -1585,17 +1585,17 @@ const QVariant* KexiDataAwareObjectInterface::bufferedValueAt(int col, bool useD
"fieldNumberForColumn(m_curCol) < 0" << endl;
return 0;
}
- QVariant *storedValue = &m_currentItem->at( realFieldNumber );
+ TQVariant *storedValue = &m_currentItem->at( realFieldNumber );
//db-aware data: now, try to find a buffered value (or default one)
- const QVariant *cv = m_data->rowEditBuffer()->at( *tvcol->columnInfo,
+ const TQVariant *cv = m_data->rowEditBuffer()->at( *tvcol->columnInfo,
storedValue->isNull() && useDefaultValueIfPossible);
if (cv)
return cv;
return storedValue;
}
//not db-aware data:
- const QVariant *cv = m_data->rowEditBuffer()->at( tvcol->field()->name() );
+ const TQVariant *cv = m_data->rowEditBuffer()->at( tvcol->field()->name() );
if (cv)
return cv;
}
@@ -1632,8 +1632,8 @@ void KexiDataAwareObjectInterface::boolToggled()
updateCell(m_curRow, m_curCol);
/* int s = m_currentItem->at(m_curCol).toInt();
- QVariant oldValue=m_currentItem->at(m_curCol);
- (*m_currentItem)[m_curCol] = QVariant(s ? 0 : 1);
+ TQVariant oldValue=m_currentItem->at(m_curCol);
+ (*m_currentItem)[m_curCol] = TQVariant(s ? 0 : 1);
updateCell(m_curRow, m_curCol);
// emit itemChanged(m_currentItem, m_curRow, m_curCol, oldValue);
// emit itemChanged(m_currentItem, m_curRow, m_curCol);*/
@@ -1660,7 +1660,7 @@ void KexiDataAwareObjectInterface::addNewRecordRequested()
m_editor->setFocus();
}
-bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int &curCol,
+bool KexiDataAwareObjectInterface::handleKeyPress(TQKeyEvent *e, int &curRow, int &curCol,
bool fullRowSelection, bool *moveToFirstField, bool *moveToLastField)
{
if (moveToFirstField)
@@ -1672,23 +1672,23 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int
const int k = e->key();
//kdDebug() << "-----------" << e->state() << " " << k << endl;
- if ((k == Qt::Key_Up && nobtn) || (k == Qt::Key_PageUp && e->state()==Qt::ControlButton)) {
+ if ((k == TQt::Key_Up && nobtn) || (k == TQt::Key_PageUp && e->state()==TQt::ControlButton)) {
selectPrevRow();
e->accept();
}
- else if ((k == Qt::Key_Down && nobtn) || (k == Qt::Key_PageDown && e->state()==Qt::ControlButton)) {
+ else if ((k == TQt::Key_Down && nobtn) || (k == TQt::Key_PageDown && e->state()==TQt::ControlButton)) {
selectNextRow();
e->accept();
}
- else if (k == Qt::Key_PageUp && nobtn) {
+ else if (k == TQt::Key_PageUp && nobtn) {
selectPrevPage();
e->accept();
}
- else if (k == Qt::Key_PageDown && nobtn) {
+ else if (k == TQt::Key_PageDown && nobtn) {
selectNextPage();
e->accept();
}
- else if (k == Qt::Key_Home) {
+ else if (k == TQt::Key_Home) {
if (fullRowSelection) {
//we're in row-selection mode: home key always moves to 1st row
curRow = 0;//to 1st row
@@ -1697,7 +1697,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int
if (nobtn) {
curCol = 0;//to 1st col
}
- else if (e->state()==Qt::ControlButton) {
+ else if (e->state()==TQt::ControlButton) {
curRow = 0;//to 1st row and col
curCol = 0;
}
@@ -1709,7 +1709,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int
//do not accept yet
e->ignore();
}
- else if (k == Qt::Key_End) {
+ else if (k == TQt::Key_End) {
if (fullRowSelection) {
//we're in row-selection mode: home key always moves to last row
curRow = m_data->count()-1+(isInsertingEnabled()?1:0);//to last row
@@ -1718,7 +1718,7 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int
if (nobtn) {
curCol = columns()-1;//to last col
}
- else if (e->state()==Qt::ControlButton) {
+ else if (e->state()==TQt::ControlButton) {
curRow = m_data->count()-1 /*+(isInsertingEnabled()?1:0)*/; //to last row and col
curCol = columns()-1;//to last col
}
@@ -1730,8 +1730,8 @@ bool KexiDataAwareObjectInterface::handleKeyPress(QKeyEvent *e, int &curRow, int
//do not accept yet
e->ignore();
}
- else if (isInsertingEnabled() && (e->state()==Qt::ControlButton && k == Qt::Key_Equal
- || e->state()==(Qt::ControlButton|Qt::ShiftButton) && k == Qt::Key_Equal)) {
+ else if (isInsertingEnabled() && (e->state()==TQt::ControlButton && k == TQt::Key_Equal
+ || e->state()==(TQt::ControlButton|TQt::ShiftButton) && k == TQt::Key_Equal)) {
curRow = m_data->count(); //to the new row
curCol = 0;//to first col
if (moveToFirstField)
@@ -1752,19 +1752,19 @@ void KexiDataAwareObjectInterface::vScrollBarValueChanged(int v)
return;
if (m_scrollbarToolTipsEnabled) {
- const QRect r( verticalScrollBar()->sliderRect() );
+ const TQRect r( verticalScrollBar()->sliderRect() );
const int row = lastVisibleRow()+1;
if (row<=0) {
m_scrollBarTipTimer.stop();
m_scrollBarTip->hide();
return;
}
- m_scrollBarTip->setText( i18n("Row: ") + QString::number(row) );
+ m_scrollBarTip->setText( i18n("Row: ") + TQString::number(row) );
m_scrollBarTip->adjustSize();
- QWidget* thisWidget = dynamic_cast<QWidget*>(this);
+ TQWidget* thisWidget = dynamic_cast<TQWidget*>(this);
m_scrollBarTip->move(
thisWidget->mapToGlobal( r.topLeft() + verticalScrollBar()->pos() )
- + QPoint( - m_scrollBarTip->width()-5,
+ + TQPoint( - m_scrollBarTip->width()-5,
r.height()/2 - m_scrollBarTip->height()/2) );
if (verticalScrollBar()->draggingSlider()) {
kdDebug(44021) << " draggingSlider() " << endl;
@@ -1783,7 +1783,7 @@ void KexiDataAwareObjectInterface::vScrollBarValueChanged(int v)
}
}
//update bottom view region
-/* if (m_navPanel && (contentsHeight() - contentsY() - clipper()->height()) <= QMAX(d->rowHeight,m_navPanel->height())) {
+/* if (m_navPanel && (contentsHeight() - contentsY() - clipper()->height()) <= TQMAX(d->rowHeight,m_navPanel->height())) {
slotUpdate();
triggerUpdate();
}*/
@@ -1819,7 +1819,7 @@ void KexiDataAwareObjectInterface::scrollBarTipTimeout()
m_scrollBarTipTimerCnt=0;
}
-void KexiDataAwareObjectInterface::focusOutEvent(QFocusEvent* e)
+void KexiDataAwareObjectInterface::focusOutEvent(TQFocusEvent* e)
{
Q_UNUSED(e);
m_scrollBarTipTimer.stop();
@@ -1830,12 +1830,12 @@ void KexiDataAwareObjectInterface::focusOutEvent(QFocusEvent* e)
int KexiDataAwareObjectInterface::showErrorMessageForResult(KexiDB::ResultInfo* resultInfo)
{
- QWidget *thisWidget = dynamic_cast<QWidget*>(this);
+ TQWidget *thisWidget = dynamic_cast<TQWidget*>(this);
if (resultInfo->allowToDiscardChanges) {
return KMessageBox::questionYesNo(thisWidget, resultInfo->msg
- + (resultInfo->desc.isEmpty() ? QString::null : ("\n"+resultInfo->desc)),
- QString::null,
- KGuiItem(i18n("Correct Changes", "Correct"), QString::null, i18n("Correct changes")),
+ + (resultInfo->desc.isEmpty() ? TQString() : ("\n"+resultInfo->desc)),
+ TQString(),
+ KGuiItem(i18n("Correct Changes", "Correct"), TQString(), i18n("Correct changes")),
KGuiItem(i18n("Discard Changes")) );
}
@@ -1873,7 +1873,7 @@ void KexiDataAwareObjectInterface::updateIndicesForVisibleValues()
means then the last character. \a firstCharacter == INT_MAX means "before first" place, so searching fails
immediately.
On success, true is returned and \a firstCharacter is set to position of the matched string. */
-static inline bool findInString(const QString& stringValue, int stringLength, const QString& where,
+static inline bool findInString(const TQString& stringValue, int stringLength, const TQString& where,
int& firstCharacter, bool matchAnyPartOfField, bool matchWholeField,
bool caseSensitive, bool wholeWordsOnly, bool forward)
{
@@ -1888,7 +1888,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
if (wholeWordsOnly) {
const int whereLength = where.length();
while (true) {
- pos = where.find( stringValue, pos, caseSensitive );
+ pos = where.tqfind( stringValue, pos, caseSensitive );
if (pos == -1)
break;
if ((pos > 0 && where.at(pos-1).isLetterOrNumber())
@@ -1902,7 +1902,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
firstCharacter = pos;
}
else {// !wholeWordsOnly
- firstCharacter = where.find( stringValue, pos, caseSensitive );
+ firstCharacter = where.tqfind( stringValue, pos, caseSensitive );
}
return firstCharacter != -1;
}
@@ -1915,7 +1915,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
if (wholeWordsOnly) {
const int whereLength = where.length();
while (true) {
- pos = where.findRev( stringValue, pos, caseSensitive );
+ pos = where.tqfindRev( stringValue, pos, caseSensitive );
if (pos == -1)
break;
if ((pos > 0 && where.at(pos-1).isLetterOrNumber())
@@ -1932,7 +1932,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
firstCharacter = pos;
}
else {// !wholeWordsOnly
- firstCharacter = where.findRev( stringValue, pos, caseSensitive );
+ firstCharacter = where.tqfindRev( stringValue, pos, caseSensitive );
}
return firstCharacter != -1;
}
@@ -1950,7 +1950,7 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
if (firstCharacter != -1 && firstCharacter != 0) { //we're not at 0-th char
firstCharacter = -1;
}
- else if (where.startsWith(stringValue, caseSensitive)) {
+ else if (where.tqstartsWith(stringValue, caseSensitive)) {
if (wholeWordsOnly) {
// If where.length() < stringValue.length(), true will be returned too - fine.
return !where.at( stringValue.length() ).isLetterOrNumber();
@@ -1962,12 +1962,12 @@ static inline bool findInString(const QString& stringValue, int stringLength, co
return false;
}
-tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind,
+tristate KexiDataAwareObjectInterface::tqfind(const TQVariant& valueToFind,
const KexiSearchAndReplaceViewInterface::Options& options, bool next)
{
if (!hasData())
return cancelled;
- const QVariant prevSearchedValue( m_recentlySearchedValue );
+ const TQVariant prevSearchedValue( m_recentlySearchedValue );
m_recentlySearchedValue = valueToFind;
const KexiSearchAndReplaceViewInterface::Options::SearchDirection prevSearchDirection = m_recentSearchDirection;
m_recentSearchDirection = options.searchDirection;
@@ -2049,7 +2049,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind,
firstColumn = columnNumber;
lastColumn = columnNumber;
}
- const QString stringValue( caseSensitive ? valueToFind.toString() : valueToFind.toString().lower() );
+ const TQString stringValue( caseSensitive ? valueToFind.toString() : valueToFind.toString().lower() );
const int stringLength = stringValue.length();
// search
@@ -2059,7 +2059,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind,
for (; forward ? col <= lastColumn : col >= lastColumn;
col = forward ? (col+1) : (col-1))
{
- const QVariant cell( item->at( m_indicesForVisibleValues[ col ] ) );
+ const TQVariant cell( item->at( m_indicesForVisibleValues[ col ] ) );
if (findInString(stringValue, stringLength, cell.toString(), firstCharacter,
matchAnyPartOfField, matchWholeField, caseSensitive, wholeWordsOnly, forward))
{
@@ -2092,7 +2092,7 @@ tristate KexiDataAwareObjectInterface::find(const QVariant& valueToFind,
}
tristate KexiDataAwareObjectInterface::findNextAndReplace(
- const QVariant& valueToFind, const QVariant& replacement,
+ const TQVariant& valueToFind, const TQVariant& replacement,
const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll)
{
Q_UNUSED(replacement);