summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/umllistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/umllistview.cpp')
-rw-r--r--umbrello/umbrello/umllistview.cpp262
1 files changed, 131 insertions, 131 deletions
diff --git a/umbrello/umbrello/umllistview.cpp b/umbrello/umbrello/umllistview.cpp
index d12fed58..29e270ce 100644
--- a/umbrello/umbrello/umllistview.cpp
+++ b/umbrello/umbrello/umllistview.cpp
@@ -13,12 +13,12 @@
#include "umllistview.h"
// qt/kde includes
-#include <qregexp.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qevent.h>
-#include <qheader.h>
-#include <qtooltip.h>
+#include <tqregexp.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqevent.h>
+#include <tqheader.h>
+#include <tqtooltip.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -66,17 +66,17 @@
class LVToolTip : public QToolTip
{
public:
- LVToolTip (QWidget* parent) : QToolTip (parent) {}
+ LVToolTip (TQWidget* parent) : TQToolTip (parent) {}
virtual ~LVToolTip () {}
protected:
/**
- * Reimplemented from QToolTip for internal reasons.
+ * Reimplemented from TQToolTip for internal reasons.
* At classifiers, only the method names are shown in the list view -
* we use a tooltip for the full signature display.
* Once KListView's tooltip overriding mechanism works, we can kick
* this class out.
*/
- virtual void maybeTip (const QPoint& pos) {
+ virtual void maybeTip (const TQPoint& pos) {
UMLListView *lv = UMLApp::app()->getListView();
UMLListViewItem * item = (UMLListViewItem*)lv->itemAt(pos);
if (item == NULL)
@@ -85,15 +85,15 @@ protected:
if (obj == NULL || obj->getBaseType() != Uml::ot_Operation)
return;
UMLOperation *op = static_cast<UMLOperation*>(obj);
- QString text = op->toString(Uml::st_ShowSig);
- QRect rect = lv->itemRect(item);
+ TQString text = op->toString(Uml::st_ShowSig);
+ TQRect rect = lv->itemRect(item);
tip(rect, text);
}
};
#endif
-UMLListView::UMLListView(QWidget *parent, const char *name)
+UMLListView::UMLListView(TQWidget *parent, const char *name)
: KListView(parent,name), m_pMenu(0), m_doc(UMLApp::app()->getDocument())
{
loadPixmaps();
@@ -105,7 +105,7 @@ UMLListView::UMLListView(QWidget *parent, const char *name)
setItemsMovable(true);
setItemsRenameable( true );
setSelectionModeExt(FileManager);
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
setDragEnabled(true);
setColumnWidthMode( 0, Manual );
setDefaultRenameAction( Accept );
@@ -131,41 +131,41 @@ UMLListView::UMLListView(QWidget *parent, const char *name)
m_lv[i] = NULL;
m_datatypeFolder = NULL;
//setup slots/signals
- connect(this, SIGNAL(dropped(QDropEvent *, QListViewItem *, QListViewItem *)),
- this, SLOT(slotDropped(QDropEvent *, QListViewItem *, QListViewItem *)));
- connect( this, SIGNAL( collapsed( QListViewItem * ) ),
- this, SLOT( slotCollapsed( QListViewItem * ) ) );
- connect( this, SIGNAL( expanded( QListViewItem * ) ), this, SLOT( slotExpanded( QListViewItem * ) ) );
- connect( UMLApp::app(), SIGNAL( sigCutSuccessful() ), this, SLOT( slotCutSuccessful() ) );
+ connect(this, TQT_SIGNAL(dropped(TQDropEvent *, TQListViewItem *, TQListViewItem *)),
+ this, TQT_SLOT(slotDropped(TQDropEvent *, TQListViewItem *, TQListViewItem *)));
+ connect( this, TQT_SIGNAL( collapsed( TQListViewItem * ) ),
+ this, TQT_SLOT( slotCollapsed( TQListViewItem * ) ) );
+ connect( this, TQT_SIGNAL( expanded( TQListViewItem * ) ), this, TQT_SLOT( slotExpanded( TQListViewItem * ) ) );
+ connect( UMLApp::app(), TQT_SIGNAL( sigCutSuccessful() ), this, TQT_SLOT( slotCutSuccessful() ) );
}
UMLListView::~UMLListView() {}
-bool UMLListView::eventFilter(QObject *o, QEvent *e) {
- if (e->type() != QEvent::MouseButtonPress || !o->isA("QHeader"))
- return QListView::eventFilter(o, e);
- QMouseEvent *me = static_cast<QMouseEvent*>(e);
+bool UMLListView::eventFilter(TQObject *o, TQEvent *e) {
+ if (e->type() != TQEvent::MouseButtonPress || !o->isA("TQHeader"))
+ return TQListView::eventFilter(o, e);
+ TQMouseEvent *me = static_cast<TQMouseEvent*>(e);
if (me->button() == Qt::RightButton) {
if (m_pMenu) {
m_pMenu->hide();
- disconnect(m_pMenu, SIGNAL(activated(int)), this, SLOT(popupMenuSel(int)));
+ disconnect(m_pMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(popupMenuSel(int)));
delete m_pMenu;
}
m_pMenu = new ListPopupMenu(this, Uml::lvt_Model);
m_pMenu->popup(me->globalPos());
- connect(m_pMenu, SIGNAL(activated(int)), this, SLOT(popupMenuSel(int)));
+ connect(m_pMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(popupMenuSel(int)));
return true;
}
- return QListView::eventFilter(o, e);
+ return TQListView::eventFilter(o, e);
}
-void UMLListView::contentsMousePressEvent(QMouseEvent *me) {
+void UMLListView::contentsMousePressEvent(TQMouseEvent *me) {
UMLView *currentView = UMLApp::app()->getCurrentView();
if (currentView)
currentView->clearSelected();
if( me -> state() != Qt::ShiftButton )
clearSelection();
- QPoint pt = this->QScrollView::contentsToViewport( me->pos() );
+ TQPoint pt = this->TQScrollView::contentsToViewport( me->pos() );
UMLListViewItem * item = (UMLListViewItem*)itemAt(pt);
const Qt::ButtonState button = me->button();
@@ -184,25 +184,25 @@ void UMLListView::contentsMousePressEvent(QMouseEvent *me) {
if (button == Qt::RightButton) {
if(m_pMenu != 0) {
m_pMenu->hide();
- disconnect(m_pMenu, SIGNAL(activated(int)), this, SLOT(popupMenuSel(int)));
+ disconnect(m_pMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(popupMenuSel(int)));
delete m_pMenu;
m_pMenu = 0;
}
const Uml::ListView_Type type = item->getType();
m_pMenu = new ListPopupMenu(this, type);
m_pMenu->popup(me->globalPos());
- connect(m_pMenu, SIGNAL(activated(int)), this, SLOT(popupMenuSel(int)));
+ connect(m_pMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(popupMenuSel(int)));
}//end if right button
this->KListView::contentsMousePressEvent(me);
}
-void UMLListView::contentsMouseReleaseEvent(QMouseEvent *me) {
+void UMLListView::contentsMouseReleaseEvent(TQMouseEvent *me) {
if (me->button() != Qt::LeftButton) {
this->KListView::contentsMouseReleaseEvent(me);
return;
}
- const QPoint pt = this->QScrollView::contentsToViewport( me->pos() );
+ const TQPoint pt = this->TQScrollView::contentsToViewport( me->pos() );
UMLListViewItem *item = dynamic_cast<UMLListViewItem*>(itemAt(pt));
if (item == NULL || !Model_Utils::typeIsDiagram(item->getType())) {
this->KListView::contentsMouseReleaseEvent(me);
@@ -215,7 +215,7 @@ void UMLListView::contentsMouseReleaseEvent(QMouseEvent *me) {
this->KListView::contentsMouseReleaseEvent(me);
}
-void UMLListView::keyPressEvent(QKeyEvent *ke) {
+void UMLListView::keyPressEvent(TQKeyEvent *ke) {
UMLView *view = UMLApp::app()->getCurrentView();
if (view && view->getSelectCount()) {
// Widgets have been selected in the diagram area,
@@ -232,7 +232,7 @@ void UMLListView::keyPressEvent(QKeyEvent *ke) {
deleteItem(dynamic_cast<UMLListViewItem*>(item));
}
} else {
- QListView::keyPressEvent(ke); // let parent handle it
+ TQListView::keyPressEvent(ke); // let parent handle it
}
}
}
@@ -247,7 +247,7 @@ void UMLListView::popupMenuSel(int sel) {
Uml::ListView_Type lvt = temp -> getType();
Uml::Object_Type umlType = Uml::ot_UMLObject;
ListPopupMenu::Menu_Type menuType = (ListPopupMenu::Menu_Type)sel;
- QString name;
+ TQString name;
switch (menuType) {
case ListPopupMenu::mt_Class:
@@ -343,21 +343,21 @@ void UMLListView::popupMenuSel(int sel) {
return;
}
// configure & show the file dialog
- const QString rootDir(m_doc->URL().directory());
+ const TQString rootDir(m_doc->URL().directory());
KFileDialog fileDialog(rootDir, "*.xml", this, ":externalize-folder", true);
fileDialog.setCaption(i18n("Externalize Folder"));
fileDialog.setOperationMode(KFileDialog::Other);
// set a sensible default filename
- QString defaultFilename = current->getText().lower();
- defaultFilename.replace(QRegExp("\\W+"), "_");
+ TQString defaultFilename = current->getText().lower();
+ defaultFilename.replace(TQRegExp("\\W+"), "_");
defaultFilename.append(".xml"); // default extension
fileDialog.setSelection(defaultFilename);
fileDialog.exec();
KURL selURL = fileDialog.selectedURL();
if (selURL.isEmpty())
return;
- QString path = selURL.path();
- QString fileName = path;
+ TQString path = selURL.path();
+ TQString fileName = path;
if (fileName.startsWith(rootDir)) {
fileName.remove(rootDir);
} else {
@@ -368,7 +368,7 @@ void UMLListView::popupMenuSel(int sel) {
<< rootDir << endl;
return;
}
- QFile file(path);
+ TQFile file(path);
// Warn if file exists.
if (file.exists()) {
// This should be done using a KMessageBox but we currently
@@ -387,8 +387,8 @@ void UMLListView::popupMenuSel(int sel) {
}
modelFolder->setFolderFile(fileName);
// Recompute text of the folder
- QString folderText = current->getText();
- folderText.remove( QRegExp("\\s*\\(.*$") );
+ TQString folderText = current->getText();
+ folderText.remove( TQRegExp("\\s*\\(.*$") );
folderText.append( " (" + fileName + ')' );
current->setText(folderText);
break;
@@ -402,10 +402,10 @@ void UMLListView::popupMenuSel(int sel) {
kError() << "UMLListView::popupMenuSel: modelFolder is NULL" << endl;
return;
}
- modelFolder->setFolderFile(QString::null);
+ modelFolder->setFolderFile(TQString::null);
// Recompute text of the folder
- QString folderText = current->getText();
- folderText.remove( QRegExp("\\s*\\(.*$") );
+ TQString folderText = current->getText();
+ folderText.remove( TQRegExp("\\s*\\(.*$") );
current->setText(folderText);
break;
}
@@ -413,7 +413,7 @@ void UMLListView::popupMenuSel(int sel) {
case ListPopupMenu::mt_Model:
{
bool ok = false;
- QString name = KInputDialog::getText( i18n("Enter Model Name"),
+ TQString name = KInputDialog::getText( i18n("Enter Model Name"),
i18n("Enter the new name of the model:"),
m_doc->getName(), &ok, UMLApp::app() );
if (ok) {
@@ -660,10 +660,10 @@ void UMLListView::slotObjectCreated(UMLObject* object) {
connectNewObjectsSlots(object);
const Uml::ListView_Type lvt = Model_Utils::convert_OT_LVT(object);
- QString name = object->getName();
+ TQString name = object->getName();
if (type == Uml::ot_Folder) {
UMLFolder *f = static_cast<UMLFolder*>(object);
- QString folderFile = f->getFolderFile();
+ TQString folderFile = f->getFolderFile();
if (!folderFile.isEmpty())
name.append(" (" + folderFile + ')');
}
@@ -692,40 +692,40 @@ void UMLListView::connectNewObjectsSlots(UMLObject* object) {
case Uml::ot_Interface:
{
UMLClassifier *c = static_cast<UMLClassifier*>(object);
- connect(c, SIGNAL(attributeAdded(UMLClassifierListItem*)),
- this, SLOT(childObjectAdded(UMLClassifierListItem*)));
- connect(c, SIGNAL(attributeRemoved(UMLClassifierListItem*)),
- this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
- connect(c, SIGNAL(operationAdded(UMLClassifierListItem*)),
- this, SLOT(childObjectAdded(UMLClassifierListItem*)));
- connect(c, SIGNAL(operationRemoved(UMLClassifierListItem*)),
- this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
- connect(c, SIGNAL(templateAdded(UMLClassifierListItem*)),
- this, SLOT(childObjectAdded(UMLClassifierListItem*)));
- connect(c, SIGNAL(templateRemoved(UMLClassifierListItem*)),
- this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
- connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
+ connect(c, TQT_SIGNAL(attributeAdded(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectAdded(UMLClassifierListItem*)));
+ connect(c, TQT_SIGNAL(attributeRemoved(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectRemoved(UMLClassifierListItem*)));
+ connect(c, TQT_SIGNAL(operationAdded(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectAdded(UMLClassifierListItem*)));
+ connect(c, TQT_SIGNAL(operationRemoved(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectRemoved(UMLClassifierListItem*)));
+ connect(c, TQT_SIGNAL(templateAdded(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectAdded(UMLClassifierListItem*)));
+ connect(c, TQT_SIGNAL(templateRemoved(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectRemoved(UMLClassifierListItem*)));
+ connect(object,TQT_SIGNAL(modified()),this,TQT_SLOT(slotObjectChanged()));
}
break;
case Uml::ot_Enum:
{
UMLEnum *e = static_cast<UMLEnum*>(object);
- connect(e, SIGNAL(enumLiteralAdded(UMLClassifierListItem*)),
- this, SLOT(childObjectAdded(UMLClassifierListItem*)));
- connect(e, SIGNAL(enumLiteralRemoved(UMLClassifierListItem*)),
- this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
+ connect(e, TQT_SIGNAL(enumLiteralAdded(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectAdded(UMLClassifierListItem*)));
+ connect(e, TQT_SIGNAL(enumLiteralRemoved(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectRemoved(UMLClassifierListItem*)));
}
- connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
+ connect(object,TQT_SIGNAL(modified()),this,TQT_SLOT(slotObjectChanged()));
break;
case Uml::ot_Entity:
{
UMLEntity *ent = static_cast<UMLEntity*>(object);
- connect(ent, SIGNAL(entityAttributeAdded(UMLClassifierListItem*)),
- this, SLOT(childObjectAdded(UMLClassifierListItem*)));
- connect(ent, SIGNAL(entityAttributeRemoved(UMLClassifierListItem*)),
- this, SLOT(childObjectRemoved(UMLClassifierListItem*)));
+ connect(ent, TQT_SIGNAL(entityAttributeAdded(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectAdded(UMLClassifierListItem*)));
+ connect(ent, TQT_SIGNAL(entityAttributeRemoved(UMLClassifierListItem*)),
+ this, TQT_SLOT(childObjectRemoved(UMLClassifierListItem*)));
}
- connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
+ connect(object,TQT_SIGNAL(modified()),this,TQT_SLOT(slotObjectChanged()));
break;
case Uml::ot_Datatype:
case Uml::ot_Attribute:
@@ -740,7 +740,7 @@ void UMLListView::connectNewObjectsSlots(UMLObject* object) {
case Uml::ot_Artifact:
case Uml::ot_Node:
case Uml::ot_Folder:
- connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
+ connect(object,TQT_SIGNAL(modified()),this,TQT_SLOT(slotObjectChanged()));
break;
case Uml::ot_UMLObject:
case Uml::ot_Association:
@@ -771,7 +771,7 @@ void UMLListView::childObjectAdded(UMLClassifierListItem* obj) {
void UMLListView::childObjectAdded(UMLClassifierListItem* child, UMLClassifier* parent) {
if (m_bCreatingChildObject)
return;
- const QString text = child->toString(Uml::st_SigNoVis);
+ const TQString text = child->toString(Uml::st_SigNoVis);
UMLListViewItem *childItem = NULL;
UMLListViewItem *parentItem = findUMLObject(parent);
if (parentItem == NULL) {
@@ -826,18 +826,18 @@ void UMLListView::setDocument(UMLDoc *d) {
}
m_doc = d;
- connect(m_doc, SIGNAL(sigDiagramCreated(Uml::IDType)), this, SLOT(slotDiagramCreated(Uml::IDType)));
- connect(m_doc, SIGNAL(sigDiagramRemoved(Uml::IDType)), this, SLOT(slotDiagramRemoved(Uml::IDType)));
- connect(m_doc, SIGNAL(sigDiagramRenamed(Uml::IDType)), this, SLOT(slotDiagramRenamed(Uml::IDType)));
- connect(m_doc, SIGNAL(sigObjectCreated(UMLObject *)), this, SLOT(slotObjectCreated(UMLObject *)));
- connect(m_doc, SIGNAL(sigObjectRemoved(UMLObject *)), this, SLOT(slotObjectRemoved(UMLObject *)));
+ connect(m_doc, TQT_SIGNAL(sigDiagramCreated(Uml::IDType)), this, TQT_SLOT(slotDiagramCreated(Uml::IDType)));
+ connect(m_doc, TQT_SIGNAL(sigDiagramRemoved(Uml::IDType)), this, TQT_SLOT(slotDiagramRemoved(Uml::IDType)));
+ connect(m_doc, TQT_SIGNAL(sigDiagramRenamed(Uml::IDType)), this, TQT_SLOT(slotDiagramRenamed(Uml::IDType)));
+ connect(m_doc, TQT_SIGNAL(sigObjectCreated(UMLObject *)), this, TQT_SLOT(slotObjectCreated(UMLObject *)));
+ connect(m_doc, TQT_SIGNAL(sigObjectRemoved(UMLObject *)), this, TQT_SLOT(slotObjectRemoved(UMLObject *)));
}
void UMLListView::slotObjectRemoved(UMLObject* object) {
if (m_doc->loading()) { //needed for class wizard
return;
}
- disconnect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));
+ disconnect(object,TQT_SIGNAL(modified()),this,TQT_SLOT(slotObjectChanged()));
UMLListViewItem* item = findItem(object->getID());
delete item;
UMLApp::app()->getDocWindow()->updateDocumentation(true);
@@ -849,7 +849,7 @@ void UMLListView::slotDiagramRemoved(Uml::IDType id) {
UMLApp::app()->getDocWindow()->updateDocumentation(true);
}
-QDragObject* UMLListView::dragObject() {
+TQDragObject* UMLListView::dragObject() {
UMLListViewItemList selecteditems;
getSelectedItems(selecteditems);
selecteditems.setAutoDelete( false );
@@ -872,7 +872,7 @@ QDragObject* UMLListView::dragObject() {
}
void UMLListView::startDrag() {
- QDragObject *o = dragObject();
+ TQDragObject *o = dragObject();
if (o)
o->dragCopy();
}
@@ -987,7 +987,7 @@ UMLListViewItem* UMLListView::recursiveSearchForView(UMLListViewItem* listViewIt
UMLListViewItem* UMLListView::findItem(Uml::IDType id) {
UMLListViewItem *temp;
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
for( ; (temp = (UMLListViewItem*)it.current()); ++it ) {
UMLListViewItem * item = temp->findItem(id);
if (item)
@@ -1039,7 +1039,7 @@ void UMLListView::setView(UMLView * v) {
setSelected(temp, true);
}
-void UMLListView::contentsMouseDoubleClickEvent(QMouseEvent * me) {
+void UMLListView::contentsMouseDoubleClickEvent(TQMouseEvent * me) {
UMLListViewItem * item = static_cast<UMLListViewItem *>( currentItem() );
if( !item || me -> button() != Qt::LeftButton )
return;
@@ -1079,8 +1079,8 @@ void UMLListView::contentsMouseDoubleClickEvent(QMouseEvent * me) {
}
-bool UMLListView::acceptDrag(QDropEvent* event) const {
- QPoint mousePoint = ((UMLListView*)this)->contentsToViewport( event->pos() );
+bool UMLListView::acceptDrag(TQDropEvent* event) const {
+ TQPoint mousePoint = ((UMLListView*)this)->contentsToViewport( event->pos() );
UMLListViewItem* item = (UMLListViewItem*)itemAt(mousePoint);
if(!item) {
@@ -1088,7 +1088,7 @@ bool UMLListView::acceptDrag(QDropEvent* event) const {
<< endl;
return false;
}
- ((QListView*)this)->setCurrentItem( (QListViewItem*)item );
+ ((TQListView*)this)->setCurrentItem( (TQListViewItem*)item );
UMLDrag::LvTypeAndID_List list;
if (! UMLDrag::getClip3TypeAndID(event, list)) {
@@ -1429,7 +1429,7 @@ UMLListViewItem * UMLListView::moveObject(Uml::IDType srcId, Uml::ListView_Type
// We can't use the existing 'att' directly
// because its parent is fixed to the old classifier
// and we have no way of changing that:
- // QObject does not permit changing the parent().
+ // TQObject does not permit changing the parent().
if (att == NULL) {
kError() << "moveObject internal error: srcObj "
<< srcObj->getName() << " is not a UMLAttribute" << endl;
@@ -1437,7 +1437,7 @@ UMLListViewItem * UMLListView::moveObject(Uml::IDType srcId, Uml::ListView_Type
kError() << "moveObject: oldParentClassifier->takeItem(att "
<< att->getName() << ") returns NULL" << endl;
} else {
- const QString& nm = att->getName();
+ const TQString& nm = att->getName();
UMLAttribute *newAtt = newParentClassifier->createAttribute(nm,
att->getType(),
att->getVisibility(),
@@ -1456,7 +1456,7 @@ UMLListViewItem * UMLListView::moveObject(Uml::IDType srcId, Uml::ListView_Type
// We can't use the existing 'op' directly
// because its parent is fixed to the old classifier
// and we have no way of changing that:
- // QObject does not permit changing the parent().
+ // TQObject does not permit changing the parent().
if (op && oldParentClassifier->takeItem(op) != -1) {
bool isExistingOp;
Model_Utils::NameAndType_List ntDummyList;
@@ -1502,7 +1502,7 @@ UMLListViewItem * UMLListView::moveObject(Uml::IDType srcId, Uml::ListView_Type
return newItem;
}
-void UMLListView::slotDropped(QDropEvent* de, QListViewItem* /* parent */, QListViewItem* item) {
+void UMLListView::slotDropped(TQDropEvent* de, TQListViewItem* /* parent */, TQListViewItem* item) {
item = (UMLListViewItem *)currentItem();
if(!item) {
kDebug() << "UMLListView::slotDropped: item is NULL - doing nothing" << endl;
@@ -1524,7 +1524,7 @@ void UMLListView::slotDropped(QDropEvent* de, QListViewItem* /* parent */, QList
int UMLListView::getSelectedItems(UMLListViewItemList &ItemList) {
ItemList.setAutoDelete( false );
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
// iterate through all items of the list view
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
@@ -1539,7 +1539,7 @@ int UMLListView::getSelectedItems(UMLListViewItemList &ItemList) {
int UMLListView::getSelectedItemsRoot(UMLListViewItemList &ItemList) {
ItemList.setAutoDelete( false );
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
// iterate through all items of the list view
for ( ; it.current(); ++it ) {
@@ -1702,7 +1702,7 @@ UMLListViewItem* UMLListView::determineParentItem(Uml::ListView_Type lvt) const
}
int UMLListView::getSelectedCount() {
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
int count = 0;
// iterate through all items of the list view
for ( ; it.current(); ++it ) {
@@ -1714,15 +1714,15 @@ int UMLListView::getSelectedCount() {
return count;
}
-void UMLListView::focusOutEvent ( QFocusEvent * fe) {
- QFocusEvent::Reason reason = fe->reason();
- if (reason != QFocusEvent::Popup) {
+void UMLListView::focusOutEvent ( TQFocusEvent * fe) {
+ TQFocusEvent::Reason reason = fe->reason();
+ if (reason != TQFocusEvent::Popup) {
clearSelection();
triggerUpdate();
}
//repaint();
- QListView::focusOutEvent(fe);
+ TQListView::focusOutEvent(fe);
}
Uml::ListView_Type UMLListView::rootViewType(UMLListViewItem *item) {
@@ -1744,7 +1744,7 @@ Uml::ListView_Type UMLListView::rootViewType(UMLListViewItem *item) {
return Uml::lvt_Unknown;
}
-QPixmap & UMLListView::getPixmap(Uml::Icon_Type type) {
+TQPixmap & UMLListView::getPixmap(Uml::Icon_Type type) {
if (type < Uml::it_Home || type >= Uml::N_ICONTYPES) {
kWarning() << "getPixmap() called on unknown icon " << type << endl;
// you'll know you have a problem if this shows up in the list
@@ -1755,7 +1755,7 @@ QPixmap & UMLListView::getPixmap(Uml::Icon_Type type) {
void UMLListView::loadPixmaps() {
KStandardDirs * dirs = KGlobal::dirs();
- QString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png");
+ TQString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png");
dataDir += "/umbrello/pics/";
#define makeBarIcon(iconType, barIcon) m_Pixmaps[iconType] = BarIcon(barIcon)
@@ -1823,13 +1823,13 @@ bool UMLListView::isExpandable(Uml::ListView_Type lvt) {
return false;
}
-void UMLListView::slotExpanded( QListViewItem * item ) {
+void UMLListView::slotExpanded( TQListViewItem * item ) {
UMLListViewItem * myItem= static_cast<UMLListViewItem*>(item);
if (isExpandable(myItem->getType()))
myItem->updateFolder();
}
-void UMLListView::slotCollapsed( QListViewItem * item ) {
+void UMLListView::slotCollapsed( TQListViewItem * item ) {
UMLListViewItem * myItem = static_cast<UMLListViewItem*>(item);
if (isExpandable(myItem->getType()))
myItem->updateFolder();
@@ -1853,7 +1853,7 @@ void UMLListView::addNewItem(UMLListViewItem *parentItem, Uml::ListView_Type typ
Uml::Icon_Type icon = Model_Utils::convert_LVT_IT(type);
- QString name;
+ TQString name;
if (Model_Utils::typeIsDiagram(type)) {
Uml::Diagram_Type dt = Model_Utils::convert_LVT_DT(type);
name = getUniqueDiagramName(dt);
@@ -1884,12 +1884,12 @@ void UMLListView::addNewItem(UMLListViewItem *parentItem, Uml::ListView_Type typ
newItem->setIcon( icon );
newItem->setOpen( true );
newItem->setCreating( true );
- newItem->startRename( 0 ); // calls QListView::ensureItemVisible()
+ newItem->startRename( 0 ); // calls TQListView::ensureItemVisible()
// When the user accepts the rename operation, UMLListViewItem::okRename()
- // is called (automatically by QListViewItem.)
+ // is called (automatically by TQListViewItem.)
}
-bool UMLListView::itemRenamed( QListViewItem * item , int /*col*/ ) {
+bool UMLListView::itemRenamed( TQListViewItem * item , int /*col*/ ) {
//if true the item was cancel before this message
if( m_bIgnoreCancelRename ) {
return true;
@@ -1897,11 +1897,11 @@ bool UMLListView::itemRenamed( QListViewItem * item , int /*col*/ ) {
m_bIgnoreCancelRename = true;
UMLListViewItem * renamedItem = static_cast< UMLListViewItem *>( item ) ;
Uml::ListView_Type type = renamedItem -> getType();
- QString newText = renamedItem -> text( 0 );
+ TQString newText = renamedItem -> text( 0 );
renamedItem -> setCreating( false );
// If the type is empty then delete it.
- if (newText.isEmpty() || newText.contains(QRegExp("^\\s+$"))) {
+ if (newText.isEmpty() || newText.contains(TQRegExp("^\\s+$"))) {
KMessageBox::error(
kapp -> mainWidget(),
i18n( "The name you entered was invalid.\nCreation process has been canceled." ),
@@ -2010,7 +2010,7 @@ bool UMLListView::itemRenamed( QListViewItem * item , int /*col*/ ) {
}
UMLObject *UMLListView::createUMLObject( UMLListViewItem * item, Uml::Object_Type type ) {
- QString name = item -> text( 0 );
+ TQString name = item -> text( 0 );
UMLObject * object = NULL;
switch( type ) {
case Uml::ot_UseCase:
@@ -2093,7 +2093,7 @@ UMLObject *UMLListView::createUMLObject( UMLListViewItem * item, Uml::Object_Typ
bool UMLListView::createChildUMLObject( UMLListViewItem * item, Uml::Object_Type type ) {
m_bCreatingChildObject = true;
- QString text = item->text( 0 );
+ TQString text = item->text( 0 );
UMLObject* parent = static_cast<UMLListViewItem *>( item->parent() )->getUMLObject();
if( !parent ) {
kError() << "UMLListView::createChildUMLObject: parent UMLObject is NULL" << endl;
@@ -2193,7 +2193,7 @@ bool UMLListView::createChildUMLObject( UMLListViewItem * item, Uml::Object_Type
}
void UMLListView::createDiagram( UMLListViewItem * item, Uml::Diagram_Type type ) {
- QString name = item -> text( 0 );
+ TQString name = item -> text( 0 );
UMLView * view = m_doc -> findView( type, name );
if( view ) {
delete item;
@@ -2219,11 +2219,11 @@ void UMLListView::createDiagram( UMLListViewItem * item, Uml::Diagram_Type type
m_doc -> changeCurrentView( view -> getID() );
}
-QString UMLListView::getUniqueDiagramName(Uml::Diagram_Type type) {
+TQString UMLListView::getUniqueDiagramName(Uml::Diagram_Type type) {
return m_doc->uniqViewName(type);
}
-bool UMLListView::isUnique( UMLListViewItem * item, const QString &name ) {
+bool UMLListView::isUnique( UMLListViewItem * item, const TQString &name ) {
UMLListViewItem * parentItem = static_cast<UMLListViewItem *>( item -> parent() );
Uml::ListView_Type type = item -> getType();
switch( type ) {
@@ -2314,32 +2314,32 @@ bool UMLListView::isUnique( UMLListViewItem * item, const QString &name ) {
return false;
}
-void UMLListView::cancelRename( QListViewItem * item ) {
+void UMLListView::cancelRename( TQListViewItem * item ) {
if( !m_bIgnoreCancelRename ) {
delete item;
m_bIgnoreCancelRename = true;
}
}
-void UMLListView::saveToXMI( QDomDocument & qDoc, QDomElement & qElement) {
- QDomElement listElement = qDoc.createElement( "listview" );
+void UMLListView::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement) {
+ TQDomElement listElement = qDoc.createElement( "listview" );
m_rv->saveToXMI(qDoc, listElement);
qElement.appendChild( listElement );
}
-bool UMLListView::loadFromXMI( QDomElement & element ) {
+bool UMLListView::loadFromXMI( TQDomElement & element ) {
/*
deleteChildrenOf( m_ucv );
deleteChildrenOf( m_lv );
deleteChildrenOf( m_cmpv );
deleteChildrenOf( m_dplv );
*/
- QDomNode node = element.firstChild();
- QDomElement domElement = node.toElement();
+ TQDomNode node = element.firstChild();
+ TQDomElement domElement = node.toElement();
m_doc->writeToStatusBar( i18n("Loading listview...") );
while( !domElement.isNull() ) {
if( domElement.tagName() == "listitem" ) {
- QString type = domElement.attribute( "type", "-1" );
+ TQString type = domElement.attribute( "type", "-1" );
if( type == "-1" )
return false;
Uml::ListView_Type lvType = (Uml::ListView_Type)type.toInt();
@@ -2356,20 +2356,20 @@ bool UMLListView::loadFromXMI( QDomElement & element ) {
return true;
}
-bool UMLListView::loadChildrenFromXMI( UMLListViewItem * parent, QDomElement & element ) {
- QDomNode node = element.firstChild();
- QDomElement domElement = node.toElement();
- const QString pfx("UMLListView::loadChildrenFromXMI: ");
+bool UMLListView::loadChildrenFromXMI( UMLListViewItem * parent, TQDomElement & element ) {
+ TQDomNode node = element.firstChild();
+ TQDomElement domElement = node.toElement();
+ const TQString pfx("UMLListView::loadChildrenFromXMI: ");
while( !domElement.isNull() ) {
node = domElement.nextSibling();
if( domElement.tagName() != "listitem" ) {
domElement = node.toElement();
continue;
}
- QString id = domElement.attribute( "id", "-1" );
- QString type = domElement.attribute( "type", "-1" );
- QString label = domElement.attribute( "label", "" );
- QString open = domElement.attribute( "open", "1" );
+ TQString id = domElement.attribute( "id", "-1" );
+ TQString type = domElement.attribute( "type", "-1" );
+ TQString label = domElement.attribute( "label", "" );
+ TQString open = domElement.attribute( "open", "1" );
if( type == "-1" )
return false;
Uml::ListView_Type lvType = (Uml::ListView_Type)type.toInt();
@@ -2580,14 +2580,14 @@ bool UMLListView::loadChildrenFromXMI( UMLListViewItem * parent, QDomElement & e
}
/** Open all items in the list view*/
-void UMLListView::expandAll(QListViewItem *item) {
+void UMLListView::expandAll(TQListViewItem *item) {
if(!item) item = firstChild();
for (item = item->firstChild(); item; item = item->nextSibling()) {
item->setOpen(true);
}
}
/** Close all items in the list view*/
-void UMLListView::collapseAll(QListViewItem *item) {
+void UMLListView::collapseAll(TQListViewItem *item) {
if(!item) item = firstChild();
for( item = item->firstChild(); item; item = item->nextSibling())
item->setOpen(false);
@@ -2635,7 +2635,7 @@ UMLListViewItem *UMLListView::rootView(Uml::ListView_Type type) {
return theView;
}
-void UMLListView::deleteChildrenOf(QListViewItem* parent) {
+void UMLListView::deleteChildrenOf(TQListViewItem* parent) {
if ( !parent ) {
return;
}