summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/factories/containerfactory.cpp
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/factories/containerfactory.cpp
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/factories/containerfactory.cpp')
-rw-r--r--kexi/formeditor/factories/containerfactory.cpp418
1 files changed, 209 insertions, 209 deletions
diff --git a/kexi/formeditor/factories/containerfactory.cpp b/kexi/formeditor/factories/containerfactory.cpp
index d098c290..ada3f994 100644
--- a/kexi/formeditor/factories/containerfactory.cpp
+++ b/kexi/formeditor/factories/containerfactory.cpp
@@ -19,24 +19,24 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qwidgetstack.h>
-#include <qframe.h>
-#include <qbuttongroup.h>
-#include <qwidget.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qstring.h>
-#include <qpopupmenu.h>
-#include <qdom.h>
-#include <qevent.h>
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qvaluevector.h>
-#include <qfileinfo.h>
-#include <qscrollview.h>
-#include <qtabbar.h>
-#include <qsplitter.h>
-#include <qlayout.h>
+#include <tqwidgetstack.h>
+#include <tqframe.h>
+#include <tqbuttongroup.h>
+#include <tqwidget.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqstring.h>
+#include <tqpopupmenu.h>
+#include <tqdom.h>
+#include <tqevent.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqvaluevector.h>
+#include <tqfileinfo.h>
+#include <tqscrollview.h>
+#include <tqtabbar.h>
+#include <tqsplitter.h>
+#include <tqlayout.h>
#include <kiconloader.h>
#include <kgenericfactory.h>
@@ -57,15 +57,15 @@
#include <formeditor/utils.h>
#if KDE_VERSION < KDE_MAKE_VERSION(3,1,9)
-# define KInputDialog QInputDialog
-# include <qinputdialog.h>
-# include <qlineedit.h>
+# define KInputDialog TQInputDialog
+# include <tqinputdialog.h>
+# include <tqlineedit.h>
#else
# include <kinputdialog.h>
#endif
-ContainerWidget::ContainerWidget(QWidget *parent, const char *name)
- : QWidget(parent, name)
+ContainerWidget::ContainerWidget(TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name)
{
}
@@ -73,27 +73,27 @@ ContainerWidget::~ContainerWidget()
{
}
-QSize ContainerWidget::sizeHint() const
+TQSize ContainerWidget::tqsizeHint() const
{
- return QSize(30,30); //default
+ return TQSize(30,30); //default
}
-void ContainerWidget::dragMoveEvent( QDragMoveEvent *e )
+void ContainerWidget::dragMoveEvent( TQDragMoveEvent *e )
{
- QWidget::dragMoveEvent(e);
+ TQWidget::dragMoveEvent(e);
emit handleDragMoveEvent(e);
}
-void ContainerWidget::dropEvent( QDropEvent *e )
+void ContainerWidget::dropEvent( TQDropEvent *e )
{
- QWidget::dropEvent(e);
+ TQWidget::dropEvent(e);
emit handleDropEvent(e);
}
////////////////////////
-GroupBox::GroupBox(const QString & title, QWidget *parent, const char *name)
- : QGroupBox(title, parent, name)
+GroupBox::GroupBox(const TQString & title, TQWidget *tqparent, const char *name)
+ : TQGroupBox(title, tqparent, name)
{
}
@@ -101,22 +101,22 @@ GroupBox::~GroupBox()
{
}
-void GroupBox::dragMoveEvent( QDragMoveEvent *e )
+void GroupBox::dragMoveEvent( TQDragMoveEvent *e )
{
- QGroupBox::dragMoveEvent(e);
+ TQGroupBox::dragMoveEvent(e);
emit handleDragMoveEvent(e);
}
-void GroupBox::dropEvent( QDropEvent *e )
+void GroupBox::dropEvent( TQDropEvent *e )
{
- QGroupBox::dropEvent(e);
+ TQGroupBox::dropEvent(e);
emit handleDropEvent(e);
}
////////////////////////
-KFDTabWidget::KFDTabWidget(QWidget *parent, const char *name)
- : KFormDesigner::TabWidget(parent, name)
+KFDTabWidget::KFDTabWidget(TQWidget *tqparent, const char *name)
+ : KFormDesigner::TabWidget(tqparent, name)
{
}
@@ -124,17 +124,17 @@ KFDTabWidget::~KFDTabWidget()
{
}
-QSize
-KFDTabWidget::sizeHint() const
+TQSize
+KFDTabWidget::tqsizeHint() const
{
- QSize s(30,30); // default min size
+ TQSize s(30,30); // default min size
for(int i=0; i < count(); i++)
s = s.expandedTo( KFormDesigner::getSizeFromChildren(page(i)) );
- return s + QSize(10/*margin*/, tabBar()->height() + 20/*margin*/);
+ return s + TQSize(10/*margin*/, tabBar()->height() + 20/*margin*/);
}
-void KFDTabWidget::dragMoveEvent( QDragMoveEvent *e )
+void KFDTabWidget::dragMoveEvent( TQDragMoveEvent *e )
{
TabWidgetBase::dragMoveEvent( e );
if (dynamic_cast<ContainerWidget*>(currentPage()))
@@ -142,7 +142,7 @@ void KFDTabWidget::dragMoveEvent( QDragMoveEvent *e )
emit handleDragMoveEvent(e);
}
-void KFDTabWidget::dropEvent( QDropEvent *e )
+void KFDTabWidget::dropEvent( TQDropEvent *e )
{
TabWidgetBase::dropEvent( e );
if (dynamic_cast<ContainerWidget*>(currentPage()))
@@ -150,90 +150,90 @@ void KFDTabWidget::dropEvent( QDropEvent *e )
emit handleDropEvent(e);
}
-/// Various layout widgets /////////////////:
+/// Various tqlayout widgets /////////////////:
-HBox::HBox(QWidget *parent, const char *name)
- : QFrame(parent, name), m_preview(false)
+HBox::HBox(TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name), m_preview(false)
{}
void
-HBox::paintEvent(QPaintEvent *)
+HBox::paintEvent(TQPaintEvent *)
{
if(m_preview) return;
- QPainter p(this);
- p.setPen(QPen(red, 2, Qt::DashLine));
+ TQPainter p(this);
+ p.setPen(TQPen(red, 2, TQt::DashLine));
p.drawRect(1, 1, width()-1, height() - 1);
}
-VBox::VBox(QWidget *parent, const char *name)
- : QFrame(parent, name), m_preview(false)
+VBox::VBox(TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name), m_preview(false)
{}
void
-VBox::paintEvent(QPaintEvent *)
+VBox::paintEvent(TQPaintEvent *)
{
if(m_preview) return;
- QPainter p(this);
- p.setPen(QPen(blue, 2, Qt::DashLine));
+ TQPainter p(this);
+ p.setPen(TQPen(blue, 2, TQt::DashLine));
p.drawRect(1, 1, width()-1, height() - 1);
}
-Grid::Grid(QWidget *parent, const char *name)
- : QFrame(parent, name), m_preview(false)
+Grid::Grid(TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name), m_preview(false)
{}
void
-Grid::paintEvent(QPaintEvent *)
+Grid::paintEvent(TQPaintEvent *)
{
if(m_preview) return;
- QPainter p(this);
- p.setPen(QPen(darkGreen, 2, Qt::DashLine));
+ TQPainter p(this);
+ p.setPen(TQPen(darkGreen, 2, TQt::DashLine));
p.drawRect(1, 1, width()-1, height() - 1);
}
-HFlow::HFlow(QWidget *parent, const char *name)
- : QFrame(parent, name), m_preview(false)
+HFlow::HFlow(TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name), m_preview(false)
{}
void
-HFlow::paintEvent(QPaintEvent *)
+HFlow::paintEvent(TQPaintEvent *)
{
if(m_preview) return;
- QPainter p(this);
- p.setPen(QPen(magenta, 2, Qt::DashLine));
+ TQPainter p(this);
+ p.setPen(TQPen(magenta, 2, TQt::DashLine));
p.drawRect(1, 1, width()-1, height() - 1);
}
-VFlow::VFlow(QWidget *parent, const char *name)
- : QFrame(parent, name), m_preview(false)
+VFlow::VFlow(TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name), m_preview(false)
{}
void
-VFlow::paintEvent(QPaintEvent *)
+VFlow::paintEvent(TQPaintEvent *)
{
if(m_preview) return;
- QPainter p(this);
- p.setPen(QPen(cyan, 2, Qt::DashLine));
+ TQPainter p(this);
+ p.setPen(TQPen(cyan, 2, TQt::DashLine));
p.drawRect(1, 1, width()-1, height() - 1);
}
-QSize
-VFlow::sizeHint() const
+TQSize
+VFlow::tqsizeHint() const
{
- if(layout())
- return layout()->sizeHint();
+ if(tqlayout())
+ return tqlayout()->tqsizeHint();
else
- return QSize(700, 50); // default
+ return TQSize(700, 50); // default
}
/////// Tab related KCommand (to allow tab creation/deletion undoing)
-InsertPageCommand::InsertPageCommand(KFormDesigner::Container *container, QWidget *parent)
+InsertPageCommand::InsertPageCommand(KFormDesigner::Container *container, TQWidget *tqparent)
: KCommand()
{
m_containername = container->widget()->name();
m_form = container->form();
- m_parentname = parent->name();
+ m_parentname = tqparent->name();
m_pageid = -1;
}
@@ -241,31 +241,31 @@ void
InsertPageCommand::execute()
{
KFormDesigner::Container *container = m_form->objectTree()->lookup(m_containername)->container();
- QWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget();
+ TQWidget *tqparent = m_form->objectTree()->lookup(m_parentname)->widget();
if(m_name.isEmpty()) {
m_name = container->form()->objectTree()->generateUniqueName(
- container->form()->library()->displayName("QWidget").latin1(),
+ container->form()->library()->displayName(TQWIDGET_OBJECT_NAME_STRING).latin1(),
/*!numberSuffixRequired*/false);
}
- QWidget *page = container->form()->library()->createWidget("QWidget", parent, m_name.latin1(), container);
-// QWidget *page = new ContainerWidget(parent, m_name.latin1());
-// new KFormDesigner::Container(container, page, parent);
+ TQWidget *page = container->form()->library()->createWidget(TQWIDGET_OBJECT_NAME_STRING, tqparent, m_name.latin1(), container);
+// TQWidget *page = new ContainerWidget(tqparent, m_name.latin1());
+// new KFormDesigner::Container(container, page, tqparent);
- QCString classname = parent->className();
+ TQCString classname = tqparent->className();
if(classname == "KFDTabWidget")
{
- TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent);
- QString n = i18n("Page %1").arg(tab->count() + 1);
+ TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(tqparent);
+ TQString n = i18n("Page %1").tqarg(tab->count() + 1);
tab->addTab(page, n);
tab->showPage(page);
KFormDesigner::ObjectTreeItem *item = container->form()->objectTree()->lookup(m_name);
item->addModifiedProperty("title", n);
}
- else if(classname == "QWidgetStack")
+ else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING)
{
- QWidgetStack *stack = (QWidgetStack*)parent;
+ TQWidgetStack *stack = (TQWidgetStack*)tqparent;
stack->addWidget(page, m_pageid);
stack->raiseWidget(page);
m_pageid = stack->id(page);
@@ -278,22 +278,22 @@ InsertPageCommand::execute()
void
InsertPageCommand::unexecute()
{
- QWidget *page = m_form->objectTree()->lookup(m_name)->widget();
- QWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget();
+ TQWidget *page = m_form->objectTree()->lookup(m_name)->widget();
+ TQWidget *tqparent = m_form->objectTree()->lookup(m_parentname)->widget();
KFormDesigner::WidgetList list;
list.append(page);
KCommand *com = new KFormDesigner::DeleteWidgetCommand(list, m_form);
- QCString classname = parent->className();
+ TQCString classname = tqparent->className();
if(classname == "KFDTabWidget")
{
- TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent);
+ TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(tqparent);
tab->removePage(page);
}
- else if(classname == "QWidgetStack")
+ else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING)
{
- QWidgetStack *stack = (QWidgetStack*)parent;
+ TQWidgetStack *stack = (TQWidgetStack*)tqparent;
int id = stack->id(page) - 1;
while(!stack->widget(id))
id--;
@@ -306,7 +306,7 @@ InsertPageCommand::unexecute()
delete com;
}
-QString
+TQString
InsertPageCommand::name() const
{
return i18n("Add Page");
@@ -314,20 +314,20 @@ InsertPageCommand::name() const
/////// Sub forms ////////////////////////:
-SubForm::SubForm(QWidget *parent, const char *name)
-: QScrollView(parent, name), m_form(0), m_widget(0)
+SubForm::SubForm(TQWidget *tqparent, const char *name)
+: TQScrollView(tqparent, name), m_form(0), m_widget(0)
{
- setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
- viewport()->setPaletteBackgroundColor(colorGroup().mid());
+ setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
+ viewport()->setPaletteBackgroundColor(tqcolorGroup().mid());
}
void
-SubForm::setFormName(const QString &name)
+SubForm::setFormName(const TQString &name)
{
if(name.isEmpty())
return;
- QFileInfo info(name);
+ TQFileInfo info(name);
if(!info.exists()
|| (KFormDesigner::FormManager::self()->activeForm()
&& (info.fileName() == KFormDesigner::FormManager::self()->activeForm()->filename()) ) )
@@ -335,7 +335,7 @@ SubForm::setFormName(const QString &name)
// we create the container widget
delete m_widget;
- m_widget = new QWidget(viewport(), "subform_widget");
+ m_widget = new TQWidget(viewport(), "subform_widget");
// m_widget->show();
addChild(m_widget);
m_form = new KFormDesigner::Form(
@@ -352,12 +352,12 @@ SubForm::setFormName(const QString &name)
///// The factory /////////////////////////
-ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringList &)
- : KFormDesigner::WidgetFactory(parent, "containers")
+ContainerFactory::ContainerFactory(TQObject *tqparent, const char *, const TQStringList &)
+ : KFormDesigner::WidgetFactory(tqparent, "containers")
{
KFormDesigner::WidgetInfo *wBtnGroup = new KFormDesigner::WidgetInfo(this);
wBtnGroup->setPixmap("frame");
- wBtnGroup->setClassName("QButtonGroup");
+ wBtnGroup->setClassName(TQBUTTONGROUP_OBJECT_NAME_STRING);
wBtnGroup->setName(i18n("Button Group"));
wBtnGroup->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "buttonGroup"));
@@ -369,11 +369,11 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
wTabWidget->setClassName("KFDTabWidget");
#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9)
wTabWidget->addAlternateClassName("KTabWidget");
- wTabWidget->addAlternateClassName("QTabWidget");
-//tmp: wTabWidget->setSavingName("QTabWidget");
+ wTabWidget->addAlternateClassName(TQTABWIDGET_OBJECT_NAME_STRING);
+//tmp: wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING);
wTabWidget->setSavingName("KTabWidget");
#else
- wTabWidget->setSavingName("QTabWidget");
+ wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING);
#endif
wTabWidget->setIncludeFileName("ktabwidget.h");
wTabWidget->setName(i18n("Tab Widget"));
@@ -384,7 +384,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
KFormDesigner::WidgetInfo *wWidget = new KFormDesigner::WidgetInfo(this);
wWidget->setPixmap("frame");
- wWidget->setClassName("QWidget");
+ wWidget->setClassName(TQWIDGET_OBJECT_NAME_STRING);
wWidget->addAlternateClassName("ContainerWidget");
wWidget->setName(i18n("Basic container"));
wWidget->setNamePrefix(
@@ -394,7 +394,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
KFormDesigner::WidgetInfo *wGroupBox = new KFormDesigner::WidgetInfo(this);
wGroupBox->setPixmap("groupbox");
- wGroupBox->setClassName("QGroupBox");
+ wGroupBox->setClassName(TQGROUPBOX_OBJECT_NAME_STRING);
wGroupBox->addAlternateClassName("GroupBox");
wGroupBox->setName(i18n("Group Box"));
wGroupBox->setNamePrefix(
@@ -404,7 +404,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
KFormDesigner::WidgetInfo *wFrame = new KFormDesigner::WidgetInfo(this);
wFrame->setPixmap("frame");
- wFrame->setClassName("QFrame");
+ wFrame->setClassName(TQFRAME_OBJECT_NAME_STRING);
wFrame->setName(i18n("Frame"));
wFrame->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "frame"));
@@ -413,7 +413,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
KFormDesigner::WidgetInfo *wWidgetStack = new KFormDesigner::WidgetInfo(this);
wWidgetStack->setPixmap("widgetstack");
- wWidgetStack->setClassName("QWidgetStack");
+ wWidgetStack->setClassName(TQWIDGETSTACK_OBJECT_NAME_STRING);
wWidgetStack->setName(i18n("Widget Stack"));
wWidgetStack->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "widgetStack"));
@@ -451,11 +451,11 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
//! @todo horizontal/vertical splitter icons
wSplitter->setPixmap("frame");
wSplitter->setClassName("Splitter");
- wSplitter->addAlternateClassName("QSplitter");
+ wSplitter->addAlternateClassName(TQSPLITTER_OBJECT_NAME_STRING);
wSplitter->setName(i18n("Splitter"));
wSplitter->setNamePrefix(
i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "splitter"));
- wSplitter->setDescription(i18n("A container that enables user to resize its children"));
+ wSplitter->setDescription(i18n("A container that enables user to resize its tqchildren"));
addClass(wSplitter);
KFormDesigner::WidgetInfo *wHFlow = new KFormDesigner::WidgetInfo(this);
@@ -504,14 +504,14 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL
m_propValDesc["Triangular"] = i18n("for Tab Shape", "Triangular");
}
-QWidget*
-ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n,
+TQWidget*
+ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n,
KFormDesigner::Container *container, int options)
{
- if(c == "QButtonGroup")
+ if(c == TQBUTTONGROUP_OBJECT_NAME_STRING)
{
- QString text = container->form()->library()->textForWidgetName(n, c);
- QButtonGroup *w = new QButtonGroup(/*i18n("Button Group")*/text, p, n);
+ TQString text = container->form()->library()->textForWidgetName(n, c);
+ TQButtonGroup *w = new TQButtonGroup(/*i18n("Button Group")*/text, p, n);
new KFormDesigner::Container(container, w, container);
return w;
}
@@ -520,7 +520,7 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n,
KFDTabWidget *tab = new KFDTabWidget(p, n);
#if defined(USE_KTabWidget) && KDE_VERSION >= KDE_MAKE_VERSION(3,1,9)
tab->setTabReorderingEnabled(true);
- connect(tab, SIGNAL(movedTab(int,int)), this, SLOT(reorderTabs(int,int)));
+ connect(tab, TQT_SIGNAL(movedTab(int,int)), this, TQT_SLOT(reorderTabs(int,int)));
#endif
container->form()->objectTree()->addItem(container->objectTree(),
new KFormDesigner::ObjectTreeItem(
@@ -538,32 +538,32 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n,
return tab;
}
- else if(c == "QWidget" || c=="ContainerWidget")
+ else if(c == TQWIDGET_OBJECT_NAME_STRING || c=="ContainerWidget")
{
- QWidget *w = new ContainerWidget(p, n);
- new KFormDesigner::Container(container, w, p);
+ TQWidget *w = new ContainerWidget(p, n);
+ new KFormDesigner::Container(container, w, TQT_TQOBJECT(p));
return w;
}
- else if(c == "QGroupBox" || c == "GroupBox")
+ else if(c == TQGROUPBOX_OBJECT_NAME_STRING || c == "GroupBox")
{
- QString text = container->form()->library()->textForWidgetName(n, c);
- QGroupBox *w = new GroupBox(text, p, n);
+ TQString text = container->form()->library()->textForWidgetName(n, c);
+ TQGroupBox *w = new GroupBox(text, p, n);
new KFormDesigner::Container(container, w, container);
return w;
}
- else if(c == "QFrame")
+ else if(c == TQFRAME_OBJECT_NAME_STRING)
{
- QFrame *w = new QFrame(p, n);
+ TQFrame *w = new TQFrame(p, n);
w->setLineWidth(2);
- w->setFrameStyle(QFrame::StyledPanel|QFrame::Raised);
+ w->setFrameStyle(TQFrame::StyledPanel|TQFrame::Raised);
new KFormDesigner::Container(container, w, container);
return w;
}
- else if(c == "QWidgetStack")
+ else if(c == TQWIDGETSTACK_OBJECT_NAME_STRING)
{
- QWidgetStack *stack = new QWidgetStack(p, n);
+ TQWidgetStack *stack = new TQWidgetStack(p, n);
stack->setLineWidth(2);
- stack->setFrameStyle(QFrame::StyledPanel|QFrame::Raised);
+ stack->setFrameStyle(TQFrame::StyledPanel|TQFrame::Raised);
container->form()->objectTree()->addItem( container->objectTree(),
new KFormDesigner::ObjectTreeItem(
container->form()->library()->displayName(c), n, stack, container));
@@ -606,8 +606,8 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n,
SubForm *subform = new SubForm(p, n);
return subform;
}
- else if(c == "QSplitter") {
- QSplitter *split = new QSplitter(p, n);
+ else if(c == TQSPLITTER_OBJECT_NAME_STRING) {
+ TQSplitter *split = new TQSplitter(p, n);
if (0 == (options & WidgetFactory::AnyOrientation))
split->setOrientation(
(options & WidgetFactory::VerticalOrientation) ? Qt::Vertical : Qt::Horizontal);
@@ -619,14 +619,14 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n,
}
bool
-ContainerFactory::previewWidget(const QCString &classname, QWidget *widget, KFormDesigner::Container *container)
+ContainerFactory::previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *container)
{
if(classname == "WidgetStack")
{
- QWidgetStack *stack = ((QWidgetStack*)widget);
+ TQWidgetStack *stack = ((TQWidgetStack*)widget);
KFormDesigner::ObjectTreeItem *tree = container->form()->objectTree()->lookup(widget->name());
- if(!tree->modifiedProperties()->contains("frameShape"))
- stack->setFrameStyle(QFrame::NoFrame);
+ if(!tree->modifiedProperties()->tqcontains("frameShape"))
+ stack->setFrameStyle(TQFrame::NoFrame);
}
else if(classname == "HBox")
((HBox*)widget)->setPreviewMode();
@@ -644,53 +644,53 @@ ContainerFactory::previewWidget(const QCString &classname, QWidget *widget, KFor
}
bool
-ContainerFactory::createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu,
+ContainerFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu,
KFormDesigner::Container *container)
{
setWidget(w, container);
//m_widget = w;
// m_container = container;
- if((classname == "KFDTabWidget") || (w->parentWidget()->parentWidget()->inherits("QTabWidget")))
+ if((classname == "KFDTabWidget") || (w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
{
- if(w->parentWidget()->parentWidget()->inherits("QTabWidget"))
+ if(w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
{
- //m_widget = w->parentWidget()->parentWidget();
- setWidget(w->parentWidget()->parentWidget(), m_container->toplevel());
+ //m_widget = w->tqparentWidget()->tqparentWidget();
+ setWidget(w->tqparentWidget()->tqparentWidget(), m_container->toplevel());
// m_container = m_container->toplevel();
}
- int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, SLOT(addTabPage()) );
- id = menu->insertItem(SmallIconSet("edit"), i18n("Rename Page..."), this, SLOT(renameTabPage()));
- id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, SLOT(removeTabPage()));
+ int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, TQT_SLOT(addTabPage()) );
+ id = menu->insertItem(SmallIconSet("edit"), i18n("Rename Page..."), this, TQT_SLOT(renameTabPage()));
+ id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, TQT_SLOT(removeTabPage()));
// if( dynamic_cast<TabWidgetBase*>(m_widget)->count() == 1)
if( dynamic_cast<TabWidgetBase*>(widget())->count() == 1)
menu->setItemEnabled(id, false);
return true;
}
- else if(w->parentWidget()->isA("QWidgetStack") && !w->parentWidget()->parentWidget()->inherits("QTabWidget"))
+ else if(w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING) && !w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
{
- //m_widget = w->parentWidget();
- QWidgetStack *stack = (QWidgetStack*)w->parentWidget(); //m_widget;
+ //m_widget = w->tqparentWidget();
+ TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget(); //m_widget;
setWidget(
- w->parentWidget(),
- container->form()->objectTree()->lookup(stack->name())->parent()->container()
+ w->tqparentWidget(),
+ container->form()->objectTree()->lookup(stack->name())->tqparent()->container()
);
-// m_container = container->form()->objectTree()->lookup(m_widget->name())->parent()->container();
-// m_container = container->form()->objectTree()->lookup(stack->name())->parent()->container();
+// m_container = container->form()->objectTree()->lookup(m_widget->name())->tqparent()->container();
+// m_container = container->form()->objectTree()->lookup(stack->name())->tqparent()->container();
- int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, SLOT(addStackPage()) );
+ int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, TQT_SLOT(addStackPage()) );
- id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, SLOT(removeStackPage()) );
-// if( ((QWidgetStack*)m_widget)->children()->count() == 4) // == the stack has only one page
- if(stack->children()->count() == 4) // == the stack has only one page
+ id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, TQT_SLOT(removeStackPage()) );
+// if( ((TQWidgetStack*)m_widget)->tqchildren()->count() == 4) // == the stack has only one page
+ if(stack->childrenListObject().count() == 4) // == the stack has only one page
menu->setItemEnabled(id, false);
- id = menu->insertItem(SmallIconSet("next"), i18n("Jump to Next Page"), this, SLOT(nextStackPage()));
+ id = menu->insertItem(SmallIconSet("next"), i18n("Jump to Next Page"), this, TQT_SLOT(nextStackPage()));
if(!stack->widget(stack->id(stack->visibleWidget())+1))
menu->setItemEnabled(id, false);
- id = menu->insertItem(SmallIconSet("previous"), i18n("Jump to Previous Page"), this, SLOT(prevStackPage()));
+ id = menu->insertItem(SmallIconSet("previous"), i18n("Jump to Previous Page"), this, TQT_SLOT(prevStackPage()));
if(!stack->widget(stack->id(stack->visibleWidget()) -1) )
menu->setItemEnabled(id, false);
return true;
@@ -699,38 +699,38 @@ ContainerFactory::createMenuActions(const QCString &classname, QWidget *w, QPopu
}
bool
-ContainerFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container)
+ContainerFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container)
{
m_container = container;
- if(classname == "QButtonGroup")
+ if(classname == TQBUTTONGROUP_OBJECT_NAME_STRING)
{
- QButtonGroup *group = static_cast<QButtonGroup*>(w);
- QRect r = QRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
- createEditor(classname, group->title(), group, container, r, Qt::AlignAuto);
+ TQButtonGroup *group = static_cast<TQButtonGroup*>(w);
+ TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
+ createEditor(classname, group->title(), group, container, r, TQt::AlignAuto);
return true;
}
- if(classname == "QGroupBox" || classname == "GroupBox")
+ if(classname == TQGROUPBOX_OBJECT_NAME_STRING || classname == "GroupBox")
{
- QGroupBox *group = static_cast<QGroupBox*>(w);
- QRect r = QRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
- createEditor(classname, group->title(), group, container, r, Qt::AlignAuto);
+ TQGroupBox *group = static_cast<TQGroupBox*>(w);
+ TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10);
+ createEditor(classname, group->title(), group, container, r, TQt::AlignAuto);
return true;
}
return false;
}
bool
-ContainerFactory::saveSpecialProperty(const QCString &, const QString &name, const QVariant &, QWidget *w, QDomElement &parentNode, QDomDocument &parent)
+ContainerFactory::saveSpecialProperty(const TQCString &, const TQString &name, const TQVariant &, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &tqparent)
{
- if((name == "title") && (w->parentWidget()->parentWidget()->inherits("QTabWidget")))
+ if((name == "title") && (w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
{
- TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget()->parentWidget());
- KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "title", tab->tabLabel(w));
+ TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->tqparentWidget()->tqparentWidget());
+ KFormDesigner::FormIO::savePropertyElement(tqparentNode, tqparent, "attribute", "title", tab->tabLabel(w));
}
- else if((name == "id") && (w->parentWidget()->isA("QWidgetStack")))
+ else if((name == "id") && (w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)))
{
- QWidgetStack *stack = (QWidgetStack*)w->parentWidget();
- KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "id", stack->id(w));
+ TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget();
+ KFormDesigner::FormIO::savePropertyElement(tqparentNode, tqparent, "attribute", "id", stack->id(w));
}
else
return false;
@@ -738,21 +738,21 @@ ContainerFactory::saveSpecialProperty(const QCString &, const QString &name, con
}
bool
-ContainerFactory::readSpecialProperty(const QCString &, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *item)
+ContainerFactory::readSpecialProperty(const TQCString &, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item)
{
- QString name = node.attribute("name");
- if((name == "title") && (item->parent()->widget()->inherits("QTabWidget")))
+ TQString name = node.attribute("name");
+ if((name == "title") && (item->tqparent()->widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)))
{
- TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget());
+ TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->tqparentWidget());
tab->addTab(w, node.firstChild().toElement().text());
item->addModifiedProperty("title", node.firstChild().toElement().text());
return true;
}
- if((name == "id") && (w->parentWidget()->isA("QWidgetStack")))
+ if((name == "id") && (w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)))
{
- QWidgetStack *stack = (QWidgetStack*)w->parentWidget();
- int id = KFormDesigner::FormIO::readPropertyValue(node.firstChild(), w, name).toInt();
+ TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget();
+ int id = KFormDesigner::FormIO::readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt();
stack->addWidget(w, id);
stack->raiseWidget(w);
item->addModifiedProperty("id", id);
@@ -762,20 +762,20 @@ ContainerFactory::readSpecialProperty(const QCString &, QDomElement &node, QWidg
return false;
}
-QValueList<QCString>
-ContainerFactory::autoSaveProperties(const QCString &c)
+TQValueList<TQCString>
+ContainerFactory::autoSaveProperties(const TQCString &c)
{
- QValueList<QCString> lst;
+ TQValueList<TQCString> lst;
// if(c == "SubForm")
// lst << "formName";
- if(c == "QSplitter")
+ if(c == TQSPLITTER_OBJECT_NAME_STRING)
lst << "orientation";
return lst;
}
bool
-ContainerFactory::isPropertyVisibleInternal(const QCString &classname,
- QWidget *w, const QCString &property, bool isTopLevel)
+ContainerFactory::isPropertyVisibleInternal(const TQCString &classname,
+ TQWidget *w, const TQCString &property, bool isTopLevel)
{
bool ok = true;
@@ -784,7 +784,7 @@ ContainerFactory::isPropertyVisibleInternal(const QCString &classname,
{
return property == "name" || property == "geometry";
}
- else if (classname == "QGroupBox" || classname=="GroupBox") {
+ else if (classname == TQGROUPBOX_OBJECT_NAME_STRING || classname=="GroupBox") {
ok =
#ifdef KEXI_NO_UNFINISHED
/*! @todo Hidden for now in Kexi. "checkable" and "checked" props need adding
@@ -803,16 +803,16 @@ child widgets become frozen when checked==true */
}
bool
-ContainerFactory::changeText(const QString &text)
+ContainerFactory::changeText(const TQString &text)
{
changeProperty("title", text, m_container->form());
return true;
}
void
-ContainerFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString &)
+ContainerFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &)
{
- QSize s = widget->size();
+ TQSize s = widget->size();
editor->move(widget->x() + 2, widget->y() - 5);
editor->resize(s.width() - 20, widget->fontMetrics().height() +10);
}
@@ -821,8 +821,8 @@ ContainerFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString
void ContainerFactory::addTabPage()
{
-// if (!m_widget->inherits("QTabWidget"))
- if (!widget()->inherits("QTabWidget"))
+// if (!m_widget->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
+ if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
return;
KCommand *com = new InsertPageCommand(m_container, widget());
if(dynamic_cast<TabWidgetBase*>(widget())->count() == 0)
@@ -836,10 +836,10 @@ void ContainerFactory::addTabPage()
void ContainerFactory::removeTabPage()
{
- if (!widget()->inherits("QTabWidget"))
+ if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
return;
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget());
- QWidget *w = tab->currentPage();
+ TQWidget *w = tab->currentPage();
KFormDesigner::WidgetList list;
list.append(w);
@@ -850,17 +850,17 @@ void ContainerFactory::removeTabPage()
void ContainerFactory::renameTabPage()
{
- if (!widget()->inherits("QTabWidget"))
+ if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))
return;
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget());
- QWidget *w = tab->currentPage();
+ TQWidget *w = tab->currentPage();
bool ok;
- QString name = KInputDialog::getText(i18n("New Page Title"), i18n("Enter a new title for the current page:"),
+ TQString name = KInputDialog::getText(i18n("New Page Title"), i18n("Enter a new title for the current page:"),
#if KDE_VERSION < KDE_MAKE_VERSION(3,1,9)
- QLineEdit::Normal,
+ TQLineEdit::Normal,
#endif
- tab->tabLabel(w), &ok, w->topLevelWidget());
+ tab->tabLabel(w), &ok, w->tqtopLevelWidget());
if(ok)
tab->changeTab(w, name);
}
@@ -868,20 +868,20 @@ void ContainerFactory::renameTabPage()
void ContainerFactory::reorderTabs(int oldpos, int newpos)
{
KFormDesigner::ObjectTreeItem *tab
- = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(sender()->name());
+ = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name());
if(!tab)
return;
- KFormDesigner::ObjectTreeItem *item = tab->children()->take(oldpos);
- tab->children()->insert(newpos, item);
+ KFormDesigner::ObjectTreeItem *item = tab->tqchildren()->take(oldpos);
+ tab->tqchildren()->insert(newpos, item);
}
void ContainerFactory::addStackPage()
{
- if (!widget()->isA("QWidgetStack"))
+ if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))
return;
KCommand *com = new InsertPageCommand(m_container, widget());
- if(!((QWidgetStack*)widget())->visibleWidget())
+ if(!((TQWidgetStack*)widget())->visibleWidget())
{
com->execute();
delete com;
@@ -892,10 +892,10 @@ void ContainerFactory::addStackPage()
void ContainerFactory::removeStackPage()
{
- if (!widget()->isA("QWidgetStack"))
+ if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))
return;
- QWidgetStack *stack = (QWidgetStack*)widget();
- QWidget *page = stack->visibleWidget();
+ TQWidgetStack *stack = (TQWidgetStack*)widget();
+ TQWidget *page = stack->visibleWidget();
KFormDesigner::WidgetList list;
list.append(page);
@@ -913,7 +913,7 @@ void ContainerFactory::removeStackPage()
void ContainerFactory::prevStackPage()
{
- QWidgetStack *stack = (QWidgetStack*)widget();
+ TQWidgetStack *stack = (TQWidgetStack*)widget();
int id = stack->id(stack->visibleWidget()) - 1;
if(stack->widget(id))
stack->raiseWidget(id);
@@ -921,7 +921,7 @@ void ContainerFactory::prevStackPage()
void ContainerFactory::nextStackPage()
{
- QWidgetStack *stack = (QWidgetStack*)widget();
+ TQWidgetStack *stack = (TQWidgetStack*)widget();
int id = stack->id(stack->visibleWidget()) + 1;
if(stack->widget(id))
stack->raiseWidget(id);