You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
5.4 KiB
186 lines
5.4 KiB
13 years ago
|
// This is the SIP interface definition for TQDataTable.
|
||
13 years ago
|
//
|
||
|
// Copyright (c) 2007
|
||
|
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
|
||
|
//
|
||
13 years ago
|
// This file is part of PyTQt.
|
||
13 years ago
|
//
|
||
13 years ago
|
// This copy of PyTQt is free software; you can redistribute it and/or modify it
|
||
13 years ago
|
// under the terms of the GNU General Public License as published by the Free
|
||
|
// Software Foundation; either version 2, or (at your option) any later
|
||
|
// version.
|
||
|
//
|
||
13 years ago
|
// PyTQt is supplied in the hope that it will be useful, but WITHOUT ANY
|
||
13 years ago
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
|
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
|
// details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public License along with
|
||
13 years ago
|
// PyTQt; see the file LICENSE. If not, write to the Free Software Foundation,
|
||
13 years ago
|
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||
|
|
||
|
|
||
|
%ExportedDoc
|
||
13 years ago
|
<Sect2><Title>TQDataTable (TQt v3+)</Title>
|
||
13 years ago
|
<Para>
|
||
13 years ago
|
<Literal>TQDataTable</Literal> is fully implemented.
|
||
13 years ago
|
</Para>
|
||
|
</Sect2>
|
||
|
%End
|
||
|
|
||
|
|
||
13 years ago
|
class TQDataTable : TQTable
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
13 years ago
|
#include <tqdatatable.h>
|
||
13 years ago
|
%End
|
||
|
|
||
|
public:
|
||
13 years ago
|
TQDataTable(TQWidget* /TransferThis/ = 0,const char * = 0);
|
||
|
TQDataTable(TQSqlCursor *,bool = 0,TQWidget * /TransferThis/ = 0,
|
||
13 years ago
|
const char * = 0);
|
||
|
|
||
13 years ago
|
virtual void addColumn(const TQString &,const TQString & = TQString::null,
|
||
|
int = -1,const TQIconSet & = TQIconSet());
|
||
13 years ago
|
virtual void removeColumn(uint);
|
||
13 years ago
|
virtual void setColumn(uint,const TQString &,
|
||
|
const TQString & = TQString::null,int = -1,
|
||
|
const TQIconSet & = TQIconSet());
|
||
13 years ago
|
|
||
13 years ago
|
TQString nullText() const;
|
||
|
TQString trueText() const;
|
||
|
TQString falseText() const;
|
||
13 years ago
|
DateFormat dateFormat() const;
|
||
|
bool confirmEdits() const;
|
||
|
bool confirmInsert() const;
|
||
|
bool confirmUpdate() const;
|
||
|
bool confirmDelete() const;
|
||
|
bool confirmCancels() const;
|
||
|
bool autoDelete() const;
|
||
|
bool autoEdit() const;
|
||
13 years ago
|
TQString filter() const;
|
||
|
TQStringList sort() const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual void setSqlCursor(TQSqlCursor * /GetWrapper/ = 0,bool = 0,bool = 0);
|
||
13 years ago
|
%MethodCode
|
||
|
Py_BEGIN_ALLOW_THREADS
|
||
13 years ago
|
sipSelfWasArg ? sipCpp->TQDataTable::setSqlCursor(a0, a1, a2) : sipCpp->setSqlCursor(a0, a1, a2);
|
||
13 years ago
|
Py_END_ALLOW_THREADS
|
||
|
|
||
|
// Transfer ownership of the cursor if the autoDelete flag is
|
||
|
// set.
|
||
|
if (a0 && a2)
|
||
|
sipTransferTo(a0Wrapper,sipSelf);
|
||
|
%End
|
||
|
|
||
13 years ago
|
TQSqlCursor *sqlCursor() const;
|
||
13 years ago
|
|
||
13 years ago
|
virtual void setNullText(const TQString &);
|
||
|
virtual void setTrueText(const TQString &);
|
||
|
virtual void setFalseText(const TQString &);
|
||
13 years ago
|
virtual void setDateFormat(const DateFormat);
|
||
|
virtual void setConfirmEdits(bool);
|
||
|
virtual void setConfirmInsert(bool);
|
||
|
virtual void setConfirmUpdate(bool);
|
||
|
virtual void setConfirmDelete(bool);
|
||
|
virtual void setConfirmCancels(bool);
|
||
|
virtual void setAutoDelete(bool);
|
||
|
virtual void setAutoEdit(bool);
|
||
13 years ago
|
virtual void setFilter(const TQString &);
|
||
|
virtual void setSort(const TQStringList &);
|
||
|
virtual void setSort(const TQSqlIndex &);
|
||
13 years ago
|
|
||
|
enum Refresh {
|
||
|
RefreshData,
|
||
|
RefreshColumns,
|
||
|
RefreshAll
|
||
|
};
|
||
|
|
||
|
void refresh(Refresh);
|
||
|
void sortColumn(int,bool = 1,bool = 0);
|
||
13 years ago
|
TQString text(int,int) const;
|
||
|
TQVariant value(int,int) const;
|
||
|
TQSqlRecord *currentRecord() const;
|
||
13 years ago
|
|
||
13 years ago
|
void installEditorFactory(TQSqlEditorFactory * /Transfer/);
|
||
|
void installPropertyMap(TQSqlPropertyMap * /Transfer/);
|
||
13 years ago
|
|
||
|
int numCols() const;
|
||
|
int numRows() const;
|
||
|
void setNumCols(int);
|
||
|
void setNumRows(int);
|
||
13 years ago
|
bool findBuffer(const TQSqlIndex &,int = 0);
|
||
13 years ago
|
|
||
|
void hideColumn(int);
|
||
|
void showColumn(int);
|
||
|
|
||
|
signals:
|
||
13 years ago
|
void currentChanged(TQSqlRecord *);
|
||
|
void primeInsert(TQSqlRecord *);
|
||
|
void primeUpdate(TQSqlRecord *);
|
||
|
void primeDelete(TQSqlRecord *);
|
||
|
void beforeInsert(TQSqlRecord *);
|
||
|
void beforeUpdate(TQSqlRecord *);
|
||
|
void beforeDelete(TQSqlRecord *);
|
||
|
void cursorChanged(TQSql::Op);
|
||
13 years ago
|
|
||
|
public slots:
|
||
13 years ago
|
virtual void find(const TQString &,bool,bool);
|
||
13 years ago
|
virtual void sortAscending(int);
|
||
|
virtual void sortDescending(int);
|
||
|
virtual void refresh();
|
||
|
void setColumnWidth(int,int);
|
||
|
void adjustColumn(int);
|
||
|
void setColumnStretchable(int,bool);
|
||
|
void swapColumns(int,int,bool = 0);
|
||
|
|
||
|
protected:
|
||
|
virtual bool insertCurrent();
|
||
|
virtual bool updateCurrent();
|
||
|
virtual bool deleteCurrent();
|
||
|
|
||
13 years ago
|
virtual TQSql::Confirm confirmEdit(TQSql::Op);
|
||
|
virtual TQSql::Confirm confirmCancel(TQSql::Op);
|
||
13 years ago
|
|
||
13 years ago
|
virtual void handleError(const TQSqlError &);
|
||
13 years ago
|
|
||
|
virtual bool beginInsert();
|
||
13 years ago
|
virtual TQWidget *beginUpdate(int,int,bool);
|
||
13 years ago
|
|
||
13 years ago
|
bool eventFilter(TQObject *,TQEvent *);
|
||
|
void keyPressEvent(TQKeyEvent *);
|
||
|
void resizeEvent(TQResizeEvent *);
|
||
|
void contentsMousePressEvent(TQMouseEvent *);
|
||
|
void contentsContextMenuEvent(TQContextMenuEvent *);
|
||
13 years ago
|
void endEdit(int,int,bool,bool);
|
||
|
|
||
13 years ago
|
// We don't specify /Factory/ for this because the returned TQWidget
|
||
13 years ago
|
// will always have a parent which will own it.
|
||
13 years ago
|
TQWidget *createEditor(int,int,bool) const;
|
||
13 years ago
|
|
||
|
void activateNextCell();
|
||
|
int indexOf(uint) const;
|
||
|
void reset();
|
||
13 years ago
|
void setSize(TQSqlCursor *);
|
||
13 years ago
|
void repaintCell(int,int);
|
||
13 years ago
|
void paintCell(TQPainter *,int,int,const TQRect &,bool,
|
||
|
const TQColorGroup &);
|
||
|
virtual void paintField(TQPainter *,const TQSqlField *,const TQRect &,
|
||
13 years ago
|
bool);
|
||
13 years ago
|
void drawContents(TQPainter *,int,int,int,int);
|
||
|
virtual int fieldAlignment(const TQSqlField *);
|
||
13 years ago
|
void columnClicked(int);
|
||
|
void resizeData(int);
|
||
|
|
||
13 years ago
|
TQTableItem *item(int,int) const;
|
||
|
void setItem(int,int,TQTableItem *);
|
||
13 years ago
|
void clearCell(int,int);
|
||
13 years ago
|
void setPixmap(int,int,const TQPixmap &);
|
||
|
void takeItem(TQTableItem *);
|
||
13 years ago
|
|
||
|
private:
|
||
13 years ago
|
TQWidget *beginEdit(int,int,bool);
|
||
13 years ago
|
|
||
13 years ago
|
TQDataTable(const TQDataTable &);
|
||
13 years ago
|
};
|