diff options
Diffstat (limited to 'kexi/formeditor/utils.h')
-rw-r--r-- | kexi/formeditor/utils.h | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/kexi/formeditor/utils.h b/kexi/formeditor/utils.h index d5384e45..30bbfdf3 100644 --- a/kexi/formeditor/utils.h +++ b/kexi/formeditor/utils.h @@ -21,30 +21,30 @@ #ifndef FORMEDITORUTILS_H #define FORMEDITORUTILS_H -#include <qptrlist.h> -#include <qtabbar.h> -#include <qtabwidget.h> +#include <tqptrlist.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> -//! @todo replace QTabWidget by KTabWidget after the bug with & is fixed: -#define TabWidgetBase QTabWidget +//! @todo replace TQTabWidget by KTabWidget after the bug with & is fixed: +#define TabWidgetBase TQTabWidget //#define USE_KTabWidget //todo: uncomment namespace KFormDesigner { class Form; -/*! \return parent object of \a o that inherits \a className or NULL if no such parent - If the parent is found, \a prevPrev is set to a child of child of the parent, +/*! \return tqparent object of \a o that inherits \a className or NULL if no such tqparent + If the tqparent is found, \a prevPrev is set to a child of child of the tqparent, what for TabWidget means the page widget. */ template<class type> -type* findParent(QObject* o, const char* className, QObject* &prevPrev) +type* findParent(TQT_BASE_OBJECT_NAME* o, const char* className, TQObject* &prevPrev) { if (!o || !className || className[0]=='\0') return 0; - QObject *prev = o; - while ( ((o=o->parent())) && !o->inherits(className) ) { + TQObject *prev = TQT_TQOBJECT(o); + while ( ((o=TQT_TQOBJECT(o)->tqparent())) && !TQT_TQOBJECT(o)->inherits(className) ) { prevPrev = prev; - prev = o; + prev = TQT_TQOBJECT(o); } return static_cast<type*>(o); } @@ -53,39 +53,40 @@ type* findParent(QObject* o, const char* className, QObject* &prevPrev) class KFORMEDITOR_EXPORT TabWidget : public TabWidgetBase { Q_OBJECT + TQ_OBJECT public: - TabWidget(QWidget *parent, const char *name) - : TabWidgetBase(parent, name) {} + TabWidget(TQWidget *tqparent, const char *name) + : TabWidgetBase(tqparent, name) {} virtual ~TabWidget() {} int tabBarHeight() const { return tabBar()->height(); } }; //! @short A list of widget pointers. -typedef QPtrList<QWidget> WidgetList; +typedef TQPtrList<TQWidget> WidgetList; //! @short An iterator for WidgetList. -typedef QPtrListIterator<QWidget> WidgetListIterator; +typedef TQPtrListIterator<TQWidget> WidgetListIterator; //! @short A helper for sorting widgets horizontally class HorWidgetList : public WidgetList { public: - HorWidgetList(QWidget *topLevelWidget); + HorWidgetList(TQWidget *tqtopLevelWidget); virtual ~HorWidgetList(); protected: - virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); - QWidget *m_topLevelWidget; + virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); + TQWidget *m_tqtopLevelWidget; }; //! @short A helper for sorting widgets vertically class VerWidgetList : public WidgetList { public: - VerWidgetList(QWidget *topLevelWidget); + VerWidgetList(TQWidget *tqtopLevelWidget); virtual ~VerWidgetList(); protected: - virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); - QWidget *m_topLevelWidget; + virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); + TQWidget *m_tqtopLevelWidget; }; /*! This function is used to remove all the child widgets from a list, and @@ -93,19 +94,19 @@ class VerWidgetList : public WidgetList KFORMEDITOR_EXPORT void removeChildrenFromList(WidgetList &list); /*! This helper function install an event filter on \a object and all of its - children, directed to \a container. + tqchildren, directed to \a container. This is necessary to filter events for composed widgets. */ -KFORMEDITOR_EXPORT void installRecursiveEventFilter(QObject *object, QObject *container); +KFORMEDITOR_EXPORT void installRecursiveEventFilter(TQObject *object, TQObject *container); /*! This helper function removes an event filter installed before - on \a object and all of its children. + on \a object and all of its tqchildren. This is necessary to filter events for composed widgets. */ -KFORMEDITOR_EXPORT void removeRecursiveEventFilter(QObject *object, QObject *container); +KFORMEDITOR_EXPORT void removeRecursiveEventFilter(TQObject *object, TQObject *container); -KFORMEDITOR_EXPORT void setRecursiveCursor(QWidget *w, Form *form); +KFORMEDITOR_EXPORT void setRecursiveCursor(TQWidget *w, Form *form); -/*! \return the size of \a w children. This can be used eg to get widget's sizeHint. */ -KFORMEDITOR_EXPORT QSize getSizeFromChildren(QWidget *widget, const char *inheritClass="QWidget"); +/*! \return the size of \a w tqchildren. This can be used eg to get widget's tqsizeHint. */ +KFORMEDITOR_EXPORT TQSize getSizeFromChildren(TQWidget *widget, const char *inheritClass=TQWIDGET_OBJECT_NAME_STRING); } |