summaryrefslogtreecommitdiffstats
path: root/lib/kformula/glyphelement.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kformula/glyphelement.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kformula/glyphelement.cc')
-rw-r--r--lib/kformula/glyphelement.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/kformula/glyphelement.cc b/lib/kformula/glyphelement.cc
index 798621a2..381bbcf9 100644
--- a/lib/kformula/glyphelement.cc
+++ b/lib/kformula/glyphelement.cc
@@ -17,18 +17,18 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qfontmetrics.h>
-#include <qpainter.h>
+#include <tqfontmetrics.h>
+#include <tqpainter.h>
#include "fontstyle.h"
#include "glyphelement.h"
KFORMULA_NAMESPACE_BEGIN
-GlyphElement::GlyphElement( BasicElement* parent ) : TextElement( ' ', false, parent ) {
+GlyphElement::GlyphElement( BasicElement* tqparent ) : TextElement( ' ', false, tqparent ) {
}
-bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element )
+bool GlyphElement::readAttributesFromMathMLDom( const TQDomElement& element )
{
if ( !BasicElement::readAttributesFromMathMLDom( element ) ) {
return false;
@@ -40,7 +40,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element )
kdWarning( DEBUGID ) << "Required attribute fontfamily not found in glyph element\n";
return false;
}
- QString indexStr = element.attribute( "index" );
+ TQString indexStr = element.attribute( "index" );
if ( indexStr.isNull() ) {
kdWarning( DEBUGID ) << "Required attribute index not found in glyph element\n";
return false;
@@ -51,7 +51,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element )
kdWarning( DEBUGID ) << "Invalid index value in glyph element\n";
return false;
}
- m_char = QChar( index );
+ m_char = TQChar( index );
m_alt = element.attribute( "alt" );
if ( m_alt.isNull() ) {
@@ -59,7 +59,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element )
return false;
}
- QStringList missing;
+ TQStringList missing;
FontStyle::testFont( missing, m_fontFamily.lower() );
m_hasFont = missing.isEmpty();
@@ -69,7 +69,7 @@ bool GlyphElement::readAttributesFromMathMLDom( const QDomElement& element )
/**
* Calculates our width and height and
- * our children's parentPosition.
+ * our tqchildren's tqparentPosition.
*/
void GlyphElement::calcSizes( const ContextStyle& context,
ContextStyle::TextStyle tstyle,
@@ -78,19 +78,19 @@ void GlyphElement::calcSizes( const ContextStyle& context,
{
double factor = style.sizeFactor();
luPt mySize = context.getAdjustedSize( tstyle, factor );
- QRect bound;
+ TQRect bound;
if ( m_hasFont ) {
- QFont font( m_fontFamily );
- font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
- QFontMetrics fm ( font );
+ TQFont font( m_fontFamily );
+ font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) );
+ TQFontMetrics fm ( font );
bound = fm.boundingRect( m_char );
setWidth( context.ptToLayoutUnitPt( fm.width( m_char ) ) );
}
else {
- QFont font( context.getDefaultFont() );
- font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
- QFontMetrics fm ( font );
+ TQFont font( context.getDefaultFont() );
+ font.setPointSizeFloat( context.tqlayoutUnitPtToPt( mySize ) );
+ TQFontMetrics fm ( font );
bound = fm.boundingRect( m_alt );
setWidth( context.ptToLayoutUnitPt( fm.width( m_alt ) ) );
}
@@ -105,36 +105,36 @@ void GlyphElement::calcSizes( const ContextStyle& context,
}
/**
- * Draws the whole element including its children.
- * The `parentOrigin' is the point this element's parent starts.
- * We can use our parentPosition to get our own origin then.
+ * Draws the whole element including its tqchildren.
+ * The `tqparentOrigin' is the point this element's tqparent starts.
+ * We can use our tqparentPosition to get our own origin then.
*/
-void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
+void GlyphElement::draw( TQPainter& painter, const LuPixelRect& /*r*/,
const ContextStyle& context,
ContextStyle::TextStyle tstyle,
ContextStyle::IndexStyle /*istyle*/,
StyleAttributes& style,
- const LuPixelPoint& parentOrigin )
+ const LuPixelPoint& tqparentOrigin )
{
- LuPixelPoint myPos( parentOrigin.x()+getX(), parentOrigin.y()+getY() );
+ LuPixelPoint myPos( tqparentOrigin.x()+getX(), tqparentOrigin.y()+getY() );
//if ( !LuPixelRect( myPos.x(), myPos.y(), getWidth(), getHeight() ).intersects( r ) )
// return;
double factor = style.sizeFactor();
luPt mySize = context.getAdjustedSize( tstyle, factor );
- QFont font;
- QString text;
+ TQFont font;
+ TQString text;
if ( m_hasFont ) {
painter.setPen( style.color() );
setCharStyle( style.charStyle() );
setCharFamily( style.charFamily() );
- font = QFont( m_fontFamily );
+ font = TQFont( m_fontFamily );
text = m_char;
- painter.fillRect( context.layoutUnitToPixelX( myPos.x() ),
- context.layoutUnitToPixelY( myPos.y() ),
- context.layoutUnitToPixelX( getWidth() ),
- context.layoutUnitToPixelY( getHeight() ),
+ painter.fillRect( context.tqlayoutUnitToPixelX( myPos.x() ),
+ context.tqlayoutUnitToPixelY( myPos.y() ),
+ context.tqlayoutUnitToPixelX( getWidth() ),
+ context.tqlayoutUnitToPixelY( getHeight() ),
style.background() );
}
else {
@@ -142,17 +142,17 @@ void GlyphElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
font = context.getDefaultFont();
text = m_alt;
}
- font.setPointSizeFloat( context.layoutUnitToFontSize( mySize, false ) );
+ font.setPointSizeFloat( context.tqlayoutUnitToFontSize( mySize, false ) );
painter.setFont( font );
- painter.drawText( context.layoutUnitToPixelX( myPos.x() ),
- context.layoutUnitToPixelY( myPos.y()+getBaseline() ),
+ painter.drawText( context.tqlayoutUnitToPixelX( myPos.x() ),
+ context.tqlayoutUnitToPixelY( myPos.y()+getBaseline() ),
text );
}
-void GlyphElement::writeMathMLAttributes( QDomElement& element ) const
+void GlyphElement::writeMathMLAttributes( TQDomElement& element ) const
{
element.setAttribute( "fontfamily", m_fontFamily );
- element.setAttribute( "index", m_char.unicode() );
+ element.setAttribute( "index", m_char.tqunicode() );
element.setAttribute( "alt", m_alt );
}