summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/container.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/formeditor/container.h
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/formeditor/container.h')
-rw-r--r--kexi/formeditor/container.h120
1 files changed, 61 insertions, 59 deletions
diff --git a/kexi/formeditor/container.h b/kexi/formeditor/container.h
index b7036aa7..a76c913a 100644
--- a/kexi/formeditor/container.h
+++ b/kexi/formeditor/container.h
@@ -21,16 +21,16 @@
#ifndef FORMEDITORCONTAINER_H
#define FORMEDITORCONTAINER_H
-#include <qobject.h>
-#include <qguardedptr.h>
-#include <qptrlist.h>
-#include <qwidget.h>
+#include <tqobject.h>
+#include <tqguardedptr.h>
+#include <tqptrlist.h>
+#include <tqwidget.h>
#include "utils.h"
-class QEvent;
-class QWidget;
-class QLayout;
+class TQEvent;
+class TQWidget;
+class TQLayout;
namespace KFormDesigner {
@@ -44,42 +44,44 @@ class Form;
* and direct it to the Container.
*/
//! A class for redirecting events
-class KFORMEDITOR_EXPORT EventEater : public QObject
+class KFORMEDITOR_EXPORT EventEater : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/*! Constructs eater object. All events for \a widget and it's subwidgets
- will be redirected to \a container. \a container will be also parent of eater object,
+ will be redirected to \a container. \a container will be also tqparent of eater object,
so you don't need to care about deleting it. */
- EventEater(QWidget *widget, QObject *container);
+ EventEater(TQWidget *widget, TQObject *container);
~EventEater();
//! Sets the object which will receive the events
- void setContainer(QObject *container) { m_container = container; }
- bool eventFilter(QObject *o, QEvent *ev);
+ void setContainer(TQObject *container) { m_container = container; }
+ bool eventFilter(TQObject *o, TQEvent *ev);
private:
- QGuardedPtr<QWidget> m_widget;
- QGuardedPtr<QObject> m_container;
+ TQGuardedPtr<TQWidget> m_widget;
+ TQGuardedPtr<TQObject> m_container;
};
/**
- * This class makes a container out of any QWidget. You can then create child widgets, and
+ * This class makes a container out of any TQWidget. You can then create child widgets, and
the background is dotted.
*/
//! A class to make a container from any widget
-class KFORMEDITOR_EXPORT Container : public QObject
+class KFORMEDITOR_EXPORT Container : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
enum LayoutType { NoLayout=0, HBox, VBox, Grid, HFlow, VFlow, /* special types */ HSplitter, VSplitter };
/**
* Creates a Container from the widget \a container, which have
- \a toplevel as parent Container. */
- Container(Container *toplevel, QWidget *container, QObject *parent=0, const char *name=0);
+ \a toplevel as tqparent Container. */
+ Container(Container *toplevel, TQWidget *container, TQObject *tqparent=0, const char *name=0);
virtual ~Container();
//! \return a pointer to the toplevel Container, or 0 if this Container is toplevel
@@ -89,7 +91,7 @@ class KFORMEDITOR_EXPORT Container : public QObject
Form* form() const { return m_form; }
//! \return The watched widget.
- QWidget* widget() const { return m_container; }
+ TQWidget* widget() const { return m_container; }
//! \return The ObjectTreeItem associated with this Container's widget.
ObjectTreeItem* objectTree() const { return m_tree; }
@@ -101,20 +103,20 @@ class KFORMEDITOR_EXPORT Container : public QObject
* NOTE: this is needed only if we are toplevel. */
void setObjectTree(ObjectTreeItem *t) { m_tree = t; }
- //! \return a pointer to the QLayout of this Container, or 0 if there is not.
- QLayout* layout() const { return m_layout; }
+ //! \return a pointer to the TQLayout of this Container, or 0 if there is not.
+ TQLayout* tqlayout() const { return m_layout; }
- //! \return the type of the layout associated to this Container's widget (see LayoutType enum).
- LayoutType layoutType() const { return m_layType; }
+ //! \return the type of the tqlayout associated to this Container's widget (see LayoutType enum).
+ LayoutType tqlayoutType() const { return m_layType; }
//! \return the margin of this Container.
- int layoutMargin() { return m_margin; }
+ int tqlayoutMargin() { return m_margin; }
//! \return the spacing of this Container.
- int layoutSpacing() { return m_spacing; }
+ int tqlayoutSpacing() { return m_spacing; }
- /*! Sets this Container to use \a type of layout. The widget are inserted
- automatically in the layout following their positions.
+ /*! Sets this Container to use \a type of tqlayout. The widget are inserted
+ automatically in the tqlayout following their positions.
\sa createBoxLayout(), createGridLayout() */
void setLayout(LayoutType type);
@@ -124,11 +126,11 @@ class KFORMEDITOR_EXPORT Container : public QObject
//! Sets the margin of this Container.
void setLayoutMargin(int margin) { m_margin = margin;}
- //! \return the string representing the layoutType \a type.
- static QString layoutTypeToString(int type);
+ //! \return the string representing the tqlayoutType \a type.
+ static TQString tqlayoutTypeToString(int type);
- //! \return the LayoutType (an int) for a given layout name.
- static LayoutType stringToLayoutType(const QString &name);
+ //! \return the LayoutType (an int) for a given tqlayout name.
+ static LayoutType stringToLayoutType(const TQString &name);
/*! Stops the inline editing of the current widget (as when you click
on another widget or press Esc). */
@@ -138,29 +140,29 @@ class KFORMEDITOR_EXPORT Container : public QObject
to the watched widget.\n It takes care of drawing the background and
the insert rect, of creating the new child widgets, of moving the widgets
and pop up a menu when right-clicking. */
- virtual bool eventFilter(QObject *o, QEvent *e);
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
public slots:
/*! Sets \a selected to be the selected widget of this container
(and so of the Form). If \a add is true, the formerly selected widget
is still selected, and the new one is just added. If false, \a selected
replace the actually selected widget. If \a dontRaise is true, then
- the widget \a selected (and its parent) won't be raised (eg when you
+ the widget \a selected (and its tqparent) won't be raised (eg when you
select widget in ObjectTreeView).
\sa Form::setSelectedWidget() */
- void setSelectedWidget(QWidget *selected, bool add, bool dontRaise=false,
+ void setSelectedWidget(TQWidget *selected, bool add, bool dontRaise=false,
bool moreWillBeSelected = false);
/*! Unselects the widget \a w. The widget is removed from the Form's list
and its resizeHandles are removed. */
- void unSelectWidget(QWidget *w);
+ void unSelectWidget(TQWidget *w);
/*! Deletes the widget \a w. Removes it from ObjectTree, and sets selection
to Container's widget. */
- void deleteWidget(QWidget *w);
+ void deleteWidget(TQWidget *w);
- /*! Recreates the Container layout. Calls this when a widget has been moved
- or added to update the layout. */
+ /*! Recreates the Container tqlayout. Calls this when a widget has been moved
+ or added to update the tqlayout. */
void reloadLayout();
protected slots:
@@ -169,55 +171,55 @@ class KFORMEDITOR_EXPORT Container : public QObject
protected:
/*! Internal function to create a HBoxLayout or VBoxLayout for this container.
- \a list is a subclass of QObjectList that can sort widgets
+ \a list is a subclass of TQObjectList that can sort widgets
following their position (such as HorWidgetList or VerWidgetList). */
void createBoxLayout(WidgetList *list);
/*! Internal function to create a KexiFlowLayout. */
void createFlowLayout();
- /*! Internal function to create a GridLayout. if \a testOnly is true, the layout
+ /*! Internal function to create a GridLayout. if \a testOnly is true, the tqlayout
is simulated, and only the widget's grid info aris filled. */
void createGridLayout(bool testOnly=false);
- void drawConnection(QMouseEvent *mev);
- void drawSelectionRect(QMouseEvent *mev);
- void drawInsertRect(QMouseEvent *mev, QObject *s);
- void drawCopiedWidgetRect(QMouseEvent *mev);
+ void drawConnection(TQMouseEvent *mev);
+ void drawSelectionRect(TQMouseEvent *mev);
+ void drawInsertRect(TQMouseEvent *mev, TQObject *s);
+ void drawCopiedWidgetRect(TQMouseEvent *mev);
- void moveSelectedWidgetsBy(int realdx, int realdy, QMouseEvent *mev=0);
+ void moveSelectedWidgetsBy(int realdx, int realdy, TQMouseEvent *mev=0);
private:
- bool handleMouseReleaseEvent(QObject *s, QMouseEvent *mev);
+ bool handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev);
// the watched container and it's toplevel one...
- QGuardedPtr<QWidget> m_container;
- QGuardedPtr<Container> m_toplevel;
+ TQGuardedPtr<TQWidget> m_container;
+ TQGuardedPtr<Container> m_toplevel;
int m_state;
enum { DoingNothing = 100, DrawingSelectionRect, CopyingWidget,
MovingWidget, InlineEditing };
// Layout
- QLayout *m_layout;
+ TQLayout *m_layout;
LayoutType m_layType;
int m_margin, m_spacing;
// moving etc.
- QPoint m_grab;
- //QPoint m_initialPos;
- QGuardedPtr<QWidget> m_moving;
- //QRect m_copyRect;
+ TQPoint m_grab;
+ //TQPoint m_initialPos;
+ TQGuardedPtr<TQWidget> m_moving;
+ //TQRect m_copyRect;
//inserting
- QPoint m_insertBegin;
- QRect m_insertRect;
+ TQPoint m_insertBegin;
+ TQRect m_insertRect;
ObjectTreeItem *m_tree;
- QGuardedPtr<Form> m_form;
+ TQGuardedPtr<Form> m_form;
bool m_mousePressEventReceived;
- QMouseEvent m_mouseReleaseEvent;
- QGuardedPtr<QObject> m_objectForMouseReleaseEvent;
+ TQMouseEvent m_mouseReleaseEvent;
+ TQGuardedPtr<TQObject> m_objectForMouseReleaseEvent;
friend class InsertWidgetCommand;
friend class PasteWidgetCommand;
@@ -234,7 +236,7 @@ class KFORMEDITOR_EXPORT DesignTimeDynamicChildWidgetHandler
~DesignTimeDynamicChildWidgetHandler();
protected:
- void childWidgetAdded(QWidget* w);
+ void childWidgetAdded(TQWidget* w);
void assignItem(ObjectTreeItem* item) { m_item = item; }
private: