summaryrefslogtreecommitdiffstats
path: root/quanta/treeviews/tagattributetree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/treeviews/tagattributetree.cpp')
-rw-r--r--quanta/treeviews/tagattributetree.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/quanta/treeviews/tagattributetree.cpp b/quanta/treeviews/tagattributetree.cpp
index a8e4406b..565c5a4c 100644
--- a/quanta/treeviews/tagattributetree.cpp
+++ b/quanta/treeviews/tagattributetree.cpp
@@ -13,13 +13,13 @@
***************************************************************************/
//qt includes
-#include <qfont.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtooltip.h>
+#include <tqfont.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
//kde includes
#include <kaction.h>
@@ -50,7 +50,7 @@
#include "viewmanager.h"
-EditableTree::EditableTree(QWidget *parent, const char *name)
+EditableTree::EditableTree(TQWidget *parent, const char *name)
: KListView(parent, name)
{
m_editable = true;
@@ -61,11 +61,11 @@ EditableTree::~EditableTree()
}
-void EditableTree::setCurrentItem( QListViewItem *item)
+void EditableTree::setCurrentItem( TQListViewItem *item)
{
if ( item && m_editable)
{
- QListViewItem *it = currentItem();
+ TQListViewItem *it = currentItem();
if ( dynamic_cast<AttributeItem*>(it) )
static_cast<AttributeItem*>(it)->hideEditor();
@@ -81,9 +81,9 @@ void EditableTree::editorContentChanged()
}
-void EditableTree::focusInEvent(QFocusEvent *)
+void EditableTree::focusInEvent(TQFocusEvent *)
{
- /**QListViewItem *it = currentItem();
+ /**TQListViewItem *it = currentItem();
if( dynamic_cast<AttributeItem*>(it))
{
static_cast<AttributeItem *>(it)->showEditor();
@@ -91,23 +91,23 @@ void EditableTree::focusInEvent(QFocusEvent *)
}*/
}
-void EditableTree::focusOutEvent(QFocusEvent *)
+void EditableTree::focusOutEvent(TQFocusEvent *)
{
- /**QListViewItem *it = currentItem();
+ /**TQListViewItem *it = currentItem();
if( dynamic_cast<AttributeItem*>(it))
{
static_cast<AttributeItem *>(it)->hideEditor();
}*/
}
-DualEditableTree::DualEditableTree(QWidget *parent, const char *name)
+DualEditableTree::DualEditableTree(TQWidget *parent, const char *name)
: EditableTree(parent, name)
{
curCol = 0;
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQWidget::ClickFocus);
this->installEventFilter(this);
- connect(this, SIGNAL(clicked(QListViewItem *, const QPoint &, int )),
- this, SLOT(itemClicked(QListViewItem *, const QPoint &, int )));
+ connect(this, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int )),
+ this, TQT_SLOT(itemClicked(TQListViewItem *, const TQPoint &, int )));
}
DualEditableTree::~DualEditableTree()
@@ -115,7 +115,7 @@ DualEditableTree::~DualEditableTree()
}
-bool DualEditableTree::eventFilter(QObject *object, QEvent *event)
+bool DualEditableTree::eventFilter(TQObject *object, TQEvent *event)
{
AttributeItem *it = dynamic_cast<AttributeItem*>(currentItem());
AttributeItem *up = 0L, *down = 0L;
@@ -126,9 +126,9 @@ bool DualEditableTree::eventFilter(QObject *object, QEvent *event)
if(currentItem()->itemBelow())
down = dynamic_cast<AttributeItem *>(currentItem()->itemBelow());
- if(event->type() == QEvent::KeyPress && m_editable)
+ if(event->type() == TQEvent::KeyPress && m_editable)
{
- QKeyEvent *keyevent = static_cast<QKeyEvent *>(event);
+ TQKeyEvent *keyevent = static_cast<TQKeyEvent *>(event);
switch(keyevent->key())
{
case Key_Left:
@@ -171,7 +171,7 @@ bool DualEditableTree::eventFilter(QObject *object, QEvent *event)
return KListView::eventFilter(object, event);;
}
-void DualEditableTree::resizeEvent(QResizeEvent *ev)
+void DualEditableTree::resizeEvent(TQResizeEvent *ev)
{
KListView::resizeEvent(ev);
if(!currentItem()) return;
@@ -183,11 +183,11 @@ void DualEditableTree::resizeEvent(QResizeEvent *ev)
}
}
-void DualEditableTree::setCurrentItem(QListViewItem *item)
+void DualEditableTree::setCurrentItem(TQListViewItem *item)
{
if ( item && m_editable)
{
- QListViewItem *it = currentItem();
+ TQListViewItem *it = currentItem();
if ( dynamic_cast<AttributeItem*>(it) )
{
static_cast<AttributeItem*>(it)->hideEditor(0);
@@ -206,7 +206,7 @@ void DualEditableTree::editorContentChanged()
emit itemModified(dynamic_cast<AttributeItem*>(currentItem()));
}
-void DualEditableTree::itemClicked(QListViewItem *item, const QPoint &, int column)
+void DualEditableTree::itemClicked(TQListViewItem *item, const TQPoint &, int column)
{
if(item)
{
@@ -216,17 +216,17 @@ void DualEditableTree::itemClicked(QListViewItem *item, const QPoint &, int colu
}
}
-TagAttributeTree::TagAttributeTree(QWidget *parent, const char *name)
+TagAttributeTree::TagAttributeTree(TQWidget *parent, const char *name)
: EditableTree(parent, name)
{
setRootIsDecorated( true );
setSorting(-1);
setFrameStyle( Panel | Sunken );
setLineWidth( 2 );
- setFocusPolicy(QWidget::ClickFocus);
+ setFocusPolicy(TQWidget::ClickFocus);
addColumn(i18n("Attribute Name"));
addColumn(i18n("Value"));
- setResizeMode(QListView::LastColumn);
+ setResizeMode(TQListView::LastColumn);
m_node = 0L;
m_newNode = 0L;
m_parentItem = 0L;
@@ -258,7 +258,7 @@ void TagAttributeTree::setCurrentNode(Node *node)
#endif
AttributeItem *item = 0L;
TopLevelItem *group = 0L;
- QString attrName;
+ TQString attrName;
QTag *qTag = QuantaCommon::tagFromDTD(node);
Node *n = node->parent;
while (n)
@@ -283,7 +283,7 @@ void TagAttributeTree::setCurrentNode(Node *node)
if(node->tag->type == Tag::XmlTag || node->tag->type == Tag::XmlTagEnd)
{
- QString nameSpace = node->tag->nameSpace;
+ TQString nameSpace = node->tag->nameSpace;
if (node->tag->type == Tag::XmlTagEnd)
nameSpace.remove('/');
group = new TopLevelItem(this, group, i18n("Namespace"));
@@ -293,13 +293,13 @@ void TagAttributeTree::setCurrentNode(Node *node)
if (qTag)
{
group = new TopLevelItem(this, group, i18n("Attributes"));
- QStringList list;
+ TQStringList list;
for (int i = 0; i < qTag->attributeCount(); i++)
{
list += qTag->attributeAt(i)->name;
}
list.sort();
- QStringList::Iterator it = list.end();
+ TQStringList::Iterator it = list.end();
--it;
while (it != list.end())
{
@@ -367,8 +367,8 @@ void TagAttributeTree::setCurrentNode(Node *node)
}
}
- connect(this, SIGNAL(collapsed(QListViewItem*)), SLOT(slotCollapsed(QListViewItem*)));
- connect(this, SIGNAL(expanded(QListViewItem*)), SLOT(slotExpanded(QListViewItem*)));
+ connect(this, TQT_SIGNAL(collapsed(TQListViewItem*)), TQT_SLOT(slotCollapsed(TQListViewItem*)));
+ connect(this, TQT_SIGNAL(expanded(TQListViewItem*)), TQT_SLOT(slotExpanded(TQListViewItem*)));
}
void TagAttributeTree::editorContentChanged()
@@ -379,7 +379,7 @@ void TagAttributeTree::editorContentChanged()
rebuildEnabled = false;
if (dynamic_cast<AttributeNameSpaceItem*>(item))
{
- QString nameSpace = item->editorText();
+ TQString nameSpace = item->editorText();
m_node->tag->write()->changeTagNamespace(m_node->tag, nameSpace);
} else
{
@@ -403,11 +403,11 @@ void TagAttributeTree::editorContentChanged()
}
}
-/**void TagAttributeTree::setCurrentItem( QListViewItem *item )
+/**void TagAttributeTree::setCurrentItem( TQListViewItem *item )
{
if ( item )
{
- QListViewItem *it = currentItem();
+ TQListViewItem *it = currentItem();
if ( dynamic_cast<AttributeItem*>(it) )
static_cast<AttributeItem*>(it)->hideEditor();
@@ -423,17 +423,17 @@ void TagAttributeTree::slotParentSelected(int index)
if (m_parentItem)
{
m_newNode = m_parentItem->node(index);
- QTimer::singleShot(0, this, SLOT(slotDelayedSetCurrentNode()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCurrentNode()));
}
}
-void TagAttributeTree::slotCollapsed(QListViewItem *item)
+void TagAttributeTree::slotCollapsed(TQListViewItem *item)
{
if (m_parentItem && item == m_parentItem->parent())
m_parentItem->showList(false);
}
-void TagAttributeTree::slotExpanded(QListViewItem *item)
+void TagAttributeTree::slotExpanded(TQListViewItem *item)
{
if (m_parentItem && item == m_parentItem->parent())
m_parentItem->showList(true);
@@ -451,39 +451,39 @@ void TagAttributeTree::slotDelayedSetCurrentNode()
}
}
-EnhancedTagAttributeTree::EnhancedTagAttributeTree(QWidget *parent, const char *name)
-: QWidget(parent, name)
+EnhancedTagAttributeTree::EnhancedTagAttributeTree(TQWidget *parent, const char *name)
+: TQWidget(parent, name)
{
- widgetLayout = new QGridLayout( this, 1, 1, 11, 6, "MainLayout");
+ widgetLayout = new TQGridLayout( this, 1, 1, 11, 6, "MainLayout");
attrTree = new TagAttributeTree(this, "TagAttributeTree");
- attrTree->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
+ attrTree->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding);
widgetLayout->addMultiCellWidget( attrTree, 1, 1, 0, 3 );
- nodeName = new QLabel(this, i18n( "Node Name" ));
- nodeName->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed, 0, 0, nodeName->sizePolicy().hasHeightForWidth() ) );
+ nodeName = new TQLabel(this, i18n( "Node Name" ));
+ nodeName->setSizePolicy( TQSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed, 0, 0, nodeName->sizePolicy().hasHeightForWidth() ) );
widgetLayout->addWidget( nodeName, 0, 0 );
deleteTag = new KPushButton(this, i18n( "Delete Tag" ));
deleteTag->setPixmap(SmallIcon("editdelete"));
deleteTag->setMaximumHeight(32);
deleteTag->setMaximumWidth(32);
- QToolTip::add(deleteTag, i18n("Delete the current tag only."));
+ TQToolTip::add(deleteTag, i18n("Delete the current tag only."));
deleteAll = new KPushButton(this, i18n( "Delete All" ));
deleteAll->setPixmap(SmallIcon("editdelete"));
deleteAll->setMaximumHeight(32);
deleteAll->setMaximumWidth(32);
- QToolTip::add(deleteAll, i18n("Delete the current tag and all its children."));
+ TQToolTip::add(deleteAll, i18n("Delete the current tag and all its children."));
widgetLayout->addWidget( deleteTag, 0, 2 );
widgetLayout->addWidget( deleteAll, 0, 3 );
clearWState( WState_Polished );
- connect(attrTree, SIGNAL(newNodeSelected(Node *)), this, SLOT(NodeSelected(Node *)));
- connect(deleteTag, SIGNAL(clicked()), this, SLOT(deleteNode()));
- connect(deleteAll, SIGNAL(clicked()), this, SLOT(deleteSubTree()));
+ connect(attrTree, TQT_SIGNAL(newNodeSelected(Node *)), this, TQT_SLOT(NodeSelected(Node *)));
+ connect(deleteTag, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteNode()));
+ connect(deleteAll, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteSubTree()));
}
EnhancedTagAttributeTree::~EnhancedTagAttributeTree()
@@ -515,7 +515,7 @@ void EnhancedTagAttributeTree::showCaption()
if(curNode->tag->type == Tag::XmlTag || curNode->tag->type == Tag::XmlTagEnd ||
curNode->tag->type == Tag::ScriptTag)
{
- QString s = i18n("Current tag: <b>%1</b>").arg(curNode->tag->name);
+ TQString s = i18n("Current tag: <b>%1</b>").arg(curNode->tag->name);
nodeName->setText(KStringHandler::rPixelSqueeze(s, nodeName->fontMetrics(), attrTree->width()- 50));
}
else if(curNode->tag->type == Tag::Text)
@@ -537,7 +537,7 @@ void EnhancedTagAttributeTree::deleteSubTree()
int curLine, curCol;
long offset;
DOM::Node domNode;
- QValueList<int> loc;
+ TQValueList<int> loc;
//Save the cursor position in kafka/quanta
if(view->hadLastFocus() == QuantaView::SourceFocus)
@@ -590,7 +590,7 @@ void EnhancedTagAttributeTree::deleteNode()
int curLine, curCol;
long offset;
DOM::Node domNode;
- QValueList<int> loc;
+ TQValueList<int> loc;
NodeModifsSet *modifs;
//Save the cursor position in kafka/quanta