diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /umbrello/umbrello/umlobject.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/umlobject.cpp')
-rw-r--r-- | umbrello/umbrello/umlobject.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/umbrello/umbrello/umlobject.cpp b/umbrello/umbrello/umlobject.cpp index e28ed7da..85de579f 100644 --- a/umbrello/umbrello/umlobject.cpp +++ b/umbrello/umbrello/umlobject.cpp @@ -12,7 +12,7 @@ // own header #include "umlobject.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> #include <kapplication.h> // app includes @@ -30,8 +30,8 @@ #include "docwindow.h" #include "dialogs/classpropdlg.h" -UMLObject::UMLObject(const UMLObject * parent, const QString &name, Uml::IDType id) - : QObject(const_cast<UMLObject*>(parent), "UMLObject" ) { +UMLObject::UMLObject(const UMLObject * parent, const TQString &name, Uml::IDType id) + : TQObject(const_cast<UMLObject*>(parent), "UMLObject" ) { init(); if (id == Uml::id_None) m_nId = UniqueID::gen(); @@ -40,8 +40,8 @@ UMLObject::UMLObject(const UMLObject * parent, const QString &name, Uml::IDType m_Name = name; } -UMLObject::UMLObject(const QString &name, Uml::IDType id) - : QObject(UMLApp::app()->getDocument()) { +UMLObject::UMLObject(const TQString &name, Uml::IDType id) + : TQObject(UMLApp::app()->getDocument()) { init(); if (id == Uml::id_None) m_nId = UniqueID::gen(); @@ -51,7 +51,7 @@ UMLObject::UMLObject(const QString &name, Uml::IDType id) } UMLObject::UMLObject(const UMLObject * parent) - : QObject(const_cast<UMLObject*>(parent)) { + : TQObject(const_cast<UMLObject*>(parent)) { init(); } @@ -76,7 +76,7 @@ void UMLObject::init() { bool UMLObject::showProperties(int page, bool assoc) { DocWindow *docwindow = UMLApp::app()->getDocWindow(); docwindow->updateDocumentation(false); - ClassPropDlg* dlg = new ClassPropDlg((QWidget*)UMLApp::app(), this, page, assoc); + ClassPropDlg* dlg = new ClassPropDlg((TQWidget*)UMLApp::app(), this, page, assoc); bool modified = false; if (dlg->exec()) { docwindow->showDocumentation(this, true); @@ -97,18 +97,18 @@ void UMLObject::setID(Uml::IDType NewID) { emitModified(); } -void UMLObject::setName(const QString &strName) { +void UMLObject::setName(const TQString &strName) { m_Name = strName; emitModified(); } -QString UMLObject::getName() const { +TQString UMLObject::getName() const { return m_Name; } -QString UMLObject::getFullyQualifiedName(const QString& separator, +TQString UMLObject::getFullyQualifiedName(const TQString& separator, bool includeRoot /* = false */) const { - QString fqn; + TQString fqn; if (m_pUMLPackage) { bool skipPackage = false; if (!includeRoot) { @@ -118,7 +118,7 @@ QString UMLObject::getFullyQualifiedName(const QString& separator, skipPackage = true; } if (!skipPackage) { - QString tempSeparator = separator; + TQString tempSeparator = separator; if (tempSeparator.isEmpty()) tempSeparator = UMLApp::app()->activeLanguageScopeSeparator(); fqn = m_pUMLPackage->getFullyQualifiedName(tempSeparator, includeRoot); @@ -200,7 +200,7 @@ void UMLObject::copyInto(UMLObject *rhs) const // Create a new ID. rhs->m_nId = UniqueID::gen(); - // Hope that the parent from QObject is okay. + // Hope that the parent from TQObject is okay. if (rhs->parent() != parent()) kDebug() << "copyInto has a wrong parent" << endl; } @@ -238,7 +238,7 @@ void UMLObject::emitModified() emit modified(); } -void UMLObject::setDoc(const QString &d) { +void UMLObject::setDoc(const TQString &d) { m_Doc = d; //emit modified(); No, this is done centrally at DocWindow::updateDocumentation() } @@ -255,7 +255,7 @@ Uml::IDType UMLObject::getID() const { return m_nId; } -QString UMLObject::getDoc() const { +TQString UMLObject::getDoc() const { return m_Doc; } @@ -287,7 +287,7 @@ void UMLObject::setUMLStereotype(UMLStereotype *stereo) { emitModified(); } -void UMLObject::setStereotype(const QString &_name) { +void UMLObject::setStereotype(const TQString &_name) { if (_name.isEmpty()) { setUMLStereotype(NULL); return; @@ -297,7 +297,7 @@ void UMLObject::setStereotype(const QString &_name) { setUMLStereotype(s); } -void UMLObject::setPackage(const QString &_name) { +void UMLObject::setPackage(const TQString &_name) { UMLObject *pkgObj = NULL; if (!_name.isEmpty()) { UMLDoc* umldoc = UMLApp::app()->getDocument(); @@ -329,23 +329,23 @@ const UMLStereotype * UMLObject::getUMLStereotype() { return m_pStereotype; } -QString UMLObject::getStereotype(bool includeAdornments /* = false */) const { +TQString UMLObject::getStereotype(bool includeAdornments /* = false */) const { if (m_pStereotype == NULL) return ""; - QString name = m_pStereotype->getName(); + TQString name = m_pStereotype->getName(); if (includeAdornments) - name = QString::fromUtf8("«") + name + QString::fromUtf8("»"); + name = TQString::fromUtf8("«") + name + TQString::fromUtf8("»"); return name; } -QString UMLObject::getPackage(const QString& separator, bool includeRoot) { - QString tempSeparator = separator; +TQString UMLObject::getPackage(const TQString& separator, bool includeRoot) { + TQString tempSeparator = separator; if (tempSeparator.isEmpty()) tempSeparator = UMLApp::app()->activeLanguageScopeSeparator(); - QString fqn = getFullyQualifiedName(tempSeparator, includeRoot); + TQString fqn = getFullyQualifiedName(tempSeparator, includeRoot); if (!fqn.contains(tempSeparator)) return ""; - QString scope = fqn.left(fqn.length() - tempSeparator.length() - m_Name.length()); + TQString scope = fqn.left(fqn.length() - tempSeparator.length() - m_Name.length()); return scope; } @@ -365,19 +365,19 @@ UMLPackage* UMLObject::getUMLPackage() { return m_pUMLPackage; } -QString UMLObject::getSecondaryId() const { +TQString UMLObject::getSecondaryId() const { return m_SecondaryId; } -void UMLObject::setSecondaryId(const QString& id) { +void UMLObject::setSecondaryId(const TQString& id) { m_SecondaryId = id; } -QString UMLObject::getSecondaryFallback() const { +TQString UMLObject::getSecondaryFallback() const { return m_SecondaryFallback; } -void UMLObject::setSecondaryFallback(const QString& id) { +void UMLObject::setSecondaryFallback(const TQString& id) { m_SecondaryFallback = id; } @@ -490,12 +490,12 @@ bool UMLObject::resolveRef() { return true; } -QDomElement UMLObject::save( const QString &tag, QDomDocument & qDoc ) { +TQDomElement UMLObject::save( const TQString &tag, TQDomDocument & qDoc ) { /* Call as the first action of saveToXMI() in child class: - This creates the QDomElement with which to work. + This creates the TQDomElement with which to work. */ - QDomElement qElement = qDoc.createElement(tag); + TQDomElement qElement = qDoc.createElement(tag); qElement.setAttribute( "isSpecification", "false" ); if (m_BaseType != Uml::ot_Association && m_BaseType != Uml::ot_Role && @@ -525,7 +525,7 @@ QDomElement UMLObject::save( const QString &tag, QDomDocument & qDoc ) { if (m_pUMLPackage) //FIXME: uml13.dtd compliance qElement.setAttribute( "package", m_pUMLPackage->getID() ); #endif - QString visibility = m_Vis.toString(false); + TQString visibility = m_Vis.toString(false); qElement.setAttribute( "visibility", visibility); if (m_pStereotype != NULL) qElement.setAttribute( "stereotype", ID2STR(m_pStereotype->getID()) ); @@ -537,25 +537,25 @@ QDomElement UMLObject::save( const QString &tag, QDomDocument & qDoc ) { return qElement; } -bool UMLObject::load( QDomElement& ) { +bool UMLObject::load( TQDomElement& ) { // This body is not usually executed because child classes // overwrite the load method. return true; } -bool UMLObject::loadStereotype(QDomElement & element) { - QString tag = element.tagName(); +bool UMLObject::loadStereotype(TQDomElement & element) { + TQString tag = element.tagName(); if (!Uml::tagEq(tag, "stereotype")) return false; - QString stereo = element.attribute("xmi.value", ""); + TQString stereo = element.attribute("xmi.value", ""); if (stereo.isEmpty() && element.hasChildNodes()) { /* like so: <UML:ModelElement.stereotype> <UML:Stereotype xmi.idref = '07CD'/> </UML:ModelElement.stereotype> */ - QDomNode stereoNode = element.firstChild(); - QDomElement stereoElem = stereoNode.toElement(); + TQDomNode stereoNode = element.firstChild(); + TQDomElement stereoElem = stereoNode.toElement(); tag = stereoElem.tagName(); if (Uml::tagEq(tag, "Stereotype")) { stereo = stereoElem.attribute("xmi.idref", ""); @@ -573,7 +573,7 @@ bool UMLObject::loadStereotype(QDomElement & element) { return true; } -bool UMLObject::loadFromXMI( QDomElement & element) { +bool UMLObject::loadFromXMI( TQDomElement & element) { UMLDoc* umldoc = UMLApp::app()->getDocument(); if (umldoc == NULL) { kError() << "UMLObject::loadFromXMI: umldoc is NULL" << endl; @@ -582,7 +582,7 @@ bool UMLObject::loadFromXMI( QDomElement & element) { // Read the name first so that if we encounter a problem, the error // message can say the name. m_Name = element.attribute( "name", "" ); - QString id = element.attribute( "xmi.id", "" ); + TQString id = element.attribute( "xmi.id", "" ); if (id.isEmpty() || id == "-1") { if (m_BaseType == Uml::ot_Role) { // Before version 1.4, Umbrello did not save the xmi.id @@ -616,7 +616,7 @@ bool UMLObject::loadFromXMI( QDomElement & element) { m_Vis = Uml::Visibility::Public; if (element.hasAttribute("scope")) { // for bkwd compat. - QString scope = element.attribute( "scope", "" ); + TQString scope = element.attribute( "scope", "" ); if (scope == "instance_level") // nsuml compat. m_bStatic = false; else if (scope == "classifier_level") // nsuml compat. @@ -630,7 +630,7 @@ bool UMLObject::loadFromXMI( QDomElement & element) { << "): illegal scope" << endl; // soft error } } else { - QString visibility = element.attribute( "visibility", "public" ); + TQString visibility = element.attribute( "visibility", "public" ); if (visibility == "private" || visibility == "private_vis") // for compatibility with other programs m_Vis = Uml::Visibility::Private; @@ -641,7 +641,7 @@ bool UMLObject::loadFromXMI( QDomElement & element) { m_Vis = Uml::Visibility::Implementation; } - QString stereo = element.attribute( "stereotype", "" ); + TQString stereo = element.attribute( "stereotype", "" ); if (!stereo.isEmpty()) { Uml::IDType stereoID = STR2ID(stereo); m_pStereotype = umldoc->findStereotypeById(stereoID); @@ -656,36 +656,36 @@ bool UMLObject::loadFromXMI( QDomElement & element) { } if( element.hasAttribute("abstract") ) { // for bkwd compat. - QString abstract = element.attribute( "abstract", "0" ); + TQString abstract = element.attribute( "abstract", "0" ); m_bAbstract = (bool)abstract.toInt(); } else { - QString isAbstract = element.attribute( "isAbstract", "false" ); + TQString isAbstract = element.attribute( "isAbstract", "false" ); m_bAbstract = (isAbstract == "true"); } if( element.hasAttribute("static") ) { // for bkwd compat. - QString staticScope = element.attribute( "static", "0" ); + TQString staticScope = element.attribute( "static", "0" ); m_bStatic = (bool)staticScope.toInt(); } else { - QString ownerScope = element.attribute( "ownerScope", "instance" ); + TQString ownerScope = element.attribute( "ownerScope", "instance" ); m_bStatic = (ownerScope == "classifier"); } // If the node has child nodes, check whether attributes can be // extracted from them. if (element.hasChildNodes()) { - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); if (node.isComment()) node = node.nextSibling(); - QDomElement elem = node.toElement(); + TQDomElement elem = node.toElement(); while( !elem.isNull() ) { - QString tag = elem.tagName(); + TQString tag = elem.tagName(); if (Uml::tagEq(tag, "name")) { m_Name = elem.attribute("xmi.value", ""); if (m_Name.isEmpty()) m_Name = elem.text(); } else if (Uml::tagEq(tag, "visibility")) { - QString vis = elem.attribute("xmi.value", ""); + TQString vis = elem.attribute("xmi.value", ""); if (vis.isEmpty()) vis = elem.text(); if (vis == "private" || vis == "private_vis") @@ -695,12 +695,12 @@ bool UMLObject::loadFromXMI( QDomElement & element) { else if (vis == "implementation") m_Vis = Uml::Visibility::Implementation; } else if (Uml::tagEq(tag, "isAbstract")) { - QString isAbstract = elem.attribute("xmi.value", ""); + TQString isAbstract = elem.attribute("xmi.value", ""); if (isAbstract.isEmpty()) isAbstract = elem.text(); m_bAbstract = (isAbstract == "true"); } else if (Uml::tagEq(tag, "ownerScope")) { - QString ownerScope = elem.attribute("xmi.value", ""); + TQString ownerScope = elem.attribute("xmi.value", ""); if (ownerScope.isEmpty()) ownerScope = elem.text(); m_bStatic = (ownerScope == "classifier"); |