summaryrefslogtreecommitdiffstats
path: root/kexi/formeditor/objecttreeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/formeditor/objecttreeview.cpp')
-rw-r--r--kexi/formeditor/objecttreeview.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/kexi/formeditor/objecttreeview.cpp b/kexi/formeditor/objecttreeview.cpp
index 22ed6d7f..4f258446 100644
--- a/kexi/formeditor/objecttreeview.cpp
+++ b/kexi/formeditor/objecttreeview.cpp
@@ -19,7 +19,7 @@
#include <kdebug.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kiconloader.h>
#include <klocale.h>
@@ -34,14 +34,14 @@
using namespace KFormDesigner;
-ObjectTreeViewItem::ObjectTreeViewItem(ObjectTreeViewItem *parent, ObjectTreeItem *item)
- : KListViewItem(parent, item->name(), item->className())
+ObjectTreeViewItem::ObjectTreeViewItem(ObjectTreeViewItem *tqparent, ObjectTreeItem *item)
+ : KListViewItem(tqparent, item->name(), item->className())
{
m_item = item;
}
ObjectTreeViewItem::ObjectTreeViewItem(KListView *list, ObjectTreeItem *item)
- : KListViewItem(list, item ? item->name() : QString::null, item ? item->className() : QString::null)
+ : KListViewItem(list, item ? item->name() : TQString(), item ? item->className() : TQString())
{
m_item = item;
}
@@ -50,17 +50,17 @@ ObjectTreeViewItem::~ObjectTreeViewItem()
{
}
-QString
+TQString
ObjectTreeViewItem::name() const
{
if(m_item)
return m_item->name();
else
- return QString::null;
+ return TQString();
}
void
-ObjectTreeViewItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align)
+ObjectTreeViewItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align)
{
int margin = listView()->itemMargin();
if(column == 1)
@@ -74,42 +74,42 @@ ObjectTreeViewItem::paintCell(QPainter *p, const QColorGroup & cg, int column, i
if(!m_item)
return;
- p->fillRect(0,0,width, height(), QBrush(backgroundColor()));
+ p->fillRect(0,0,width, height(), TQBrush(backgroundColor()));
if(isSelected())
{
- p->fillRect(0,0,width, height(), QBrush(cg.highlight()));
+ p->fillRect(0,0,width, height(), TQBrush(cg.highlight()));
p->setPen(cg.highlightedText());
}
- QFont f = listView()->font();
+ TQFont f = listView()->font();
p->save();
if(isSelected())
f.setBold(true);
p->setFont(f);
if(depth() == 0) // for edit tab order dialog
{
- QString iconName
+ TQString iconName
= ((ObjectTreeView*)listView())->iconNameForClass(m_item->widget()->className());
p->drawPixmap(margin, (height() - IconSize(KIcon::Small))/2 , SmallIcon(iconName));
p->drawText(
- QRect(2*margin + IconSize(KIcon::Small),0,width, height()-1),
- Qt::AlignVCenter, m_item->name());
+ TQRect(2*margin + IconSize(KIcon::Small),0,width, height()-1),
+ TQt::AlignVCenter, m_item->name());
}
else
- p->drawText(QRect(margin,0,width, height()-1), Qt::AlignVCenter, m_item->name());
+ p->drawText(TQRect(margin,0,width, height()-1), TQt::AlignVCenter, m_item->name());
p->restore();
- p->setPen( QColor(200,200,200) ); //like in t.v.
+ p->setPen( TQColor(200,200,200) ); //like in t.v.
p->drawLine(width-1, 0, width-1, height()-1);
}
- p->setPen( QColor(200,200,200) ); //like in t.v.
+ p->setPen( TQColor(200,200,200) ); //like in t.v.
p->drawLine(-150, height()-1, width, height()-1 );
}
void
-ObjectTreeViewItem::paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h)
+ObjectTreeViewItem::paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h)
{
p->eraseRect(0,0,w,h);
ObjectTreeViewItem *item = (ObjectTreeViewItem*)firstChild();
@@ -120,20 +120,20 @@ ObjectTreeViewItem::paintBranches(QPainter *p, const QColorGroup &cg, int w, int
p->translate(0,y);
while(item)
{
- p->fillRect(0,0,w, item->height(), QBrush(item->backgroundColor()));
- p->fillRect(-150,0,150, item->height(), QBrush(item->backgroundColor()));
+ p->fillRect(0,0,w, item->height(), TQBrush(item->backgroundColor()));
+ p->fillRect(-150,0,150, item->height(), TQBrush(item->backgroundColor()));
p->save();
- p->setPen( QColor(200,200,200) ); //like in t.v.
+ p->setPen( TQColor(200,200,200) ); //like in t.v.
p->drawLine(-150, item->height()-1, w, item->height()-1 );
p->restore();
if(item->isSelected())
{
- p->fillRect(0,0,w, item->height(), QBrush(cg.highlight()));
- p->fillRect(-150,0,150, item->height(), QBrush(cg.highlight()));
+ p->fillRect(0,0,w, item->height(), TQBrush(cg.highlight()));
+ p->fillRect(-150,0,150, item->height(), TQBrush(cg.highlight()));
}
- QString iconName
+ TQString iconName
= ((ObjectTreeView*)listView())->iconNameForClass(item->m_item->widget()->className());
p->drawPixmap(
(w - IconSize(KIcon::Small))/2, (item->height() - IconSize(KIcon::Small))/2 ,
@@ -163,8 +163,8 @@ ObjectTreeViewItem::setOpen( bool o )
// ObjectTreeView itself ----------------
-ObjectTreeView::ObjectTreeView(QWidget *parent, const char *name, bool tabStop)
- : KListView(parent, name)
+ObjectTreeView::ObjectTreeView(TQWidget *tqparent, const char *name, bool tabStop)
+ : KListView(tqparent, name)
, m_form(0)
{
addColumn(i18n("Name"), 130);
@@ -172,12 +172,12 @@ ObjectTreeView::ObjectTreeView(QWidget *parent, const char *name, bool tabStop)
installEventFilter(this);
- connect((QObject*)header(), SIGNAL(sectionHandleDoubleClicked(int)), this, SLOT(slotColumnSizeChanged(int)));
+ connect((TQObject*)header(), TQT_SIGNAL(sectionHandleDoubleClicked(int)), this, TQT_SLOT(slotColumnSizeChanged(int)));
if(!tabStop)
{
setSelectionModeExt(Extended);
- connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
- connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint&)), this, SLOT(displayContextMenu(KListView*, QListViewItem*, const QPoint&)));
+ connect(this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()));
+ connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint&)), this, TQT_SLOT(displayContextMenu(KListView*, TQListViewItem*, const TQPoint&)));
}
setFullWidth(true);
@@ -190,15 +190,15 @@ ObjectTreeView::~ObjectTreeView()
{
}
-QSize
-ObjectTreeView::sizeHint() const
+TQSize
+ObjectTreeView::tqsizeHint() const
{
- return QSize( QFontMetrics(font()).width(columnText(0)+columnText(1)+" "),
- KListView::sizeHint().height());
+ return TQSize( TQFontMetrics(font()).width(columnText(0)+columnText(1)+" "),
+ KListView::tqsizeHint().height());
}
-QString
-ObjectTreeView::iconNameForClass(const QCString &classname)
+TQString
+ObjectTreeView::iconNameForClass(const TQCString &classname)
{
return m_form->library()->iconName(classname);
}
@@ -210,12 +210,12 @@ ObjectTreeView::slotColumnSizeChanged(int)
}
void
-ObjectTreeView::displayContextMenu(KListView *list, QListViewItem *item, const QPoint &)
+ObjectTreeView::displayContextMenu(KListView *list, TQListViewItem *item, const TQPoint &)
{
if(list != this || !m_form || !item)
return;
- QWidget *w = ((ObjectTreeViewItem*)item)->m_item->widget();
+ TQWidget *w = ((ObjectTreeViewItem*)item)->m_item->widget();
if(!w)
return;
@@ -223,9 +223,9 @@ ObjectTreeView::displayContextMenu(KListView *list, QListViewItem *item, const Q
}
ObjectTreeViewItem*
-ObjectTreeView::findItem(const QString &name)
+ObjectTreeView::findItem(const TQString &name)
{
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
while(it.current())
{
ObjectTreeViewItem *item = static_cast<ObjectTreeViewItem*>(it.current());
@@ -239,7 +239,7 @@ ObjectTreeView::findItem(const QString &name)
}
void
-ObjectTreeView::setSelectedWidget(QWidget *w, bool add)
+ObjectTreeView::setSelectedWidget(TQWidget *w, bool add)
{
blockSignals(true); // to avoid recursion
@@ -257,7 +257,7 @@ ObjectTreeView::setSelectedWidget(QWidget *w, bool add)
clearSelection();
- QListViewItem *item = (QListViewItem*) findItem(w->name());
+ TQListViewItem *item = (TQListViewItem*) findItem(w->name());
if(!add)
{
setCurrentItem(item);
@@ -274,13 +274,13 @@ void
ObjectTreeView::slotSelectionChanged()
{
const bool hadFocus = hasFocus();
- QPtrList<QListViewItem> list = selectedItems();
+ TQPtrList<TQListViewItem> list = selectedItems();
m_form->selectFormWidget();
- for(QListViewItem *item = list.first(); item; item = list.next())
+ for(TQListViewItem *item = list.first(); item; item = list.next())
{
ObjectTreeViewItem *it = static_cast<ObjectTreeViewItem*>(item);
- QWidget *w = it->objectTree()->widget();
- if(w && (m_form->selectedWidgets()->findRef(w) == -1))
+ TQWidget *w = it->objectTree()->widget();
+ if(w && (m_form->selectedWidgets()->tqfindRef(w) == -1))
m_form->setSelectedWidget(w, true, true);
}
if (hadFocus)
@@ -290,13 +290,13 @@ ObjectTreeView::slotSelectionChanged()
void
ObjectTreeView::addItem(ObjectTreeItem *item)
{
- ObjectTreeViewItem *parent=0;
+ ObjectTreeViewItem *tqparent=0;
- parent = findItem(item->parent()->name());
- if(!parent)
+ tqparent = findItem(item->tqparent()->name());
+ if(!tqparent)
return;
- loadTree(item, parent);
+ loadTree(item, tqparent);
}
void
@@ -309,7 +309,7 @@ ObjectTreeView::removeItem(ObjectTreeItem *item)
}
void
-ObjectTreeView::renameItem(const QCString &oldname, const QCString &newname)
+ObjectTreeView::renameItem(const TQCString &oldname, const TQCString &newname)
{
if(findItem(newname))
return;
@@ -323,7 +323,7 @@ void
ObjectTreeView::setForm(Form *form)
{
if (m_form)
- disconnect(m_form, SIGNAL(destroying()), this, SLOT(slotBeforeFormDestroyed()));
+ disconnect(m_form, TQT_SIGNAL(destroying()), this, TQT_SLOT(slotBeforeFormDestroyed()));
m_form = form;
m_topItem = 0;
clear();
@@ -331,7 +331,7 @@ ObjectTreeView::setForm(Form *form)
if(!m_form)
return;
- connect(m_form, SIGNAL(destroying()), this, SLOT(slotBeforeFormDestroyed()));
+ connect(m_form, TQT_SIGNAL(destroying()), this, TQT_SLOT(slotBeforeFormDestroyed()));
// Creates the hidden top Item
m_topItem = new ObjectTreeViewItem(this);
@@ -354,20 +354,20 @@ ObjectTreeView::slotBeforeFormDestroyed()
}
ObjectTreeViewItem*
-ObjectTreeView::loadTree(ObjectTreeItem *item, ObjectTreeViewItem *parent)
+ObjectTreeView::loadTree(ObjectTreeItem *item, ObjectTreeViewItem *tqparent)
{
if(!item)
return 0;
- ObjectTreeViewItem *treeItem = new ObjectTreeViewItem(parent, item);
+ ObjectTreeViewItem *treeItem = new ObjectTreeViewItem(tqparent, item);
treeItem->setOpen(true);
// The item is inserted by default at the beginning, but we want it to be at the end, so we move it
- QListViewItem *last = parent->firstChild();
+ TQListViewItem *last = tqparent->firstChild();
while(last->nextSibling())
last = last->nextSibling();
treeItem->moveItem(last);
- ObjectTreeList *list = item->children();
+ ObjectTreeList *list = item->tqchildren();
for(ObjectTreeItem *it = list->first(); it; it = list->next())
loadTree(it, treeItem);