diff options
Diffstat (limited to 'kexi/widget/tableview/kexitableviewdata.h')
-rw-r--r-- | kexi/widget/tableview/kexitableviewdata.h | 123 |
1 files changed, 62 insertions, 61 deletions
diff --git a/kexi/widget/tableview/kexitableviewdata.h b/kexi/widget/tableview/kexitableviewdata.h index 970d1d23a..56241fcba 100644 --- a/kexi/widget/tableview/kexitableviewdata.h +++ b/kexi/widget/tableview/kexitableviewdata.h @@ -25,11 +25,11 @@ #ifndef KEXITABLEVIEWDATA_H #define KEXITABLEVIEWDATA_H -#include <qptrlist.h> -#include <qvariant.h> -#include <qvaluevector.h> -#include <qstring.h> -#include <qobject.h> +#include <tqptrlist.h> +#include <tqvariant.h> +#include <tqvaluevector.h> +#include <tqstring.h> +#include <tqobject.h> #include "kexitableitem.h" @@ -51,8 +51,8 @@ class KexiTableViewData; /*! Single column definition. */ class KEXIDATATABLE_EXPORT KexiTableViewColumn { public: - typedef QPtrList<KexiTableViewColumn> List; - typedef QPtrListIterator<KexiTableViewColumn> ListIterator; + typedef TQPtrList<KexiTableViewColumn> List; + typedef TQPtrListIterator<KexiTableViewColumn> ListIterator; /*! Not db-aware ctor. if \a owner is true, the field \a will be owned by this column, so you shouldn't care about destroying this field. */ @@ -62,18 +62,18 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { equal to these accepted by KexiDB::Field ctor. The column will be the owner of this automatically generated field. */ - KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, + KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, uint cconst = KexiDB::Field::NoConstraints, uint options = KexiDB::Field::NoOptions, uint length=0, uint precision=0, - QVariant defaultValue=QVariant(), - const QString& caption = QString::null, - const QString& description = QString::null, + TQVariant defaultValue=TQVariant(), + const TQString& caption = TQString(), + const TQString& description = TQString(), uint width = 0); /*! Not db-aware, convenience ctor, simplified version of the above. */ - KexiTableViewColumn(const QString& name, KexiDB::Field::Type ctype, const QString& caption, - const QString& description = QString::null); + KexiTableViewColumn(const TQString& name, KexiDB::Field::Type ctype, const TQString& caption, + const TQString& description = TQString()); //! Db-aware version. KexiTableViewColumn(const KexiDB::QuerySchema &query, KexiDB::QueryColumnInfo& aColumnInfo, @@ -81,11 +81,11 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { virtual ~KexiTableViewColumn(); - virtual bool acceptsFirstChar(const QChar& ch) const; + virtual bool acceptsFirstChar(const TQChar& ch) const; /*! \return true if the column is read-only For db-aware column this can depend on whether the column - is in parent table of this query. \sa setReadOnly() */ + is in tqparent table of this query. \sa setReadOnly() */ bool isReadOnly() const; //TODO: synchronize this with table view: @@ -103,10 +103,10 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { } /*! Sets icon for displaying in the caption area (header). */ - void setIcon(const QIconSet& icon) { m_icon = icon; } + void setIcon(const TQIconSet& icon) { m_icon = icon; } /*! \return bame of icon displayed in the caption area (header). */ - QIconSet icon() const { return m_icon; } + TQIconSet icon() const { return m_icon; } /*! If \a visible is true, caption has to be displayed in the column's header, (or field's name if caption is empty. True by default. */ @@ -120,10 +120,10 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { - field's caption - or field's alias (from query) - or finally - field's name */ - inline QString captionAliasOrName() const { return m_captionAliasOrName; } + inline TQString captionAliasOrName() const { return m_captionAliasOrName; } /*! Assigns validator \a v for this column. - If the validator has no parent object, it will be owned by the column, + If the validator has no tqparent object, it will be owned by the column, so you shouldn't care about destroying it. */ void setValidator( KexiUtils::Validator* v ); @@ -150,7 +150,7 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { /*! Only usable if related data is set (ie. this is for combo boxes). Sets 'editable' flag for this column, what means a new value can be entered - by hand. This is similar to QComboBox::setEditable(). */ + by hand. This is similar to TQComboBox::setEditable(). */ void setRelatedDataEditable(bool set); /*! Only usable if related data is set (ie. this is for combo boxes). @@ -171,14 +171,14 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { bool isDBAware : 1; //!< true if data is stored in DB, not only in memeory -/* QString caption; +/* TQString caption; int type; //!< one of KexiDB::Field::Type uint width; */ // bool isNull() const; -/* virtual QString caption() const; - virtual void setCaption(const QString& c); +/* virtual TQString caption() const; + virtual void setCaption(const TQString& c); */ protected: //! special ctor that do not allocate d member; @@ -186,9 +186,9 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { void init(); - QString m_captionAliasOrName; + TQString m_captionAliasOrName; - QIconSet m_icon; + TQIconSet m_icon; KexiUtils::Validator* m_validator; @@ -211,20 +211,21 @@ class KEXIDATATABLE_EXPORT KexiTableViewColumn { /*! List of column definitions. */ -//typedef QValueVector<KexiTableViewColumn> KexiTableViewColumnList; +//typedef TQValueVector<KexiTableViewColumn> KexiTableViewColumnList; -typedef QPtrList<KexiTableItem> KexiTableViewDataBase; +typedef TQPtrList<KexiTableItem> KexiTableViewDataBase; -/*! Reimplements QPtrList to allow configurable sorting and more. +/*! Reimplements TQPtrList to allow configurable sorting and more. Original author: Till Busch. Reimplemented by Jaroslaw Staniek. */ -class KEXIDATATABLE_EXPORT KexiTableViewData : public QObject, protected KexiTableViewDataBase +class KEXIDATATABLE_EXPORT KexiTableViewData : public TQObject, protected KexiTableViewDataBase { Q_OBJECT + TQ_OBJECT public: - typedef QPtrListIterator<KexiTableItem> Iterator; + typedef TQPtrListIterator<KexiTableItem> Iterator; //! not db-aware version KexiTableViewData(); @@ -242,7 +243,7 @@ public: @param valueType a type for values */ KexiTableViewData( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType = KexiDB::Field::Text, KexiDB::Field::Type valueType = KexiDB::Field::Text); @@ -284,8 +285,8 @@ public: inline bool isDBAware() { return m_cursor; } /*! For db-aware data set only: table name is returned; - equivalent to cursor()->query()->parentTable()->name(). */ - QString dbTableName() const; + equivalent to cursor()->query()->tqparentTable()->name(). */ + TQString dbTableName() const; inline KexiDB::Cursor* cursor() const { return m_cursor; } @@ -333,21 +334,21 @@ public: Note that \a newval may be changed in aboutToChangeCell() signal handler. \sa KexiDB::RowEditBuffer */ bool updateRowEditBufferRef(KexiTableItem *item, - int colnum, KexiTableViewColumn* col, QVariant& newval, bool allowSignals = true, - QVariant *visibleValueForLookupField = 0); + int colnum, KexiTableViewColumn* col, TQVariant& newval, bool allowSignals = true, + TQVariant *visibleValueForLookupField = 0); /*! Added for convenience. Like above but \a newval is passed by value. */ inline bool updateRowEditBuffer(KexiTableItem *item, int colnum, KexiTableViewColumn* col, - QVariant newval, bool allowSignals = true) + TQVariant newval, bool allowSignals = true) { - QVariant newv(newval); + TQVariant newv(newval); return updateRowEditBufferRef(item, colnum, col, newv, allowSignals); } /*! Added for convenience. Like above but it's assumed that \a item item's columns are ordered like in table view, not like in form view. Don't use this with form views. */ inline bool updateRowEditBuffer(KexiTableItem *item, int colnum, - QVariant newval, bool allowSignals = true) + TQVariant newval, bool allowSignals = true) { KexiTableViewColumn* col = columns.at(colnum); return col ? updateRowEditBufferRef(item, colnum, col, newval, allowSignals) : false; @@ -358,27 +359,27 @@ public: /*! \return last operation's result information (always not null). */ inline KexiDB::ResultInfo* result() { return &m_result; } - bool saveRowChanges(KexiTableItem& item, bool repaint = false); + bool saveRowChanges(KexiTableItem& item, bool tqrepaint = false); - bool saveNewRow(KexiTableItem& item, bool repaint = false); + bool saveNewRow(KexiTableItem& item, bool tqrepaint = false); - bool deleteRow(KexiTableItem& item, bool repaint = false); + bool deleteRow(KexiTableItem& item, bool tqrepaint = false); /*! Deletes rows (by number) passed with \a rowsToDelete. Currently, this method is only for non data-aware tables. */ - void deleteRows( const QValueList<int> &rowsToDelete, bool repaint = false ); + void deleteRows( const TQValueList<int> &rowsToDelete, bool tqrepaint = false ); /*! Deletes all rows. Works either for db-aware and non db-aware tables. Column's definition is not changed. For db-aware version, all rows are removed from a database. Row-edit buffer is cleared. - If \a repaint is true, reloadRequested() signal + If \a tqrepaint is true, reloadRequested() signal is emitted after deleting (if at least one row was deleted), - so presenters can repaint their contents. + so presenters can tqrepaint their contents. \return true on success. */ - virtual bool deleteAllRows(bool repaint = false); + virtual bool deleteAllRows(bool tqrepaint = false); /*! @internal method, used mostly by specialized classes like KexiTableView. Clears internal row structures. Row-edit buffer is cleared. @@ -389,7 +390,7 @@ public: /*! Inserts new \a item at index \a index. \a item will be owned by this data object. Note: Reasonable only for not not-db-aware version. */ - void insertRow(KexiTableItem& item, uint index, bool repaint = false); + void insertRow(KexiTableItem& item, uint index, bool tqrepaint = false); /*TODO: add this as well? void insertRow(KexiTableItem& item, KexiTableItem& aboveItem); */ @@ -407,7 +408,7 @@ public: inline bool isEmpty () const { return KexiTableViewDataBase::isEmpty(); } inline KexiTableItem* first() { return KexiTableViewDataBase::first(); } inline KexiTableItem* last() { return KexiTableViewDataBase::last(); } - inline int findRef( const KexiTableItem* item ) { return KexiTableViewDataBase::findRef(item); } + inline int tqfindRef( const KexiTableItem* item ) { return KexiTableViewDataBase::tqfindRef(item); } inline void sort() { KexiTableViewDataBase::sort(); } inline bool removeFirst() { return KexiTableViewDataBase::removeFirst(); } inline bool removeLast() { return KexiTableViewDataBase::removeLast(); } @@ -428,7 +429,7 @@ public: { return new KexiTableItem(m_itemSize); } public slots: - //! @internal The same as QObject::deleteLater() but also sets smart pointer m_cursor to 0 to avoid crashes... + //! @internal The same as TQObject::deleteLater() but also sets smart pointer m_cursor to 0 to avoid crashes... void deleteLater(); signals: @@ -438,13 +439,13 @@ signals: Connect this signal to your slot and set \a result->success to false to disallow this change. You can also change \a newValue to other value, or change other columns in \a item row. */ - void aboutToChangeCell(KexiTableItem *item, int colnum, QVariant& newValue, + void aboutToChangeCell(KexiTableItem *item, int colnum, TQVariant& newValue, KexiDB::ResultInfo* result); /*! Emited before inserting of a new, current row. Connect this signal to your slot and set \a result->success to false to disallow this inserting. You can also change columns in \a item row. */ - void aboutToInsertRow(KexiTableItem *item, KexiDB::ResultInfo* result, bool repaint); + void aboutToInsertRow(KexiTableItem *item, KexiDB::ResultInfo* result, bool tqrepaint); /*! Emited before changing of an edited, current row. Connect this signal to your slot and set \a result->success to false @@ -454,21 +455,21 @@ signals: void rowUpdated(KexiTableItem*); //!< Current row has been updated - void rowInserted(KexiTableItem*, bool repaint); //!< A row has been inserted + void rowInserted(KexiTableItem*, bool tqrepaint); //!< A row has been inserted //! A row has been inserted at \a index position (not db-aware data only) - void rowInserted(KexiTableItem*, uint index, bool repaint); + void rowInserted(KexiTableItem*, uint index, bool tqrepaint); /*! Emited before deleting of a current row. Connect this signal to your slot and set \a result->success to false to disallow this deleting. */ - void aboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool repaint); + void aboutToDeleteRow(KexiTableItem& item, KexiDB::ResultInfo* result, bool tqrepaint); //! Current row has been deleted void rowDeleted(); //! Rows have been deleted - void rowsDeleted( const QValueList<int> &rowsToDelete ); + void rowsDeleted( const TQValueList<int> &rowsToDelete ); //! Displayed data needs to be reloaded in all presenters. void reloadRequested(); @@ -478,7 +479,7 @@ signals: protected: void init(); void init( - const QValueList<QVariant> &keys, const QValueList<QVariant> &values, + const TQValueList<TQVariant> &keys, const TQValueList<TQVariant> &values, KexiDB::Field::Type keyType, KexiDB::Field::Type valueType); virtual int compareItems(Item item1, Item item2); @@ -492,11 +493,11 @@ protected: int cmpDateTime(Item item1, Item item2); int cmpTime(Item item1, Item item2); - //! Compare function for BLOB data (QByteArray). Uses size as the weight. + //! Compare function for BLOB data (TQByteArray). Uses size as the weight. int cmpBLOB(Item item1, Item item2); //! internal: for saveRowChanges() and saveNewRow() - bool saveRow(KexiTableItem& item, bool insert, bool repaint); + bool saveRow(KexiTableItem& item, bool insert, bool tqrepaint); //! (logical) sorted column number, set by setSorting() //! can differ from m_realSortedColumn if there's lookup column used @@ -508,15 +509,15 @@ protected: int m_itemSize; static unsigned short charTable[]; KexiDB::RowEditBuffer *m_pRowEditBuffer; - QGuardedPtr<KexiDB::Cursor> m_cursor; + TQGuardedPtr<KexiDB::Cursor> m_cursor; //! used to faster lookup columns of simple type (not dbaware) -// QDict<KexiTableViewColumn> *m_simpleColumnsByName; +// TQDict<KexiTableViewColumn> *m_simpleColumnsByName; KexiDB::ResultInfo m_result; uint m_visibleColumnsCount; - QValueVector<int> m_visibleColumnsIDs, m_globalColumnsIDs; + TQValueVector<int> m_visibleColumnsIDs, m_globalColumnsIDs; bool m_readOnly : 1; bool m_insertingEnabled : 1; @@ -534,7 +535,7 @@ protected: //! Temporary, used in compare functions like cmpInt(), cmpString() //! to avoid memory allocations. - QVariant m_leftTmp, m_rightTmp; + TQVariant m_leftTmp, m_rightTmp; }; #endif |