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/attribute.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/attribute.cpp')
-rw-r--r-- | umbrello/umbrello/attribute.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/umbrello/umbrello/attribute.cpp b/umbrello/umbrello/attribute.cpp index 3bdadeb7..9266c1f4 100644 --- a/umbrello/umbrello/attribute.cpp +++ b/umbrello/umbrello/attribute.cpp @@ -12,7 +12,7 @@ // own header #include "attribute.h" // qt/kde includes -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> // app includes #include "classifier.h" @@ -24,9 +24,9 @@ #include "object_factory.h" UMLAttribute::UMLAttribute( const UMLObject *parent, - const QString& name, Uml::IDType id, + const TQString& name, Uml::IDType id, Uml::Visibility s, - UMLObject *type, const QString& iv ) + UMLObject *type, const TQString& iv ) : UMLClassifierListItem(parent, name, id) { m_InitialValue = iv; m_BaseType = Uml::ot_Attribute; @@ -48,7 +48,7 @@ UMLAttribute::UMLAttribute(const UMLObject *parent) : UMLClassifierListItem(pare UMLAttribute::~UMLAttribute() { } -void UMLAttribute::setName(const QString &name) { +void UMLAttribute::setName(const TQString &name) { m_Name = name; emit attributeChanged(); UMLObject::emitModified(); @@ -60,11 +60,11 @@ void UMLAttribute::setVisibility(Uml::Visibility s) { UMLObject::emitModified(); } -QString UMLAttribute::getInitialValue() { +TQString UMLAttribute::getInitialValue() { return m_InitialValue; } -void UMLAttribute::setInitialValue(const QString &iv) { +void UMLAttribute::setInitialValue(const TQString &iv) { if(m_InitialValue != iv) { m_InitialValue = iv; UMLObject::emitModified(); @@ -79,8 +79,8 @@ Uml::Parameter_Direction UMLAttribute::getParmKind () const { return m_ParmKind; } -QString UMLAttribute::toString(Uml::Signature_Type sig) { - QString s; +TQString UMLAttribute::toString(Uml::Signature_Type sig) { + TQString s; if(sig == Uml::st_ShowSig || sig == Uml::st_NoSig) { s = m_Vis.toString(true) + ' '; @@ -101,7 +101,7 @@ QString UMLAttribute::toString(Uml::Signature_Type sig) { << " is not a UMLClassifier" << endl; return ""; } - QString typeName; + TQString typeName; UMLClassifier *type = UMLClassifierListItem::getType(); if (type) { UMLPackage *typeScope = type->getUMLPackage(); @@ -118,7 +118,7 @@ QString UMLAttribute::toString(Uml::Signature_Type sig) { else if (m_ParmKind == Uml::pd_Out) s += "out "; // Construct the attribute text. - QString string = s + getName() + " : " + typeName; + TQString string = s + getName() + " : " + typeName; if(m_InitialValue.length() > 0) string += " = " + m_InitialValue; return string; @@ -126,7 +126,7 @@ QString UMLAttribute::toString(Uml::Signature_Type sig) { return s + getName(); } -QString UMLAttribute::getFullyQualifiedName( const QString& separator, +TQString UMLAttribute::getFullyQualifiedName( const TQString& separator, bool includeRoot /* = false */) const { UMLOperation *op = NULL; UMLObject *owningObject = static_cast<UMLObject*>(parent()); @@ -141,10 +141,10 @@ QString UMLAttribute::getFullyQualifiedName( const QString& separator, << " is not a UMLClassifier" << endl; return ""; } - QString tempSeparator = separator; + TQString tempSeparator = separator; if (tempSeparator.isEmpty()) tempSeparator = UMLApp::app()->activeLanguageScopeSeparator(); - QString fqn = ownParent->getFullyQualifiedName(tempSeparator, includeRoot); + TQString fqn = ownParent->getFullyQualifiedName(tempSeparator, includeRoot); if (op) fqn.append(tempSeparator + op->getName()); fqn.append(tempSeparator + m_Name); @@ -188,8 +188,8 @@ UMLObject* UMLAttribute::clone() const } -void UMLAttribute::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { - QDomElement attributeElement = UMLObject::save("UML:Attribute", qDoc); +void UMLAttribute::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement ) { + TQDomElement attributeElement = UMLObject::save("UML:Attribute", qDoc); if (m_pSecondary == NULL) { kDebug() << "UMLAttribute::saveToXMI(" << m_Name << "): m_pSecondary is NULL, m_SecondaryId is '" @@ -202,7 +202,7 @@ void UMLAttribute::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { qElement.appendChild( attributeElement ); } -bool UMLAttribute::load( QDomElement & element ) { +bool UMLAttribute::load( TQDomElement & element ) { m_SecondaryId = element.attribute( "type", "" ); // We use the m_SecondaryId as a temporary store for the xmi.id // of the attribute type model object. @@ -212,14 +212,14 @@ bool UMLAttribute::load( QDomElement & element ) { // that has not yet been loaded. if (m_SecondaryId.isEmpty()) { // Perhaps the type is stored in a child node: - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); while (!node.isNull()) { if (node.isComment()) { node = node.nextSibling(); continue; } - QDomElement tempElement = node.toElement(); - QString tag = tempElement.tagName(); + TQDomElement tempElement = node.toElement(); + TQString tag = tempElement.tagName(); if (!Uml::tagEq(tag, "type")) { node = node.nextSibling(); continue; @@ -228,8 +228,8 @@ bool UMLAttribute::load( QDomElement & element ) { if (m_SecondaryId.isEmpty()) m_SecondaryId = tempElement.attribute( "xmi.idref", "" ); if (m_SecondaryId.isEmpty()) { - QDomNode inner = node.firstChild(); - QDomElement tmpElem = inner.toElement(); + TQDomNode inner = node.firstChild(); + TQDomElement tmpElem = inner.toElement(); m_SecondaryId = tmpElem.attribute( "xmi.id", "" ); if (m_SecondaryId.isEmpty()) m_SecondaryId = tmpElem.attribute( "xmi.idref", "" ); @@ -249,28 +249,28 @@ bool UMLAttribute::load( QDomElement & element ) { return true; } -bool UMLAttribute::showPropertiesDialog(QWidget* parent) { +bool UMLAttribute::showPropertiesDialog(TQWidget* parent) { UMLAttributeDialog dialog(parent, this); return dialog.exec(); } -void UMLAttribute::setTemplateParams(const QString& templateParam, UMLClassifierList &templateParamList) { +void UMLAttribute::setTemplateParams(const TQString& templateParam, UMLClassifierList &templateParamList) { if (templateParam.isEmpty()) return; - QString type = templateParam.simplifyWhiteSpace(); + TQString type = templateParam.simplifyWhiteSpace(); - int start = type.find(QChar('<')); + int start = type.find(TQChar('<')); if (start >= 0 ) { int end = start; int count = 1; int len = type.length(); while (count != 0 && ++end < len) { - QChar c = type.at(end); - if (c == QChar('<')) { + TQChar c = type.at(end); + if (c == TQChar('<')) { count++; } - if (c == QChar('>')) { + if (c == TQChar('>')) { count--; } } @@ -281,14 +281,14 @@ void UMLAttribute::setTemplateParams(const QString& templateParam, UMLClassifier setTemplateParams(type.mid(start + 1, end - start - 1), templateParamList); setTemplateParams(type.left(start) + type.right(len - end - 1), templateParamList); } else { - QStringList paramsList = QStringList::split(QChar(','), type); - for ( QStringList::Iterator it = paramsList.begin(); it != paramsList.end(); ++it ) { - QString param = *it; + TQStringList paramsList = TQStringList::split(TQChar(','), type); + for ( TQStringList::Iterator it = paramsList.begin(); it != paramsList.end(); ++it ) { + TQString param = *it; if (!param.isEmpty()) { UMLDoc *pDoc = UMLApp::app()->getDocument(); UMLObject* obj = pDoc->findUMLObject(param); if (obj == NULL ) { - obj = pDoc->findUMLObject(param.remove(QChar(' '))); + obj = pDoc->findUMLObject(param.remove(TQChar(' '))); } if (obj != NULL ) { //We want to list only the params that already exist in this document @@ -306,14 +306,14 @@ void UMLAttribute::setTemplateParams(const QString& templateParam, UMLClassifier UMLClassifierList UMLAttribute::getTemplateParams() { UMLClassifierList templateParamList; - QString type = getType()->getName(); - QString templateParam; + TQString type = getType()->getName(); + TQString templateParam; // Handle C++/D/Java template/generic parameters const Uml::Programming_Language pl = UMLApp::app()->getActiveLanguage(); if (pl == Uml::pl_Cpp || pl == Uml::pl_Java || pl == Uml::pl_D) { - int start = type.find(QChar('<')); + int start = type.find(TQChar('<')); if (start >= 0 ) { - int end = type.findRev(QChar('>')); + int end = type.findRev(TQChar('>')); if (end > start) { templateParam = type.mid(start + 1, end - start - 1); setTemplateParams(templateParam, templateParamList); |