summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/classifierwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/classifierwidget.cpp')
-rw-r--r--umbrello/umbrello/classifierwidget.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/umbrello/umbrello/classifierwidget.cpp b/umbrello/umbrello/classifierwidget.cpp
index 4d4c1eb8..8105818f 100644
--- a/umbrello/umbrello/classifierwidget.cpp
+++ b/umbrello/umbrello/classifierwidget.cpp
@@ -12,7 +12,7 @@
// own header
#include "classifierwidget.h"
// qt/kde includes
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kdebug.h>
// app includes
#include "classifier.h"
@@ -296,7 +296,7 @@ int ClassifierWidget::displayedOperations() {
return displayedMembers(Uml::ot_Operation);
}
-QSize ClassifierWidget::calculateSize() {
+TQSize ClassifierWidget::calculateSize() {
if (!m_pObject) {
return UMLWidget::calculateSize();
}
@@ -304,7 +304,7 @@ QSize ClassifierWidget::calculateSize() {
return calculateAsCircleSize();
}
- const QFontMetrics &fm = getFontMetrics(UMLWidget::FT_NORMAL);
+ const TQFontMetrics &fm = getFontMetrics(UMLWidget::FT_NORMAL);
const int fontHeight = fm.lineSpacing();
// width is the width of the longest 'word'
int width = 0, height = 0;
@@ -313,7 +313,7 @@ QSize ClassifierWidget::calculateSize() {
if (m_bShowStereotype && !m_pObject->getStereotype().isEmpty()) {
height += fontHeight;
// ... width
- const QFontMetrics &bfm = UMLWidget::getFontMetrics(UMLWidget::FT_BOLD);
+ const TQFontMetrics &bfm = UMLWidget::getFontMetrics(UMLWidget::FT_BOLD);
const int stereoWidth = bfm.size(0,m_pObject->getStereotype(true)).width();
if (stereoWidth > width)
width = stereoWidth;
@@ -322,7 +322,7 @@ QSize ClassifierWidget::calculateSize() {
// consider name
height += fontHeight;
// ... width
- QString displayedName;
+ TQString displayedName;
if (m_bShowPackage)
displayedName = m_pObject->getFullyQualifiedName();
else
@@ -361,7 +361,7 @@ QSize ClassifierWidget::calculateSize() {
for (UMLOperation* op = list.first(); op; op = list.next()) {
if (m_bShowPublicOnly && op->getVisibility() != Uml::Visibility::Public)
continue;
- const QString displayedOp = op->toString(m_ShowOpSigs);
+ const TQString displayedOp = op->toString(m_ShowOpSigs);
UMLWidget::FontType oft;
oft = (op->getAbstract() ? UMLWidget::FT_ITALIC : UMLWidget::FT_NORMAL);
const int w = UMLWidget::getFontMetrics(oft).size(0,displayedOp).width();
@@ -371,7 +371,7 @@ QSize ClassifierWidget::calculateSize() {
}
// consider template box _as last_ !
- QSize templatesBoxSize = calculateTemplatesBoxSize();
+ TQSize templatesBoxSize = calculateTemplatesBoxSize();
if (templatesBoxSize.width() != 0) {
// add width to largest 'word'
width += templatesBoxSize.width() / 2;
@@ -389,7 +389,7 @@ QSize ClassifierWidget::calculateSize() {
// allow for width margin
width += MARGIN * 2;
- return QSize(width, height);
+ return TQSize(width, height);
}
void ClassifierWidget::slotMenuSelection(int sel) {
@@ -468,21 +468,21 @@ void ClassifierWidget::slotMenuSelection(int sel) {
}
}
-QSize ClassifierWidget::calculateTemplatesBoxSize() {
+TQSize ClassifierWidget::calculateTemplatesBoxSize() {
UMLTemplateList list = getClassifier()->getTemplateList();
int count = list.count();
if (count == 0) {
- return QSize(0, 0);
+ return TQSize(0, 0);
}
int width, height;
height = width = 0;
- QFont font = UMLWidget::getFont();
+ TQFont font = UMLWidget::getFont();
font.setItalic(false);
font.setUnderline(false);
font.setBold(false);
- const QFontMetrics fm(font);
+ const TQFontMetrics fm(font);
height = count * fm.lineSpacing() + (MARGIN*2);
@@ -493,7 +493,7 @@ QSize ClassifierWidget::calculateTemplatesBoxSize() {
}
width += (MARGIN*2);
- return QSize(width, height);
+ return TQSize(width, height);
}
int ClassifierWidget::displayedAttributes() {
@@ -518,7 +518,7 @@ UMLClassifier *ClassifierWidget::getClassifier() {
return static_cast<UMLClassifier*>(m_pObject);
}
-void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
+void ClassifierWidget::draw(TQPainter & p, int offsetX, int offsetY) {
UMLWidget::setPen(p);
if ( UMLWidget::getUseFillColour() )
p.setBrush( UMLWidget::getFillColour() );
@@ -531,7 +531,7 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
}
// Draw the bounding rectangle
- QSize templatesBoxSize = calculateTemplatesBoxSize();
+ TQSize templatesBoxSize = calculateTemplatesBoxSize();
m_bodyOffsetY = offsetY;
if (templatesBoxSize.height() > 0)
m_bodyOffsetY += templatesBoxSize.height() - MARGIN;
@@ -543,28 +543,28 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
h -= templatesBoxSize.height() - MARGIN;
p.drawRect(offsetX, m_bodyOffsetY, w, h);
- QFont font = UMLWidget::getFont();
+ TQFont font = UMLWidget::getFont();
font.setUnderline(false);
font.setItalic(false);
- const QFontMetrics fm = UMLWidget::getFontMetrics(UMLWidget::FT_NORMAL);
+ const TQFontMetrics fm = UMLWidget::getFontMetrics(UMLWidget::FT_NORMAL);
const int fontHeight = fm.lineSpacing();
//If there are any templates then draw them
UMLTemplateList tlist = getClassifier()->getTemplateList();
if ( tlist.count() > 0 ) {
UMLWidget::setPen(p);
- QPen pen = p.pen();
+ TQPen pen = p.pen();
pen.setStyle(Qt::DotLine);
p.setPen(pen);
p.drawRect( offsetX + width() - templatesBoxSize.width(), offsetY,
templatesBoxSize.width(), templatesBoxSize.height() );
- p.setPen( QPen(Qt::black) );
+ p.setPen( TQPen(Qt::black) );
font.setBold(false);
p.setFont(font);
const int x = offsetX + width() - templatesBoxSize.width() + MARGIN;
int y = offsetY + MARGIN;
for ( UMLTemplate *t = tlist.first(); t; t = tlist.next() ) {
- QString text = t->toString();
+ TQString text = t->toString();
p.drawText(x, y, fm.size(0,text).width(), fontHeight, Qt::AlignVCenter, text);
y += fontHeight;
}
@@ -573,11 +573,11 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
const int textX = offsetX + MARGIN;
const int textWidth = w - MARGIN * 2;
- p.setPen(QPen(Qt::black));
+ p.setPen(TQPen(Qt::black));
// draw stereotype
font.setBold(true);
- QString stereo = m_pObject->getStereotype();
+ TQString stereo = m_pObject->getStereotype();
/* if no stereotype is given we don't want to show the empty << >> */
const bool showStereotype = (m_bShowStereotype && !stereo.isEmpty());
const bool showNameOnly = (!m_bShowOperations && !m_bShowAttributes && !showStereotype);
@@ -592,7 +592,7 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
}
// draw name
- QString name;
+ TQString name;
if (m_bShowPackage) {
name = m_pObject->getFullyQualifiedName();
} else {
@@ -605,7 +605,7 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
m_bodyOffsetY += fontHeight;
UMLWidget::setPen(p);
p.drawLine(offsetX, m_bodyOffsetY, offsetX + w - 1, m_bodyOffsetY);
- p.setPen(QPen(Qt::black));
+ p.setPen(TQPen(Qt::black));
}
font.setBold(false);
font.setItalic(false);
@@ -626,7 +626,7 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
m_bodyOffsetY += fontHeight * numAtts;
UMLWidget::setPen(p);
p.drawLine(offsetX, m_bodyOffsetY, offsetX + w - 1, m_bodyOffsetY);
- p.setPen(QPen(Qt::black));
+ p.setPen(TQPen(Qt::black));
}
// draw operations
@@ -639,12 +639,12 @@ void ClassifierWidget::draw(QPainter & p, int offsetX, int offsetY) {
UMLWidget::drawSelected(&p, offsetX, offsetY);
}
-void ClassifierWidget::drawAsCircle(QPainter& p, int offsetX, int offsetY) {
+void ClassifierWidget::drawAsCircle(TQPainter& p, int offsetX, int offsetY) {
int w = width();
- const QFontMetrics &fm = getFontMetrics(FT_NORMAL);
+ const TQFontMetrics &fm = getFontMetrics(FT_NORMAL);
const int fontHeight = fm.lineSpacing();
- QString name;
+ TQString name;
if ( m_bShowPackage ) {
name = m_pObject->getFullyQualifiedName();
} else {
@@ -652,9 +652,9 @@ void ClassifierWidget::drawAsCircle(QPainter& p, int offsetX, int offsetY) {
}
p.drawEllipse(offsetX + w/2 - CIRCLE_SIZE/2, offsetY, CIRCLE_SIZE, CIRCLE_SIZE);
- p.setPen( QPen(Qt::black) );
+ p.setPen( TQPen(Qt::black) );
- QFont font = UMLWidget::getFont();
+ TQFont font = UMLWidget::getFont();
p.setFont(font);
p.drawText(offsetX, offsetY + CIRCLE_SIZE, w, fontHeight, Qt::AlignCenter, name);
@@ -663,14 +663,14 @@ void ClassifierWidget::drawAsCircle(QPainter& p, int offsetX, int offsetY) {
}
}
-QSize ClassifierWidget::calculateAsCircleSize() {
- const QFontMetrics &fm = UMLWidget::getFontMetrics(UMLWidget::FT_ITALIC_UNDERLINE);
+TQSize ClassifierWidget::calculateAsCircleSize() {
+ const TQFontMetrics &fm = UMLWidget::getFontMetrics(UMLWidget::FT_ITALIC_UNDERLINE);
const int fontHeight = fm.lineSpacing();
int height = CIRCLE_SIZE + fontHeight;
int width = CIRCLE_SIZE;
- QString displayedName;
+ TQString displayedName;
if (m_bShowPackage) {
displayedName = m_pObject->getFullyQualifiedName();
} else {
@@ -681,22 +681,22 @@ QSize ClassifierWidget::calculateAsCircleSize() {
width = nameWidth;
width += MARGIN * 2;
- return QSize(width, height);
+ return TQSize(width, height);
}
-void ClassifierWidget::drawMembers(QPainter & p, Uml::Object_Type ot, Uml::Signature_Type sigType,
+void ClassifierWidget::drawMembers(TQPainter & p, Uml::Object_Type ot, Uml::Signature_Type sigType,
int x, int y, int fontHeight) {
- QFont f = UMLWidget::getFont();
+ TQFont f = UMLWidget::getFont();
f.setBold(false);
UMLClassifierListItemList list = getClassifier()->getFilteredList(ot);
for (UMLClassifierListItem *obj = list.first(); obj; obj = list.next()) {
if (m_bShowPublicOnly && obj->getVisibility() != Uml::Visibility::Public)
continue;
- QString text = obj->toString(sigType);
+ TQString text = obj->toString(sigType);
f.setItalic( obj->getAbstract() );
f.setUnderline( obj->getStatic() );
p.setFont( f );
- QFontMetrics fontMetrics(f);
+ TQFontMetrics fontMetrics(f);
p.drawText(x, y, fontMetrics.size(0,text).width(), fontHeight, Qt::AlignVCenter, text);
f.setItalic(false);
f.setUnderline(false);
@@ -755,8 +755,8 @@ void ClassifierWidget::adjustAssocs(int x, int y) {
m_pAssocWidget->computeAssocClassLine();
}
-void ClassifierWidget::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
- QDomElement conceptElement;
+void ClassifierWidget::saveToXMI(TQDomDocument & qDoc, TQDomElement & qElement) {
+ TQDomElement conceptElement;
UMLClassifier *umlc = getClassifier();
if (umlc->isInterface())
conceptElement = qDoc.createElement("interfacewidget");
@@ -777,17 +777,17 @@ void ClassifierWidget::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
qElement.appendChild( conceptElement );
}
-bool ClassifierWidget::loadFromXMI(QDomElement & qElement) {
+bool ClassifierWidget::loadFromXMI(TQDomElement & qElement) {
if (!UMLWidget::loadFromXMI(qElement))
return false;
- QString showatts = qElement.attribute( "showattributes", "0" );
- QString showops = qElement.attribute( "showoperations", "1" );
- QString showpubliconly = qElement.attribute( "showpubliconly", "0" );
- QString showattsigs = qElement.attribute( "showattsigs", "600" );
- QString showopsigs = qElement.attribute( "showopsigs", "600" );
- QString showpackage = qElement.attribute( "showpackage", "0" );
- QString showscope = qElement.attribute( "showscope", "0" );
- QString drawascircle = qElement.attribute("drawascircle", "0");
+ TQString showatts = qElement.attribute( "showattributes", "0" );
+ TQString showops = qElement.attribute( "showoperations", "1" );
+ TQString showpubliconly = qElement.attribute( "showpubliconly", "0" );
+ TQString showattsigs = qElement.attribute( "showattsigs", "600" );
+ TQString showopsigs = qElement.attribute( "showopsigs", "600" );
+ TQString showpackage = qElement.attribute( "showpackage", "0" );
+ TQString showscope = qElement.attribute( "showscope", "0" );
+ TQString drawascircle = qElement.attribute("drawascircle", "0");
m_bShowAttributes = (bool)showatts.toInt();
m_bShowOperations = (bool)showops.toInt();