summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/floatingtextwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/floatingtextwidget.cpp')
-rw-r--r--umbrello/umbrello/floatingtextwidget.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/umbrello/umbrello/floatingtextwidget.cpp b/umbrello/umbrello/floatingtextwidget.cpp
index 44ea3373..fb278399 100644
--- a/umbrello/umbrello/floatingtextwidget.cpp
+++ b/umbrello/umbrello/floatingtextwidget.cpp
@@ -13,10 +13,10 @@
#include "floatingtextwidget.h"
// system includes
-#include <qregexp.h>
-#include <qpainter.h>
-#include <qevent.h>
-#include <qvalidator.h>
+#include <tqregexp.h>
+#include <tqpainter.h>
+#include <tqevent.h>
+#include <tqvalidator.h>
#include <klocale.h>
#include <kdebug.h>
#include <kinputdialog.h>
@@ -38,7 +38,7 @@
FloatingTextWidget::FloatingTextWidget(UMLView * view, Uml::Text_Role role,
- const QString& text, Uml::IDType id)
+ const TQString& text, Uml::IDType id)
: UMLWidget(view, id, new FloatingTextWidgetController(this))
{
init();
@@ -66,24 +66,24 @@ void FloatingTextWidget::init() {
FloatingTextWidget::~FloatingTextWidget() {
}
-void FloatingTextWidget::draw(QPainter & p, int offsetX, int offsetY) {
+void FloatingTextWidget::draw(TQPainter & p, int offsetX, int offsetY) {
int w = width();
int h = height();
p.setFont( UMLWidget::getFont() );
- QColor textColor(50, 50, 50);
+ TQColor textColor(50, 50, 50);
p.setPen(textColor);
p.drawText( offsetX , offsetY,w,h, Qt::AlignCenter, getDisplayText() );
if(m_bSelected)
drawSelected(&p, offsetX, offsetY);
}
-void FloatingTextWidget::resizeEvent(QResizeEvent * /*re*/) {}
+void FloatingTextWidget::resizeEvent(TQResizeEvent * /*re*/) {}
-QSize FloatingTextWidget::calculateSize() {
- const QFontMetrics &fm = getFontMetrics(FT_NORMAL);
+TQSize FloatingTextWidget::calculateSize() {
+ const TQFontMetrics &fm = getFontMetrics(FT_NORMAL);
int h = fm.lineSpacing();
int w = fm.width( getDisplayText() );
- return QSize(w + 8, h + 4); // give a small margin
+ return TQSize(w + 8, h + 4); // give a small margin
}
void FloatingTextWidget::slotMenuSelection(int sel) {
@@ -108,7 +108,7 @@ void FloatingTextWidget::slotMenuSelection(int sel) {
UMLClassifier* c = m_pLink->getOperationOwner();
if (c == NULL) {
bool ok = false;
- QString opText = KInputDialog::getText(i18n("Name"),
+ TQString opText = KInputDialog::getText(i18n("Name"),
i18n("Enter operation name:"),
getText(), &ok, m_pView);
if (ok)
@@ -133,7 +133,7 @@ void FloatingTextWidget::slotMenuSelection(int sel) {
case ListPopupMenu::mt_Change_Font:
{
- QFont font = getFont();
+ TQFont font = getFont();
if( KFontDialog::getFont( font, false, m_pView ) ) {
if( m_Role == Uml::tr_Floating || m_Role == Uml::tr_Seq_Message ) {
setFont( font );
@@ -156,8 +156,8 @@ void FloatingTextWidget::slotMenuSelection(int sel) {
}
void FloatingTextWidget::handleRename() {
- QRegExpValidator v(QRegExp(".*"), 0);
- QString t;
+ TQRegExpValidator v(TQRegExp(".*"), 0);
+ TQString t;
if( m_Role == Uml::tr_RoleAName || m_Role == Uml::tr_RoleBName ) {
t = i18n("Enter role name:");
} else if (m_Role == Uml::tr_MultiA || m_Role == Uml::tr_MultiB) {
@@ -175,13 +175,13 @@ void FloatingTextWidget::handleRename() {
t = i18n("ERROR");
}
bool ok = false;
- QString newText = KInputDialog::getText(i18n("Rename"), t, getText(), &ok,
+ TQString newText = KInputDialog::getText(i18n("Rename"), t, getText(), &ok,
m_pView, NULL, &v);
if (!ok || newText == getText())
return;
}
-void FloatingTextWidget::changeName(const QString& newText)
+void FloatingTextWidget::changeName(const TQString& newText)
{
if (m_pLink && !isTextValid(newText)) {
@@ -189,16 +189,16 @@ void FloatingTextWidget::changeName(const QString& newText)
if (assoc) {
switch (m_Role) {
case Uml::tr_MultiA:
- assoc->setMulti(QString(), Uml::A);
+ assoc->setMulti(TQString(), Uml::A);
break;
case Uml::tr_MultiB:
- assoc->setMulti(QString(), Uml::B);
+ assoc->setMulti(TQString(), Uml::B);
break;
case Uml::tr_RoleAName:
- assoc->setRoleName(QString(), Uml::A);
+ assoc->setRoleName(TQString(), Uml::A);
break;
case Uml::tr_RoleBName:
- assoc->setRoleName(QString(), Uml::B);
+ assoc->setRoleName(TQString(), Uml::B);
break;
case Uml::tr_ChangeA:
assoc->setChangeability(Uml::chg_Changeable, Uml::A);
@@ -207,13 +207,13 @@ void FloatingTextWidget::changeName(const QString& newText)
assoc->setChangeability(Uml::chg_Changeable, Uml::B);
break;
default:
- assoc->setName(QString());
+ assoc->setName(TQString());
break;
}
} else {
MessageWidget *msg = dynamic_cast<MessageWidget*>(m_pLink);
if (msg) {
- msg->setName(QString());
+ msg->setName(TQString());
m_pView->removeWidget(this);
}
}
@@ -230,13 +230,13 @@ void FloatingTextWidget::changeName(const QString& newText)
update();
}
-void FloatingTextWidget::setText(const QString &t) {
+void FloatingTextWidget::setText(const TQString &t) {
if (m_Role == Uml::tr_Seq_Message || m_Role == Uml::tr_Seq_Message_Self) {
- QString seqNum, op;
+ TQString seqNum, op;
m_pLink->getSeqNumAndOp(seqNum, op);
if (seqNum.length() > 0 || op.length() > 0) {
if (! m_pView->getShowOpSig())
- op.replace( QRegExp("\\(.*\\)"), "()" );
+ op.replace( TQRegExp("\\(.*\\)"), "()" );
m_Text = seqNum.append(": ").append( op );
} else
m_Text = t;
@@ -246,14 +246,14 @@ void FloatingTextWidget::setText(const QString &t) {
update();
}
-void FloatingTextWidget::setPreText (const QString &t)
+void FloatingTextWidget::setPreText (const TQString &t)
{
m_PreText = t;
updateComponentSize();
update();
}
-void FloatingTextWidget::setPostText(const QString &t) {
+void FloatingTextWidget::setPostText(const TQString &t) {
m_PostText = t;
updateComponentSize();
update();
@@ -261,7 +261,7 @@ void FloatingTextWidget::setPostText(const QString &t) {
void FloatingTextWidget::changeTextDlg() {
bool ok = false;
- QString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), getText(), &ok, m_pView);
+ TQString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), getText(), &ok, m_pView);
if(ok && newText != getText() && isTextValid(newText)) {
setText( newText );
@@ -278,7 +278,7 @@ void FloatingTextWidget::showOpDlg() {
kError() << "FloatingTextWidget::showOpDlg: m_pLink is NULL" << endl;
return;
}
- QString seqNum, opText;
+ TQString seqNum, opText;
UMLClassifier* c = m_pLink->getSeqNumAndOp(seqNum, opText);
if (c == NULL) {
kError() << "FloatingTextWidget::showOpDlg: "
@@ -320,7 +320,7 @@ void FloatingTextWidget::showOpDlg() {
if (od.m_pReturnType)
op->setType(od.m_pReturnType);
m_pLink->setOperation(op);
- opText = QString();
+ opText = TQString();
} else {
m_pLink->setOperation(NULL);
}
@@ -331,15 +331,15 @@ void FloatingTextWidget::showOpDlg() {
setMessageText();
}
-QString FloatingTextWidget::getPreText() const {
+TQString FloatingTextWidget::getPreText() const {
return m_PreText;
}
-QString FloatingTextWidget::getPostText() const {
+TQString FloatingTextWidget::getPostText() const {
return m_PostText;
}
-QString FloatingTextWidget::getText() const {
+TQString FloatingTextWidget::getText() const {
//test to make sure not just the ":" between the seq number
//and the actual message widget
// hmm. this section looks like it could have been avoided by using pre-, post- text
@@ -352,9 +352,9 @@ QString FloatingTextWidget::getText() const {
return m_Text;
}
-QString FloatingTextWidget::getDisplayText() const
+TQString FloatingTextWidget::getDisplayText() const
{
- QString displayText = m_Text;
+ TQString displayText = m_Text;
displayText.prepend(m_PreText);
displayText.append(m_PostText);
return displayText;
@@ -383,7 +383,7 @@ Uml::Text_Role FloatingTextWidget::getRole() const {
return m_Role;
}
-bool FloatingTextWidget::isTextValid( const QString &text ) {
+bool FloatingTextWidget::isTextValid( const TQString &text ) {
int length = text.length();
if(length < 1)
return false;
@@ -405,8 +405,8 @@ void FloatingTextWidget::showProperties() {
}
}
-void FloatingTextWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
- QDomElement textElement = qDoc.createElement( "floatingtext" );
+void FloatingTextWidget::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement ) {
+ TQDomElement textElement = qDoc.createElement( "floatingtext" );
UMLWidget::saveToXMI( qDoc, textElement );
textElement.setAttribute( "text", m_Text );
textElement.setAttribute( "pretext", m_PreText );
@@ -421,11 +421,11 @@ void FloatingTextWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement
qElement.appendChild( textElement );
}
-bool FloatingTextWidget::loadFromXMI( QDomElement & qElement ) {
+bool FloatingTextWidget::loadFromXMI( TQDomElement & qElement ) {
if( !UMLWidget::loadFromXMI( qElement ) )
return false;
- QString role = qElement.attribute( "role", "" );
+ TQString role = qElement.attribute( "role", "" );
if( !role.isEmpty() )
m_Role = (Uml::Text_Role)role.toInt();