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/statewidget.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/statewidget.cpp')
-rw-r--r-- | umbrello/umbrello/statewidget.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/umbrello/umbrello/statewidget.cpp b/umbrello/umbrello/statewidget.cpp index 9d104234..871ab316 100644 --- a/umbrello/umbrello/statewidget.cpp +++ b/umbrello/umbrello/statewidget.cpp @@ -13,7 +13,7 @@ #include "statewidget.h" // qt includes -#include <qevent.h> +#include <tqevent.h> // kde includes #include <klocale.h> @@ -39,7 +39,7 @@ StateWidget::StateWidget(UMLView * view, StateType stateType, Uml::IDType id) StateWidget::~StateWidget() {} -void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { +void StateWidget::draw(TQPainter & p, int offsetX, int offsetY) { UMLWidget::setPen(p); const int w = width(); const int h = height(); @@ -49,14 +49,14 @@ void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColour()); { - const QFontMetrics &fm = getFontMetrics(FT_NORMAL); + const TQFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); int textStartY = (h / 2) - (fontHeight / 2); const int count = m_Activities.count(); if( count == 0 ) { p.drawRoundRect(offsetX, offsetY, w, h, (h*40)/w, (w*40)/h); p.setPen(Qt::black); - QFont font = UMLWidget::getFont(); + TQFont font = UMLWidget::getFont(); font.setBold( false ); p.setFont( font ); p.drawText(offsetX + STATE_MARGIN, offsetY + textStartY, @@ -67,7 +67,7 @@ void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { p.drawRoundRect(offsetX, offsetY, w, h, (h*40)/w, (w*40)/h); textStartY = offsetY + STATE_MARGIN; p.setPen(Qt::black); - QFont font = UMLWidget::getFont(); + TQFont font = UMLWidget::getFont(); font.setBold( true ); p.setFont( font ); p.drawText(offsetX + STATE_MARGIN, textStartY, w - STATE_MARGIN * 2, @@ -77,8 +77,8 @@ void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPen(p); int linePosY = textStartY + fontHeight; - QStringList::Iterator end(m_Activities.end()); - for( QStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { + TQStringList::Iterator end(m_Activities.end()); + for( TQStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { textStartY += fontHeight; p.drawLine( offsetX, linePosY, offsetX + w - 1, linePosY ); p.setPen(Qt::black); @@ -110,10 +110,10 @@ void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { drawSelected(&p, offsetX, offsetY); } -QSize StateWidget::calculateSize() { +TQSize StateWidget::calculateSize() { int width = 10, height = 10; if ( m_StateType == Normal ) { - const QFontMetrics &fm = getFontMetrics(FT_BOLD); + const TQFontMetrics &fm = getFontMetrics(FT_BOLD); const int fontHeight = fm.lineSpacing(); int textWidth = fm.width(getName()); const int count = m_Activities.count(); @@ -121,8 +121,8 @@ QSize StateWidget::calculateSize() { if( count > 0 ) { height = fontHeight * ( count + 1); - QStringList::Iterator end(m_Activities.end()); - for( QStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { + TQStringList::Iterator end(m_Activities.end()); + for( TQStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { int w = fm.width( *it ); if( w > textWidth ) textWidth = w; @@ -134,16 +134,16 @@ QSize StateWidget::calculateSize() { height += STATE_MARGIN * 2; } - return QSize(width, height); + return TQSize(width, height); } -void StateWidget::setName(const QString &strName) { +void StateWidget::setName(const TQString &strName) { m_Text = strName; updateComponentSize(); adjustAssocs( getX(), getY() ); } -QString StateWidget::getName() const { +TQString StateWidget::getName() const { return m_Text; } @@ -158,7 +158,7 @@ void StateWidget::setStateType( StateType stateType ) { void StateWidget::slotMenuSelection(int sel) { bool done = false; bool ok = false; - QString name = getName(); + TQString name = getName(); switch( sel ) { case ListPopupMenu::mt_Rename: @@ -184,13 +184,13 @@ void StateWidget::slotMenuSelection(int sel) { UMLWidget::slotMenuSelection( sel ); } -bool StateWidget::addActivity( const QString &activity ) { +bool StateWidget::addActivity( const TQString &activity ) { m_Activities.append( activity ); updateComponentSize(); return true; } -bool StateWidget::removeActivity( const QString &activity ) { +bool StateWidget::removeActivity( const TQString &activity ) { int index = - 1; if( ( index = m_Activities.findIndex( activity ) ) == -1 ) return false; @@ -199,16 +199,16 @@ bool StateWidget::removeActivity( const QString &activity ) { return true; } -void StateWidget::setActivities( QStringList & list ) { +void StateWidget::setActivities( TQStringList & list ) { m_Activities = list; updateComponentSize(); } -QStringList & StateWidget::getActivityList() { +TQStringList & StateWidget::getActivityList() { return m_Activities; } -bool StateWidget::renameActivity( const QString &activity, const QString &newName ) { +bool StateWidget::renameActivity( const TQString &activity, const TQString &newName ) { int index = - 1; if( ( index = m_Activities.findIndex( activity ) ) == -1 ) return false; @@ -247,18 +247,18 @@ bool StateWidget::isState(WorkToolBar::ToolBar_Buttons tbb, StateType& resultTyp return status; } -void StateWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { - QDomElement stateElement = qDoc.createElement( "statewidget" ); +void StateWidget::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement ) { + TQDomElement stateElement = qDoc.createElement( "statewidget" ); UMLWidget::saveToXMI( qDoc, stateElement ); stateElement.setAttribute( "statename", m_Text ); stateElement.setAttribute( "documentation", m_Doc ); stateElement.setAttribute( "statetype", m_StateType ); //save states activities - QDomElement activitiesElement = qDoc.createElement( "Activities" ); + TQDomElement activitiesElement = qDoc.createElement( "Activities" ); - QStringList::Iterator end(m_Activities.end()); - for( QStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { - QDomElement tempElement = qDoc.createElement( "Activity" ); + TQStringList::Iterator end(m_Activities.end()); + for( TQStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { + TQDomElement tempElement = qDoc.createElement( "Activity" ); tempElement.setAttribute( "name", *it ); activitiesElement.appendChild( tempElement ); }//end for @@ -266,22 +266,22 @@ void StateWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { qElement.appendChild( stateElement ); } -bool StateWidget::loadFromXMI( QDomElement & qElement ) { +bool StateWidget::loadFromXMI( TQDomElement & qElement ) { if( !UMLWidget::loadFromXMI( qElement ) ) return false; m_Text = qElement.attribute( "statename", "" ); m_Doc = qElement.attribute( "documentation", "" ); - QString type = qElement.attribute( "statetype", "1" ); + TQString type = qElement.attribute( "statetype", "1" ); m_StateType = (StateType)type.toInt(); //load states activities - QDomNode node = qElement.firstChild(); - QDomElement tempElement = node.toElement(); + TQDomNode node = qElement.firstChild(); + TQDomElement tempElement = node.toElement(); if( !tempElement.isNull() && tempElement.tagName() == "Activities" ) { - QDomNode node = tempElement.firstChild(); - QDomElement activityElement = node.toElement(); + TQDomNode node = tempElement.firstChild(); + TQDomElement activityElement = node.toElement(); while( !activityElement.isNull() ) { if( activityElement.tagName() == "Activity" ) { - QString name = activityElement.attribute( "name", "" ); + TQString name = activityElement.attribute( "name", "" ); if( !name.isEmpty() ) m_Activities.append( name ); }//end if |