summaryrefslogtreecommitdiffstats
path: root/kformula
diff options
context:
space:
mode:
Diffstat (limited to 'kformula')
-rw-r--r--kformula/DESIGN66
-rw-r--r--kformula/formulastring.cc50
-rw-r--r--kformula/formulastring.h31
-rw-r--r--kformula/fsparser.cc228
-rw-r--r--kformula/fsparser.h24
-rw-r--r--kformula/kfconfig.cc14
-rw-r--r--kformula/kfconfig.h3
-rw-r--r--kformula/kformula_doc.cc76
-rw-r--r--kformula/kformula_doc.h29
-rw-r--r--kformula/kformula_factory.cc10
-rw-r--r--kformula/kformula_factory.h5
-rw-r--r--kformula/kformula_view.cc64
-rw-r--r--kformula/kformula_view.h19
-rw-r--r--kformula/kformula_view_iface.cc6
-rw-r--r--kformula/kformula_view_iface.h10
-rw-r--r--kformula/kformulawidget.cc48
-rw-r--r--kformula/kformulawidget.h33
17 files changed, 361 insertions, 355 deletions
diff --git a/kformula/DESIGN b/kformula/DESIGN
index eec70869..326cfb55 100644
--- a/kformula/DESIGN
+++ b/kformula/DESIGN
@@ -19,22 +19,22 @@ objects from it.
Responsebilities
(This goes for every derived element and therefore for each one.)
-- knows its children. Actually BasicElement doesn't have any. But it
- already defines that children must be known by their parent.
-- knows its bounding rectangle (its size.) The children are included
+- knows its tqchildren. Actually BasicElement doesn't have any. But it
+ already defines that tqchildren must be known by their tqparent.
+- knows its bounding rectangle (its size.) The tqchildren are included
in this rect. (Only width and height are needed. Positions are
- handled by the parent)
-//- knows its middle line. (for alignment)
-- knows it's zero point for midline (vertical alignment) and
+ handled by the tqparent)
+//- knows its middle line. (for tqalignment)
+- knows it's zero point for midline (vertical tqalignment) and
keep open the possibility of negative positions (out of bounding rect)
-- draws itself (given a painter); children are drawn, too
+- draws itself (given a painter); tqchildren are drawn, too
- knows all positions where the cursor is allowed to be. (see below)
-- knows its parent; The topmost element has no parent; there is a
+- knows its tqparent; The topmost element has no tqparent; there is a
implicit garantie that the topmost element is always a
SequenceElement.
- can save and load itself. different formates. (see below)
-- all children must be a SequenceElement. Except for SequenceElement's
- children that might be of any type.
+- all tqchildren must be a SequenceElement. Except for SequenceElement's
+ tqchildren that might be of any type.
- might have its own color.
- might have its own font size (see below).
@@ -42,14 +42,14 @@ Responsebilities
SequenceElement from BasicElement
---------------
-Manages a list of children. The children are aligned horizontally at
+Manages a list of tqchildren. The tqchildren are aligned horizontally at
one middle line. No gaps, no overlaps.
-Has no own look. It just draws all its children and is done. Except if
+Has no own look. It just draws all its tqchildren and is done. Except if
its empty. It looks like an empty space then (i.e. a little square)
Has n+1 valid cursor positions where n is the number of
-children. These are before, between and after the children.
+tqchildren. These are before, between and after the tqchildren.
May contain any (type of) element as child
@@ -57,41 +57,41 @@ except SequenceElements if they contains a SequenceElement they merge
it in the list
They can handle splitting of the sequence to allow "select an put selected item
-between parenthesis" i.e. as content child of a delimiterelement)
+between tqparenthesis" i.e. as content child of a delimiterelement)
FormulaElement from SequenceElement
--------------
-The only element those parent is null. The root of the element object
+The only element those tqparent is null. The root of the element object
tree.
This is the element that is created by the KFormulaDoc and that knows
-about it. As every other element knows its parent and therefore the
+about it. As every other element knows its tqparent and therefore the
FormulaElement we get a chance to pass messages to the outside world.
RootElement from BasicElement
-----------
-contains two children. content and index. index is optional.
+contains two tqchildren. content and index. index is optional.
IndexElement from BasicElement
------------
-contains five children. content and four indexes. all indexes are
+contains five tqchildren. content and four indexes. all indexes are
optional. If there is no index the element might be replaced by its content.
TextElement from BasicElement
-----------
-contains one char and no children at all.
+contains one char and no tqchildren at all.
Might have its own font and size. But preferes to use a reasonalbe
-font and size that are calculated from its parents font and a given
+font and size that are calculated from its tqparents font and a given
scheme (see below).
@@ -105,7 +105,7 @@ choose with.
FractionElement from BasicElement
---------------
-2 children: numerator, denominator
+2 tqchildren: numerator, denominator
DecorationElement from BasicElement
@@ -122,7 +122,7 @@ the other side of the decoration.
SumIntegralElement from BasicElement //PrefixedElement
------------------
-draws all sorts of mathematical symbols with three children. Above,
+draws all sorts of mathematical symbols with three tqchildren. Above,
below (or whereever the indices and limits go)and to the right.
@@ -130,7 +130,7 @@ GeometryElement from BasicElement
---------------
One child.
-Draw it at a fixed position relative to parent or absolute.
+Draw it at a fixed position relative to tqparent or absolute.
This is to do dirty things.
This element must not be used, kformula will provide you everything
@@ -143,7 +143,7 @@ typical of a math formula.
MatrixElement from BasicElement
-------------
-A matrix of children.
+A matrix of tqchildren.
With all align stuff, internal borders etc, matrix dots handling (i.e.
those dots or lines that complete the matrix, not well handled in TeX),
etc..
@@ -151,7 +151,7 @@ etc..
SpaceElement from BasicElement
------------
-No children at all. Provides the facility to insert horizontal spaces
+No tqchildren at all. Provides the facility to insert horizontal spaces
in the formula. (therefore it is similar to TextElement.)
@@ -183,18 +183,18 @@ If the cursor points into an element this element is said to own the
cursor. There are a few rules that describe how new cursor positions
are calculated given the current key:
-- An elements cursor positions are its children. The element might not
-own the cursor except when it is owned by one of its children. The
+- An elements cursor positions are its tqchildren. The element might not
+own the cursor except when it is owned by one of its tqchildren. The
only exception is SequenceElement which has valid cursor positions
-before, between and after its children, too.
+before, between and after its tqchildren, too.
(Therefore the cursor is always owned by a SequenceElement.)
-- Each element's children are ordered. If the cursor leaves one child
+- Each element's tqchildren are ordered. If the cursor leaves one child
the next child it. The direction depends on the key that moved the
-cursor. If there is child left the cursor is passed to the parent.
+cursor. If there is child left the cursor is passed to the tqparent.
-- If the cursor comes from our parent the first or the last child gets
+- If the cursor comes from our tqparent the first or the last child gets
it. Depending on the direction in which the cursor moved.
Please note that because each element knows its own cursor positions
@@ -261,7 +261,7 @@ We want a formula to look different according to its
surroundings. (Most obviosly according to the available height and/or width.)
It would be great to get something like automatic operator
-alignment. So if you type some formulas each on its own line the
+tqalignment. So if you type some formulas each on its own line the
assigment operators should be automatically in a column. (If the user
turns this on.)
@@ -272,7 +272,7 @@ Fonts and font size (2 ideas)
1)
Each element know its font family (also if it is not a text element) so that it
-can give this font to its children.
+can give this font to its tqchildren.
The font size is calculated starting from a global scale factor and appling to it
a local size modifier (like HTML -2, -1,+3,etc..), this also calculate the
diff --git a/kformula/formulastring.cc b/kformula/formulastring.cc
index b73603db..5d2c5b8f 100644
--- a/kformula/formulastring.cc
+++ b/kformula/formulastring.cc
@@ -17,13 +17,13 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qstringlist.h>
-#include <qtextedit.h>
-#include <qtooltip.h>
-#include <qvariant.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqstringlist.h>
+#include <tqtextedit.h>
+#include <tqtooltip.h>
+#include <tqvariant.h>
+#include <tqwhatsthis.h>
#include <kapplication.h>
#include <kmessagebox.h>
@@ -35,35 +35,35 @@
#include "kformula_view.h"
-FormulaString::FormulaString( KFormulaPartView* parent, const char* name, bool modal, WFlags fl )
- : QDialog( parent, name, modal, fl ), view( parent )
+FormulaString::FormulaString( KFormulaPartView* tqparent, const char* name, bool modal, WFlags fl )
+ : TQDialog( tqparent, name, modal, fl ), view( tqparent )
{
if ( !name )
setName( "FormulaString" );
resize( 511, 282 );
setCaption( i18n( "Formula String" ) );
setSizeGripEnabled( TRUE );
- QVBoxLayout* FormulaStringLayout = new QVBoxLayout( this, 11, 6, "FormulaStringLayout");
+ TQVBoxLayout* FormulaStringLayout = new TQVBoxLayout( this, 11, 6, "FormulaStringLayout");
- textWidget = new QTextEdit( this, "textWidget" );
+ textWidget = new TQTextEdit( this, "textWidget" );
FormulaStringLayout->addWidget( textWidget );
- QHBoxLayout* Layout2 = new QHBoxLayout( 0, 0, 6, "Layout2");
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQHBoxLayout* Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2");
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout2->addItem( spacer );
- position = new QLabel( this, "position" );
+ position = new TQLabel( this, "position" );
position->setText( trUtf8( "1:1" ) );
Layout2->addWidget( position );
FormulaStringLayout->addLayout( Layout2 );
- QHBoxLayout* Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
+ TQHBoxLayout* Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1");
buttonHelp = new KPushButton( KStdGuiItem::help(), this, "buttonHelp" );
buttonHelp->setAccel( 4144 );
buttonHelp->setAutoDefault( TRUE );
Layout1->addWidget( buttonHelp );
- spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
Layout1->addItem( spacer );
buttonOk = new KPushButton( KStdGuiItem::ok(), this, "buttonOk" );
@@ -79,11 +79,11 @@ FormulaString::FormulaString( KFormulaPartView* parent, const char* name, bool m
FormulaStringLayout->addLayout( Layout1 );
// signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( buttonHelp, SIGNAL(clicked() ), this, SLOT( helpButtonClicked() ) );
- connect( textWidget, SIGNAL( cursorPositionChanged( int, int ) ),
- this, SLOT( cursorPositionChanged( int, int ) ) );
+ connect( buttonOk, TQT_SIGNAL( clicked() ), this, TQT_SLOT( accept() ) );
+ connect( buttonCancel, TQT_SIGNAL( clicked() ), this, TQT_SLOT( reject() ) );
+ connect( buttonHelp, TQT_SIGNAL(clicked() ), this, TQT_SLOT( helpButtonClicked() ) );
+ connect( textWidget, TQT_SIGNAL( cursorPositionChanged( int, int ) ),
+ this, TQT_SLOT( cursorPositionChanged( int, int ) ) );
}
/*
@@ -91,14 +91,14 @@ FormulaString::FormulaString( KFormulaPartView* parent, const char* name, bool m
*/
FormulaString::~FormulaString()
{
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, TQt does it all for us
}
void FormulaString::accept()
{
- QStringList errorList = view->readFormulaString( textWidget->text() );
+ TQStringList errorList = view->readFormulaString( textWidget->text() );
if ( errorList.count() == 0 ) {
- QDialog::accept();
+ TQDialog::accept();
}
else {
KMessageBox::sorry( this, errorList.join( "\n" ), i18n( "Parser Error" ) );
@@ -112,7 +112,7 @@ void FormulaString::helpButtonClicked()
void FormulaString::cursorPositionChanged( int para, int pos )
{
- position->setText( QString( "%1:%2" ).arg( para+1 ).arg( pos+1 ) );
+ position->setText( TQString( "%1:%2" ).tqarg( para+1 ).tqarg( pos+1 ) );
}
#include "formulastring.moc"
diff --git a/kformula/formulastring.h b/kformula/formulastring.h
index 3cfdbf9d..2ee9b5f3 100644
--- a/kformula/formulastring.h
+++ b/kformula/formulastring.h
@@ -20,31 +20,32 @@
#ifndef FORMULASTRING_H
#define FORMULASTRING_H
-#include <qvariant.h>
-#include <qdialog.h>
+#include <tqvariant.h>
+#include <tqdialog.h>
-class QGridLayout;
-class QHBoxLayout;
-class QLabel;
-class QPushButton;
-class QTextEdit;
-class QVBoxLayout;
+class TQGridLayout;
+class TQHBoxLayout;
+class TQLabel;
+class TQPushButton;
+class TQTextEdit;
+class TQVBoxLayout;
class KFormulaPartView;
-class FormulaString : public QDialog
+class FormulaString : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- FormulaString( KFormulaPartView* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ FormulaString( KFormulaPartView* tqparent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~FormulaString();
- QTextEdit* textWidget;
- QPushButton* buttonHelp;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QLabel* position;
+ TQTextEdit* textWidget;
+ TQPushButton* buttonHelp;
+ TQPushButton* buttonOk;
+ TQPushButton* buttonCancel;
+ TQLabel* position;
protected slots:
diff --git a/kformula/fsparser.cc b/kformula/fsparser.cc
index 4b7f1c88..3d425a16 100644
--- a/kformula/fsparser.cc
+++ b/kformula/fsparser.cc
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include <kdebug.h>
#include <klocale.h>
@@ -36,7 +36,7 @@ public:
ParserNode() { debugCount++; }
virtual ~ParserNode() { debugCount--; }
//virtual void output( ostream& ) = 0;
- virtual void buildXML( QDomDocument& doc, QDomElement element ) = 0;
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element ) = 0;
virtual bool isSimple() { return false; }
static int debugCount;
@@ -46,36 +46,36 @@ int ParserNode::debugCount = 0;
class PrimaryNode : public ParserNode {
public:
- PrimaryNode( QString primary ) : m_primary( primary ), m_functionName( false ) {}
+ PrimaryNode( TQString primary ) : m_primary( primary ), m_functionName( false ) {}
//virtual void output( ostream& stream ) { stream << "PrimaryNode {" << m_primary << "}" << endl; }
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
virtual bool isSimple() { return true; }
- void setUnicode( QChar unicode ) { m_unicode = unicode; }
+ void setUnicode( TQChar tqunicode ) { m_tqunicode = tqunicode; }
void setFunctionName( bool functionName ) { m_functionName = functionName; }
- QString primary() const { return m_primary; }
+ TQString primary() const { return m_primary; }
private:
- QString m_primary;
- QChar m_unicode;
+ TQString m_primary;
+ TQChar m_tqunicode;
bool m_functionName;
};
-void PrimaryNode::buildXML( QDomDocument& doc, QDomElement element )
+void PrimaryNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
- if ( m_unicode != QChar::null ) {
- QDomElement de = doc.createElement( "TEXT" );
- de.setAttribute( "CHAR", QString( m_unicode ) );
+ if ( m_tqunicode != TQChar::null ) {
+ TQDomElement de = doc.createElement( "TEXT" );
+ de.setAttribute( "CHAR", TQString( m_tqunicode ) );
de.setAttribute( "SYMBOL", "3" );
element.appendChild( de );
}
else {
if ( m_functionName ) {
- QDomElement namesequence = doc.createElement( "NAMESEQUENCE" );
+ TQDomElement namesequence = doc.createElement( "NAMESEQUENCE" );
element.appendChild( namesequence );
element = namesequence;
}
for ( uint i = 0; i < m_primary.length(); i++ ) {
- QDomElement de = doc.createElement( "TEXT" );
- de.setAttribute( "CHAR", QString( m_primary[i] ) );
+ TQDomElement de = doc.createElement( "TEXT" );
+ de.setAttribute( "CHAR", TQString( m_primary[i] ) );
element.appendChild( de );
}
}
@@ -85,14 +85,14 @@ class UnaryMinus : public ParserNode {
public:
UnaryMinus( ParserNode* primary ) : m_primary( primary ) {}
~UnaryMinus() { delete m_primary; }
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
private:
ParserNode* m_primary;
};
-void UnaryMinus::buildXML( QDomDocument& doc, QDomElement element )
+void UnaryMinus::buildXML( TQDomDocument& doc, TQDomElement element )
{
- QDomElement de = doc.createElement( "TEXT" );
+ TQDomElement de = doc.createElement( "TEXT" );
de.setAttribute( "CHAR", "-" );
element.appendChild( de );
m_primary->buildXML( doc, element );
@@ -100,7 +100,7 @@ void UnaryMinus::buildXML( QDomDocument& doc, QDomElement element )
class OperatorNode : public ParserNode {
public:
- OperatorNode( QString type, ParserNode* lhs, ParserNode* rhs )
+ OperatorNode( TQString type, ParserNode* lhs, ParserNode* rhs )
: m_type( type ), m_lhs( lhs ), m_rhs( rhs ) {}
~OperatorNode() { delete m_rhs; delete m_lhs; }
// virtual void output( ostream& stream ) {
@@ -108,64 +108,64 @@ public:
// m_lhs->output( stream ); stream << m_type; m_rhs->output( stream );
// stream << "}" << endl; }
protected:
- QString m_type;
+ TQString m_type;
ParserNode* m_lhs;
ParserNode* m_rhs;
};
class AssignNode : public OperatorNode {
public:
- AssignNode( QString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ AssignNode( TQString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
};
-void AssignNode::buildXML( QDomDocument& doc, QDomElement element )
+void AssignNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
m_lhs->buildXML( doc, element );
- QDomElement de = doc.createElement( "TEXT" );
- de.setAttribute( "CHAR", QString( m_type ) );
+ TQDomElement de = doc.createElement( "TEXT" );
+ de.setAttribute( "CHAR", TQString( m_type ) );
element.appendChild( de );
m_rhs->buildXML( doc, element );
}
class ExprNode : public OperatorNode {
public:
- ExprNode( QString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ ExprNode( TQString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
};
-void ExprNode::buildXML( QDomDocument& doc, QDomElement element )
+void ExprNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
m_lhs->buildXML( doc, element );
- QDomElement de = doc.createElement( "TEXT" );
- de.setAttribute( "CHAR", QString( m_type ) );
+ TQDomElement de = doc.createElement( "TEXT" );
+ de.setAttribute( "CHAR", TQString( m_type ) );
element.appendChild( de );
m_rhs->buildXML( doc, element );
}
class TermNode : public OperatorNode {
public:
- TermNode( QString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ TermNode( TQString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
};
-void TermNode::buildXML( QDomDocument& doc, QDomElement element )
+void TermNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
if ( m_type == "*" ) {
m_lhs->buildXML( doc, element );
- QDomElement de = doc.createElement( "TEXT" );
- de.setAttribute( "CHAR", QString( m_type ) );
+ TQDomElement de = doc.createElement( "TEXT" );
+ de.setAttribute( "CHAR", TQString( m_type ) );
element.appendChild( de );
m_rhs->buildXML( doc, element );
}
else {
- QDomElement fraction = doc.createElement( "FRACTION" );
- QDomElement numerator = doc.createElement( "NUMERATOR" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement fraction = doc.createElement( "FRACTION" );
+ TQDomElement numerator = doc.createElement( "NUMERATOR" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
m_lhs->buildXML( doc, sequence );
numerator.appendChild( sequence );
fraction.appendChild( numerator );
- QDomElement denominator = doc.createElement( "DENOMINATOR" );
+ TQDomElement denominator = doc.createElement( "DENOMINATOR" );
sequence = doc.createElement( "SEQUENCE" );
m_rhs->buildXML( doc, sequence );
denominator.appendChild( sequence );
@@ -177,20 +177,20 @@ void TermNode::buildXML( QDomDocument& doc, QDomElement element )
class PowerNode : public OperatorNode {
public:
- PowerNode( QString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ PowerNode( TQString type, ParserNode* lhs, ParserNode* rhs ) : OperatorNode( type, lhs, rhs ) {}
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
};
-void PowerNode::buildXML( QDomDocument& doc, QDomElement element )
+void PowerNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
- QDomElement index = doc.createElement( "INDEX" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement index = doc.createElement( "INDEX" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
content.appendChild( sequence );
index.appendChild( content );
if ( !m_lhs->isSimple() ) {
- QDomElement bracket = doc.createElement( "BRACKET" );
+ TQDomElement bracket = doc.createElement( "BRACKET" );
bracket.setAttribute( "LEFT", '(' );
bracket.setAttribute( "RIGHT", ')' );
sequence.appendChild( bracket );
@@ -203,14 +203,14 @@ void PowerNode::buildXML( QDomDocument& doc, QDomElement element )
}
m_lhs->buildXML( doc, sequence );
if ( m_type == "_" ) {
- QDomElement lowerRight = doc.createElement( "LOWERRIGHT" );
+ TQDomElement lowerRight = doc.createElement( "LOWERRIGHT" );
sequence = doc.createElement( "SEQUENCE" );
m_rhs->buildXML( doc, sequence );
lowerRight.appendChild( sequence );
index.appendChild( lowerRight );
}
else {
- QDomElement upperRight = doc.createElement( "UPPERRIGHT" );
+ TQDomElement upperRight = doc.createElement( "UPPERRIGHT" );
sequence = doc.createElement( "SEQUENCE" );
m_rhs->buildXML( doc, sequence );
upperRight.appendChild( sequence );
@@ -222,24 +222,24 @@ void PowerNode::buildXML( QDomDocument& doc, QDomElement element )
class FunctionNode : public ParserNode {
public:
- FunctionNode( PrimaryNode* name, QPtrList<ParserNode>& args ) : m_name( name ), m_args( args ) {
+ FunctionNode( PrimaryNode* name, TQPtrList<ParserNode>& args ) : m_name( name ), m_args( args ) {
m_args.setAutoDelete( true );
}
~FunctionNode() { delete m_name; }
//virtual void output( ostream& stream );
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
private:
- void buildSymbolXML( QDomDocument& doc, QDomElement element, KFormula::SymbolType type );
+ void buildSymbolXML( TQDomDocument& doc, TQDomElement element, KFormula::SymbolType type );
PrimaryNode* m_name;
- QPtrList<ParserNode> m_args;
+ TQPtrList<ParserNode> m_args;
};
-void FunctionNode::buildSymbolXML( QDomDocument& doc, QDomElement element, KFormula::SymbolType type )
+void FunctionNode::buildSymbolXML( TQDomDocument& doc, TQDomElement element, KFormula::SymbolType type )
{
- QDomElement symbol = doc.createElement( "SYMBOL" );
+ TQDomElement symbol = doc.createElement( "SYMBOL" );
symbol.setAttribute( "TYPE", type );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
m_args.at( 0 )->buildXML( doc, sequence );
content.appendChild( sequence );
symbol.appendChild( content );
@@ -247,13 +247,13 @@ void FunctionNode::buildSymbolXML( QDomDocument& doc, QDomElement element, KForm
ParserNode* lowerLimit = m_args.at( m_args.count()-2 );
ParserNode* upperLimit = m_args.at( m_args.count()-1 );
- QDomElement lower = doc.createElement( "LOWER" );
+ TQDomElement lower = doc.createElement( "LOWER" );
sequence = doc.createElement( "SEQUENCE" );
lowerLimit->buildXML( doc, sequence );
lower.appendChild( sequence );
symbol.appendChild( lower );
- QDomElement upper = doc.createElement( "UPPER" );
+ TQDomElement upper = doc.createElement( "UPPER" );
sequence = doc.createElement( "SEQUENCE" );
upperLimit->buildXML( doc, sequence );
upper.appendChild( sequence );
@@ -262,25 +262,25 @@ void FunctionNode::buildSymbolXML( QDomDocument& doc, QDomElement element, KForm
element.appendChild( symbol );
}
-void FunctionNode::buildXML( QDomDocument& doc, QDomElement element )
+void FunctionNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
if ( ( m_name->primary() == "sqrt" ) && ( m_args.count() == 1 ) ) {
- QDomElement root = doc.createElement( "ROOT" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement root = doc.createElement( "ROOT" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
m_args.at( 0 )->buildXML( doc, sequence );
content.appendChild( sequence );
root.appendChild( content );
element.appendChild( root );
}
else if ( ( m_name->primary() == "pow" ) && ( m_args.count() == 2 ) ) {
- QDomElement index = doc.createElement( "INDEX" );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement index = doc.createElement( "INDEX" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
m_args.at( 0 )->buildXML( doc, sequence );
content.appendChild( sequence );
index.appendChild( content );
- QDomElement upperRight = doc.createElement( "UPPERRIGHT" );
+ TQDomElement upperRight = doc.createElement( "UPPERRIGHT" );
sequence = doc.createElement( "SEQUENCE" );
m_args.at( 1 )->buildXML( doc, sequence );
upperRight.appendChild( sequence );
@@ -301,16 +301,16 @@ void FunctionNode::buildXML( QDomDocument& doc, QDomElement element )
}
else {
m_name->buildXML( doc, element );
- QDomElement bracket = doc.createElement( "BRACKET" );
+ TQDomElement bracket = doc.createElement( "BRACKET" );
bracket.setAttribute( "LEFT", '(' );
bracket.setAttribute( "RIGHT", ')' );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
for ( uint i = 0; i < m_args.count(); i++ ) {
m_args.at( i )->buildXML( doc, sequence );
if ( i < m_args.count()-1 ) {
- QDomElement de = doc.createElement( "TEXT" );
+ TQDomElement de = doc.createElement( "TEXT" );
de.setAttribute( "CHAR", "," );
sequence.appendChild( de );
}
@@ -332,25 +332,25 @@ void FunctionNode::buildXML( QDomDocument& doc, QDomElement element )
class RowNode : public ParserNode {
public:
- RowNode( QPtrList<ParserNode> row ) : m_row( row ) { m_row.setAutoDelete( true ); }
+ RowNode( TQPtrList<ParserNode> row ) : m_row( row ) { m_row.setAutoDelete( true ); }
//virtual void output( ostream& stream );
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
uint columns() const { return m_row.count(); }
void setRequiredColumns( uint requiredColumns ) { m_requiredColumns = requiredColumns; }
private:
- QPtrList<ParserNode> m_row;
+ TQPtrList<ParserNode> m_row;
uint m_requiredColumns;
};
-void RowNode::buildXML( QDomDocument& doc, QDomElement element )
+void RowNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
for ( uint i = 0; i < m_requiredColumns; i++ ) {
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
if ( i < m_row.count() ) {
m_row.at( i )->buildXML( doc, sequence );
}
else {
- QDomElement de = doc.createElement( "TEXT" );
+ TQDomElement de = doc.createElement( "TEXT" );
de.setAttribute( "CHAR", "0" );
sequence.appendChild( de );
}
@@ -372,35 +372,35 @@ void RowNode::buildXML( QDomDocument& doc, QDomElement element )
class MatrixNode : public ParserNode {
public:
- MatrixNode( QPtrList<RowNode> rows ) : m_rows( rows ) { m_rows.setAutoDelete( true ); }
+ MatrixNode( TQPtrList<RowNode> rows ) : m_rows( rows ) { m_rows.setAutoDelete( true ); }
//virtual void output( ostream& stream );
- virtual void buildXML( QDomDocument& doc, QDomElement element );
+ virtual void buildXML( TQDomDocument& doc, TQDomElement element );
virtual bool isSimple() { return true; }
uint columns();
uint rows() { return m_rows.count(); }
private:
- QPtrList<RowNode> m_rows;
+ TQPtrList<RowNode> m_rows;
};
uint MatrixNode::columns()
{
uint columns = 0;
for ( uint i = 0; i < m_rows.count(); i++ ) {
- columns = QMAX( columns, m_rows.at( i )->columns() );
+ columns = TQMAX( columns, m_rows.at( i )->columns() );
}
return columns;
}
-void MatrixNode::buildXML( QDomDocument& doc, QDomElement element )
+void MatrixNode::buildXML( TQDomDocument& doc, TQDomElement element )
{
- QDomElement bracket = doc.createElement( "BRACKET" );
+ TQDomElement bracket = doc.createElement( "BRACKET" );
bracket.setAttribute( "LEFT", '(' );
bracket.setAttribute( "RIGHT", ')' );
- QDomElement content = doc.createElement( "CONTENT" );
- QDomElement sequence = doc.createElement( "SEQUENCE" );
+ TQDomElement content = doc.createElement( "CONTENT" );
+ TQDomElement sequence = doc.createElement( "SEQUENCE" );
uint cols = columns();
- QDomElement matrix = doc.createElement( "MATRIX" );
+ TQDomElement matrix = doc.createElement( "MATRIX" );
matrix.setAttribute( "ROWS", m_rows.count() );
matrix.setAttribute( "COLUMNS", cols );
for ( uint i = 0; i < m_rows.count(); i++ ) {
@@ -427,7 +427,7 @@ void MatrixNode::buildXML( QDomDocument& doc, QDomElement element )
// }
-FormulaStringParser::FormulaStringParser( const KFormula::SymbolTable& symbolTable, QString formula )
+FormulaStringParser::FormulaStringParser( const KFormula::SymbolTable& symbolTable, TQString formula )
: m_symbolTable( symbolTable ), m_formula( formula ),
pos( 0 ), line( 1 ), column( 1 ), m_newlineIsSpace( true )
{
@@ -441,18 +441,18 @@ FormulaStringParser::~FormulaStringParser()
}
}
-QDomDocument FormulaStringParser::parse()
+TQDomDocument FormulaStringParser::parse()
{
nextToken();
head = parseAssign();
//head->output( cout );
if ( !eol() ) {
- error( QString( i18n( "Aborted parsing at %1:%2" ) ).arg( line ).arg( column ) );
+ error( TQString( i18n( "Aborted parsing at %1:%2" ) ).tqarg( line ).tqarg( column ) );
}
- QDomDocument doc = KFormula::Document::createDomDocument();
- QDomElement root = doc.documentElement();
- QDomElement de = doc.createElement( "FORMULA" );
+ TQDomDocument doc = KFormula::Document::createDomDocument();
+ TQDomElement root = doc.documentElement();
+ TQDomElement de = doc.createElement( "FORMULA" );
// here comes the current version of FormulaElement
//de.setAttribute( "VERSION", "4" );
head->buildXML( doc, de );
@@ -468,7 +468,7 @@ ParserNode* FormulaStringParser::parseAssign()
for ( ;; ) {
switch ( currentType ) {
case ASSIGN: {
- QString c = current;
+ TQString c = current;
nextToken();
lhs = new AssignNode( c, lhs, parseExpr() );
break;
@@ -486,7 +486,7 @@ ParserNode* FormulaStringParser::parseExpr()
switch ( currentType ) {
case PLUS:
case SUB: {
- QString c = current;
+ TQString c = current;
nextToken();
lhs = new ExprNode( c, lhs, parseTerm() );
break;
@@ -504,7 +504,7 @@ ParserNode* FormulaStringParser::parseTerm()
switch ( currentType ) {
case MUL:
case DIV: {
- QString c = current;
+ TQString c = current;
nextToken();
lhs = new TermNode( c, lhs, parsePower() );
break;
@@ -522,7 +522,7 @@ ParserNode* FormulaStringParser::parsePower()
switch ( currentType ) {
case INDEX:
case POW: {
- QString c = current;
+ TQString c = current;
nextToken();
lhs = new PowerNode( c, lhs, parsePrimary() );
break;
@@ -543,11 +543,11 @@ ParserNode* FormulaStringParser::parsePrimary()
}
case NAME: {
PrimaryNode* node = new PrimaryNode( current );
- node->setUnicode( m_symbolTable.unicode( current ) );
+ node->setUnicode( m_symbolTable.tqunicode( current ) );
nextToken();
if ( currentType == LP ) {
nextToken();
- QPtrList<ParserNode> args;
+ TQPtrList<ParserNode> args;
args.setAutoDelete( false );
while ( ( currentType != EOL ) && ( currentType != RP ) ) {
ParserNode* node = parseExpr();
@@ -556,7 +556,7 @@ ParserNode* FormulaStringParser::parsePrimary()
nextToken();
}
}
- expect( RP, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( ")" ) );
+ expect( RP, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( ")" ) );
node->setFunctionName( true );
return new FunctionNode( node, args );
}
@@ -571,20 +571,20 @@ ParserNode* FormulaStringParser::parsePrimary()
case LP: {
nextToken();
ParserNode* node = parseExpr();
- expect( RP, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( ")" ) );
+ expect( RP, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( ")" ) );
return node;
}
case LB: {
nextToken();
- QPtrList<RowNode> rows;
+ TQPtrList<RowNode> rows;
rows.setAutoDelete( false );
bool innerBrackets = currentType == LB;
m_newlineIsSpace = innerBrackets;
while ( ( currentType != EOL ) && ( currentType != RB ) ) {
if ( innerBrackets ) {
- expect( LB, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( "[" ) );
+ expect( LB, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( "[" ) );
}
- QPtrList<ParserNode> row;
+ TQPtrList<ParserNode> row;
row.setAutoDelete( false );
while ( ( currentType != EOL ) && ( currentType != RB ) &&
( innerBrackets || ( currentType != SEMIC && currentType != NEWLINE ) ) ) {
@@ -594,7 +594,7 @@ ParserNode* FormulaStringParser::parsePrimary()
}
}
if ( innerBrackets ) {
- expect( RB, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( "]" ) );
+ expect( RB, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( "]" ) );
if ( currentType == COMMA ) {
nextToken();
}
@@ -605,20 +605,20 @@ ParserNode* FormulaStringParser::parsePrimary()
nextToken();
}
else {
- expect( SEMIC, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( ";" ) );
+ expect( SEMIC, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( ";" ) );
}
}
}
rows.append( new RowNode( row ) );
}
m_newlineIsSpace = true;
- expect( RB, QString( i18n( "'%3' expected at %1:%2" ) ).arg( line ).arg( column ).arg( "]" ) );
+ expect( RB, TQString( i18n( "'%3' expected at %1:%2" ) ).tqarg( line ).tqarg( column ).tqarg( "]" ) );
MatrixNode* node = new MatrixNode( rows );
if ( node->columns() == 0 ) {
- error( QString( i18n( "Null columns in Matrix at %1:%2" ) ).arg( line ).arg( column ) );
+ error( TQString( i18n( "Null columns in Matrix at %1:%2" ) ).tqarg( line ).tqarg( column ) );
}
if ( node->rows() == 0 ) {
- error( QString( i18n( "Null rows in Matrix at %1:%2" ) ).arg( line ).arg( column ) );
+ error( TQString( i18n( "Null rows in Matrix at %1:%2" ) ).tqarg( line ).tqarg( column ) );
}
return node;
}
@@ -628,12 +628,12 @@ ParserNode* FormulaStringParser::parsePrimary()
return node;
}
default:
- error( QString( i18n( "Unexpected token at %1:%2" ) ).arg( line ).arg( column ) );
+ error( TQString( i18n( "Unexpected token at %1:%2" ) ).tqarg( line ).tqarg( column ) );
return new PrimaryNode( "?" );
}
}
-void FormulaStringParser::expect( TokenType type, QString msg )
+void FormulaStringParser::expect( TokenType type, TQString msg )
{
if ( currentType == type ) {
nextToken();
@@ -643,7 +643,7 @@ void FormulaStringParser::expect( TokenType type, QString msg )
}
}
-QString FormulaStringParser::nextToken()
+TQString FormulaStringParser::nextToken()
{
// We skip any ' or " so that we can parse string literals.
while ( !eol() && ( m_formula[pos].isSpace() ||
@@ -665,7 +665,7 @@ QString FormulaStringParser::nextToken()
}
if ( eol() ) {
currentType = EOL;
- return QString::null;
+ return TQString();
}
if ( m_formula[pos].isDigit() || m_formula[pos] == '.' ) {
uint begin = pos;
@@ -762,7 +762,7 @@ void FormulaStringParser::readNumber()
readDigits();
if ( pos < m_formula.length()-1 ) {
- QChar ch = m_formula[pos];
+ TQChar ch = m_formula[pos];
// Look for a dot.
if ( ch == '.' ) {
@@ -773,7 +773,7 @@ void FormulaStringParser::readNumber()
readDigits();
}
else if ( !digitsBeforeDot ) {
- error( QString( i18n( "A single '.' is not a number at %1:%2" ) ).arg( line ).arg( column ) );
+ error( TQString( i18n( "A single '.' is not a number at %1:%2" ) ).tqarg( line ).tqarg( column ) );
return;
}
}
@@ -822,7 +822,7 @@ void FormulaStringParser::readDigits()
}
}
-void FormulaStringParser::error( QString err )
+void FormulaStringParser::error( TQString err )
{
kdDebug( KFormula::DEBUGID ) << err << " (" << currentType << "; " << current << ")" << endl;
m_errorList.push_back( err );
diff --git a/kformula/fsparser.h b/kformula/fsparser.h
index ab594a4d..b79b2b22 100644
--- a/kformula/fsparser.h
+++ b/kformula/fsparser.h
@@ -20,9 +20,9 @@
#ifndef FSPARSER_H
#define FSPARSER_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdom.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdom.h>
namespace KFormula { class SymbolTable; }
class ParserNode;
@@ -32,12 +32,12 @@ class ParserNode;
*/
class FormulaStringParser {
public:
- FormulaStringParser( const KFormula::SymbolTable& symbolTable, QString formula );
+ FormulaStringParser( const KFormula::SymbolTable& symbolTable, TQString formula );
~FormulaStringParser();
- QDomDocument parse();
+ TQDomDocument parse();
- QStringList errorList() const { return m_errorList; }
+ TQStringList errorList() const { return m_errorList; }
private:
@@ -49,26 +49,26 @@ private:
ParserNode* parseTerm();
ParserNode* parsePower();
ParserNode* parsePrimary();
- void expect( TokenType type, QString msg );
+ void expect( TokenType type, TQString msg );
- QString nextToken();
+ TQString nextToken();
bool eol() { return m_formula.length() == pos; }
void readNumber();
void readDigits();
- void error( QString err );
- QStringList m_errorList;
+ void error( TQString err );
+ TQStringList m_errorList;
const KFormula::SymbolTable& m_symbolTable;
- QString m_formula;
+ TQString m_formula;
uint pos;
uint line;
uint column;
bool m_newlineIsSpace;
TokenType currentType;
- QString current;
+ TQString current;
ParserNode* head;
};
diff --git a/kformula/kfconfig.cc b/kformula/kfconfig.cc
index 0a24dc8f..2e99e67a 100644
--- a/kformula/kfconfig.cc
+++ b/kformula/kfconfig.cc
@@ -29,24 +29,24 @@
#include "kformula_view.h"
-KFConfig::KFConfig( KFormulaPartView* parent )
+KFConfig::KFConfig( KFormulaPartView* tqparent )
: KDialogBase( KDialogBase::IconList, i18n( "Configure KFormula" ),
KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel | KDialogBase::Default,
- KDialogBase::Ok, parent )
+ KDialogBase::Ok, tqparent )
{
//kdDebug( 40000 ) << "KFConfig::KFConfig" << endl;
- QVBox* page1 = addVBoxPage( i18n( "Formula" ), i18n( "Formula Settings" ),
+ TQVBox* page1 = addVBoxPage( i18n( "Formula" ), i18n( "Formula Settings" ),
BarIcon( "kformula", KIcon::SizeMedium ) );
- _page = new KFormula::ConfigurePage( parent->document()->getDocument(), this,
+ _page = new KFormula::ConfigurePage( tqparent->document()->getDocument(), this,
KFormulaFactory::global()->config(),
page1 );
-// QVBox* page2 = addVBoxPage( i18n( "Math Fonts" ), i18n( "Math Fonts Settings" ),
+// TQVBox* page2 = addVBoxPage( i18n( "Math Fonts" ), i18n( "Math Fonts Settings" ),
// BarIcon( "kformula", KIcon::SizeMedium ) );
-// _mathFontPage = new KFormula::MathFontsConfigurePage( parent->document()->getDocument(), this,
+// _mathFontPage = new KFormula::MathFontsConfigurePage( tqparent->document()->getDocument(), this,
// KFormulaFactory::global()->config(),
// page2 );
- connect( this, SIGNAL( okClicked() ), this, SLOT( slotApply() ) );
+ connect( this, TQT_SIGNAL( okClicked() ), this, TQT_SLOT( slotApply() ) );
}
void KFConfig::slotApply()
diff --git a/kformula/kfconfig.h b/kformula/kfconfig.h
index 9231ff1c..cc23c371 100644
--- a/kformula/kfconfig.h
+++ b/kformula/kfconfig.h
@@ -34,8 +34,9 @@ class KFormulaPartView;
class KFConfig : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KFConfig( KFormulaPartView* parent );
+ KFConfig( KFormulaPartView* tqparent );
public slots:
void slotApply();
diff --git a/kformula/kformula_doc.cc b/kformula/kformula_doc.cc
index 4e83baf8..5b605e60 100644
--- a/kformula/kformula_doc.cc
+++ b/kformula/kformula_doc.cc
@@ -23,15 +23,15 @@
#include "kformula_view.h"
#include "kformula_factory.h"
-#include <qbitmap.h>
-#include <qcolor.h>
-#include <qdom.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qprinter.h>
-#include <qstring.h>
-#include <qwmatrix.h>
-#include <qfile.h>
+#include <tqbitmap.h>
+#include <tqcolor.h>
+#include <tqdom.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
+#include <tqprinter.h>
+#include <tqstring.h>
+#include <tqwmatrix.h>
+#include <tqfile.h>
#include <config.h>
#include <unistd.h>
@@ -55,8 +55,8 @@
#include <kformuladocument.h>
-KFormulaDoc::KFormulaDoc(QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, bool singleViewMode)
- : KoDocument(parentWidget, widgetName, parent, name, singleViewMode)
+KFormulaDoc::KFormulaDoc(TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, bool singleViewMode)
+ : KoDocument(tqparentWidget, widgetName, tqparent, name, singleViewMode)
{
setInstance(KFormulaFactory::global(), false);
//kdDebug(39001) << "General Settings" << endl;
@@ -72,8 +72,8 @@ KFormulaDoc::KFormulaDoc(QWidget *parentWidget, const char *widgetName, QObject*
document->setEnabled( true );
// the modify flag
- connect(history, SIGNAL(commandExecuted()), this, SLOT(commandExecuted()));
- connect(history, SIGNAL(documentRestored()), this, SLOT(documentRestored()));
+ connect(history, TQT_SIGNAL(commandExecuted()), this, TQT_SLOT(commandExecuted()));
+ connect(history, TQT_SIGNAL(documentRestored()), this, TQT_SLOT(documentRestored()));
dcopObject();
}
@@ -96,15 +96,15 @@ bool KFormulaDoc::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
KTempFile contentTmpFile;
contentTmpFile.setAutoDelete( true );
- QFile* tmpFile = contentTmpFile.file();
+ TQFile* tmpFile = contentTmpFile.file();
//todo save content
- QTextStream stream(tmpFile);
- stream.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream stream(tmpFile);
+ stream.setEncoding( TQTextStream::UnicodeUTF8 );
formula->saveMathML( stream, true );
tmpFile->close();
- contentWriter->addCompleteElement( tmpFile );
+ contentWriter->addCompleteElement( TQT_TQIODEVICE(tmpFile) );
contentTmpFile.close();
@@ -123,14 +123,14 @@ bool KFormulaDoc::saveOasis( KoStore* store, KoXmlWriter* manifestWriter )
}
-QDomDocument KFormulaDoc::saveXML()
+TQDomDocument KFormulaDoc::saveXML()
{
- QDomDocument doc = document->saveXML();
+ TQDomDocument doc = document->saveXML();
history->documentSaved();
return doc;
}
-bool KFormulaDoc::loadOasis( const QDomDocument& doc, KoOasisStyles&, const QDomDocument&, KoStore* )
+bool KFormulaDoc::loadOasis( const TQDomDocument& doc, KoOasisStyles&, const TQDomDocument&, KoStore* )
{
// we don't have style into this format
// we don't have settings into kformula (for the moment)
@@ -144,7 +144,7 @@ bool KFormulaDoc::loadOasis( const QDomDocument& doc, KoOasisStyles&, const QDom
return false;
}
-bool KFormulaDoc::loadXML(QIODevice *, const QDomDocument& doc)
+bool KFormulaDoc::loadXML(TQIODevice *, const TQDomDocument& doc)
{
if ( doc.doctype().name().lower() == "math"
|| doc.documentElement().tagName().lower() == "math" )
@@ -166,16 +166,16 @@ bool KFormulaDoc::loadXML(QIODevice *, const QDomDocument& doc)
* It is reimplemented to handle the special case of MathML, since it is
* a native format but not compressed.
*/
-bool KFormulaDoc::saveNativeFormat( const QString & file )
+bool KFormulaDoc::saveNativeFormat( const TQString & file )
{
- QCString mimeType = outputMimeType();
- bool mathml = !mimeType.isEmpty() && mimeType.contains( "mathml", false );
+ TQCString mimeType = outputMimeType();
+ bool mathml = !mimeType.isEmpty() && mimeType.tqcontains( "mathml", false );
if ( mathml ) {
- QFile f( file );
+ TQFile f( file );
if ( f.open( IO_WriteOnly | IO_Translate ) )
{
- QTextStream stream( &f );
- stream.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream stream( &f );
+ stream.setEncoding( TQTextStream::UnicodeUTF8 );
formula->saveMathML( stream, false );
f.close();
return true;
@@ -183,11 +183,11 @@ bool KFormulaDoc::saveNativeFormat( const QString & file )
else
return false;
}
- // If it's not MathML, let the parent handle it
+ // If it's not MathML, let the tqparent handle it
return KoDocument::saveNativeFormat( file );
}
-KoView* KFormulaDoc::createViewInstance(QWidget* _parent, const char *name)
+KoView* KFormulaDoc::createViewInstance(TQWidget* _parent, const char *name)
{
return new KFormulaPartView(this, _parent, name);
}
@@ -206,42 +206,42 @@ void KFormulaDoc::documentRestored()
}
-bool KFormulaDoc::initDoc(InitDocFlags /*flags*/, QWidget* /*parentWidget*/)
+bool KFormulaDoc::initDoc(InitDocFlags /*flags*/, TQWidget* /*tqparentWidget*/)
{
// If nothing is loaded, do initialize here
return TRUE;
}
-void KFormulaDoc::showStartUpWidget(KoMainWindow* parent, bool /*alwaysShow*/)
+void KFormulaDoc::showStartUpWidget(KoMainWindow* tqparent, bool /*alwaysShow*/)
{
- parent->setRootDocument( this );
+ tqparent->setRootDocument( this );
}
-bool KFormulaDoc::showEmbedInitDialog(QWidget* /*parent*/)
+bool KFormulaDoc::showEmbedInitDialog(TQWidget* /*tqparent*/)
{
return true;
}
-void KFormulaDoc::paintContent(QPainter& painter, const QRect& rect, bool transparent, double zoomX, double zoomY)
+void KFormulaDoc::paintContent(TQPainter& painter, const TQRect& rect, bool transparent, double zoomX, double zoomY)
{
// ####### handle transparency and zoom
// Need to draw only the document rectangle described in the parameter rect.
- bool forPrint = painter.device() && painter.device()->devType() == QInternal::Printer;
+ bool forPrint = painter.device() && painter.device()->devType() == TQInternal::Printer;
document->setZoomAndResolution( 100, zoomX, zoomY, true, forPrint );
if ( !transparent ) {
- painter.fillRect( rect, Qt::white );
+ painter.fillRect( rect, TQt::white );
}
formula->draw( painter, rect );
}
-QString KFormulaDoc::configFile() const
+TQString KFormulaDoc::configFile() const
{
// return readConfigFile( locate( "data", "kformula/kformula.rc",
// KFormulaFactory::global() ) );
// return readConfigFile( "kformula.rc" );
- return QString::null;
+ return TQString();
}
#include "kformula_doc.moc"
diff --git a/kformula/kformula_doc.h b/kformula/kformula_doc.h
index b139f922..ab775bc2 100644
--- a/kformula/kformula_doc.h
+++ b/kformula/kformula_doc.h
@@ -21,8 +21,8 @@
#ifndef KFORMULA_DOC_H
#define KFORMULA_DOC_H
-#include <qptrlist.h>
-#include <qpainter.h>
+#include <tqptrlist.h>
+#include <tqpainter.h>
#include <kcommand.h>
#include <KoDocument.h>
@@ -49,24 +49,25 @@ KFORMULA_NAMESPACE_END
class KFormulaDoc : public KoDocument
{
Q_OBJECT
+ TQ_OBJECT
public:
- KFormulaDoc(QWidget *parentWidget = 0,
+ KFormulaDoc(TQWidget *tqparentWidget = 0,
const char *widgetName = 0,
- QObject* parent = 0,
+ TQObject* tqparent = 0,
const char* name = 0,
bool singleViewMode = false);
~KFormulaDoc();
- virtual void paintContent( QPainter &painter, const QRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
+ virtual void paintContent( TQPainter &painter, const TQRect &rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
- virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0);
- virtual void showStartUpWidget(KoMainWindow* parent, bool alwaysShow = false);
- virtual bool showEmbedInitDialog(QWidget* parent);
- virtual bool loadOasis( const QDomDocument& doc, KoOasisStyles& oasisStyles, const QDomDocument& settings, KoStore* );
- virtual bool loadXML(QIODevice *, const QDomDocument& doc);
- virtual QDomDocument saveXML();
+ virtual bool initDoc(InitDocFlags flags, TQWidget* tqparentWidget=0);
+ virtual void showStartUpWidget(KoMainWindow* tqparent, bool alwaysShow = false);
+ virtual bool showEmbedInitDialog(TQWidget* tqparent);
+ virtual bool loadOasis( const TQDomDocument& doc, KoOasisStyles& oasisStyles, const TQDomDocument& settings, KoStore* );
+ virtual bool loadXML(TQIODevice *, const TQDomDocument& doc);
+ virtual TQDomDocument saveXML();
virtual bool saveOasis( KoStore* store, KoXmlWriter* manifestWriter );
/**
@@ -74,7 +75,7 @@ public:
* It is reimplemented to handle the special case of MathML, since it is
* a native format but not compressed.
*/
- virtual bool saveNativeFormat( const QString & file );
+ virtual bool saveNativeFormat( const TQString & file );
KFormula::Container* getFormula() const { return formula; }
KFormula::Document* getDocument() const { return document; }
@@ -86,8 +87,8 @@ protected slots:
protected:
- virtual QString configFile() const;
- virtual KoView* createViewInstance(QWidget* parent, const char* name);
+ virtual TQString configFile() const;
+ virtual KoView* createViewInstance(TQWidget* tqparent, const char* name);
private:
diff --git a/kformula/kformula_factory.cc b/kformula/kformula_factory.cc
index 021f10de..2f26fefc 100644
--- a/kformula/kformula_factory.cc
+++ b/kformula/kformula_factory.cc
@@ -10,7 +10,7 @@
#include <kstandarddirs.h>
#include <klocale.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
K_EXPORT_COMPONENT_FACTORY( libkformulapart, KFormulaFactory )
@@ -25,8 +25,8 @@ KAboutData* KFormulaFactory::aboutData()
}
-KFormulaFactory::KFormulaFactory( QObject* parent, const char* name )
- : KoFactory( parent, name )
+KFormulaFactory::KFormulaFactory( TQObject* tqparent, const char* name )
+ : KoFactory( tqparent, name )
{
// Create our instance, so that it becomes KGlobal::instance if the
// main app is KFormula.
@@ -41,11 +41,11 @@ KFormulaFactory::~KFormulaFactory()
s_global = 0L;
}
-KParts::Part* KFormulaFactory::createPartObject( QWidget *parentWidget, const char *widgetName, QObject* parent, const char* name, const char* classname, const QStringList & )
+KParts::Part* KFormulaFactory::createPartObject( TQWidget *tqparentWidget, const char *widgetName, TQObject* tqparent, const char* name, const char* classname, const TQStringList & )
{
bool bWantKoDocument = ( strcmp( classname, "KoDocument" ) == 0 );
- KFormulaDoc *doc = new KFormulaDoc( parentWidget, widgetName, parent, name, !bWantKoDocument );
+ KFormulaDoc *doc = new KFormulaDoc( tqparentWidget, widgetName, tqparent, name, !bWantKoDocument );
if ( !bWantKoDocument )
doc->setReadWrite( false );
diff --git a/kformula/kformula_factory.h b/kformula/kformula_factory.h
index dc9fe2f1..61f4fc99 100644
--- a/kformula/kformula_factory.h
+++ b/kformula/kformula_factory.h
@@ -11,11 +11,12 @@ class KAboutData;
class KFormulaFactory : public KoFactory
{
Q_OBJECT
+ TQ_OBJECT
public:
- KFormulaFactory( QObject* parent = 0, const char* name = 0 );
+ KFormulaFactory( TQObject* tqparent = 0, const char* name = 0 );
~KFormulaFactory();
- virtual KParts::Part *createPartObject( QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KoDocument", const QStringList &args = QStringList() );
+ virtual KParts::Part *createPartObject( TQWidget *tqparentWidget = 0, const char *widgetName = 0, TQObject *tqparent = 0, const char *name = 0, const char *classname = "KoDocument", const TQStringList &args = TQStringList() );
static KInstance* global();
diff --git a/kformula/kformula_view.cc b/kformula/kformula_view.cc
index f109de69..7dbabc00 100644
--- a/kformula/kformula_view.cc
+++ b/kformula/kformula_view.cc
@@ -20,10 +20,10 @@
class KPrinter;
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qtextedit.h>
-#include <qtimer.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
+#include <tqtextedit.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kdebug.h>
@@ -48,7 +48,7 @@ class KPrinter;
bool KFormulaPartView::first_window = true;
-KFormulaPartView::KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent, const char* _name)
+KFormulaPartView::KFormulaPartView(KFormulaDoc* _doc, TQWidget* _parent, const char* _name)
: KoView( _doc, _parent, _name ), m_pDoc(_doc)
{
setInstance(KFormulaFactory::global());
@@ -60,13 +60,13 @@ KFormulaPartView::KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent, const ch
m_dcop = 0;
dcopObject(); // build it
- scrollview = new QScrollView(this, "scrollview");
+ scrollview = new TQScrollView(this, "scrollview");
formulaWidget = new KFormulaWidget(_doc->getFormula(), scrollview->viewport(), "formulaWidget");
scrollview->addChild(formulaWidget);
scrollview->viewport()->setFocusProxy( scrollview );
- scrollview->viewport()->setFocusPolicy( WheelFocus );
- scrollview->setFocusPolicy( NoFocus );
+ scrollview->viewport()->setFocusPolicy( TQ_WheelFocus );
+ scrollview->setFocusPolicy( TQ_NoFocus );
formulaWidget->setFocus();
// Nice parts start in read only mode.
@@ -76,14 +76,14 @@ KFormulaPartView::KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent, const ch
KFormula::Document* document = m_pDoc->getDocument();
// copy&paste
- cutAction = KStdAction::cut(document->wrapper(), SLOT(cut()), actionCollection());
- copyAction = KStdAction::copy(document->wrapper(), SLOT(copy()), actionCollection());
- pasteAction = KStdAction::paste(document->wrapper(), SLOT(paste()), actionCollection());
+ cutAction = KStdAction::cut(document->wrapper(), TQT_SLOT(cut()), actionCollection());
+ copyAction = KStdAction::copy(document->wrapper(), TQT_SLOT(copy()), actionCollection());
+ pasteAction = KStdAction::paste(document->wrapper(), TQT_SLOT(paste()), actionCollection());
cutAction->setEnabled(false);
copyAction->setEnabled(false);
// tip of the day
- KStdAction::tipOfDay( this, SLOT( slotShowTip() ), actionCollection() );
+ KStdAction::tipOfDay( TQT_TQOBJECT(this), TQT_SLOT( slotShowTip() ), actionCollection() );
// elements
addBracketAction = document->wrapper()->getAddBracketAction();
@@ -101,55 +101,55 @@ KFormulaPartView::KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent, const ch
addGenericLowerAction = document->wrapper()->getAddGenericLowerAction();
removeEnclosingAction = document->wrapper()->getRemoveEnclosingAction();
- (void) KStdAction::selectAll(formulaWidget, SLOT(slotSelectAll()), actionCollection());
+ (void) KStdAction::selectAll(TQT_TQOBJECT(formulaWidget), TQT_SLOT(slotSelectAll()), actionCollection());
//------------------------ Settings menu
- KStdAction::preferences( this, SLOT(configure()), actionCollection(), "configure" );
+ KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(configure()), actionCollection(), "configure" );
// font stuff
// KFontAction* actionElement_Text_Font = new KFontAction(i18n( "Font Family" ),0,
// actionCollection(),"textfont");
-// connect( actionElement_Text_Font, SIGNAL( activated( const QString& ) ), this, SLOT( fontSelected( const QString& ) ) );
+// connect( actionElement_Text_Font, TQT_SIGNAL( activated( const TQString& ) ), TQT_TQOBJECT(this), TQT_SLOT( fontSelected( const TQString& ) ) );
KFontSizeAction* actionTextSize = new KFontSizeAction(i18n( "Size" ),0,
actionCollection(),"formula_textsize");
actionTextSize->setFontSize( m_pDoc->getFormula()->fontSize() );
- connect( actionTextSize, SIGNAL( fontSizeChanged( int ) ), this, SLOT( sizeSelected( int ) ) );
- connect( formula, SIGNAL( baseSizeChanged( int ) ), actionTextSize, SLOT( setFontSize( int ) ) );
+ connect( actionTextSize, TQT_SIGNAL( fontSizeChanged( int ) ), TQT_TQOBJECT(this), TQT_SLOT( sizeSelected( int ) ) );
+ connect( formula, TQT_SIGNAL( baseSizeChanged( int ) ), actionTextSize, TQT_SLOT( setFontSize( int ) ) );
// KToggleAction* actionElement_Text_Bold = new KToggleAction(i18n( "Bold" ),
// "bold",
// 0,
// actionCollection(),"textbold");
-// connect( actionElement_Text_Bold, SIGNAL( toggled( bool ) ), this, SLOT( bold( bool ) ) );
+// connect( actionElement_Text_Bold, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( bold( bool ) ) );
// KToggleAction* actionElement_Text_Italic = new KToggleAction(i18n( "Italic" ),
// "italic",
// 0,
// actionCollection(),"textitalic");
-// connect( actionElement_Text_Italic, SIGNAL( toggled( bool ) ), this, SLOT( italic( bool ) ) );
+// connect( actionElement_Text_Italic, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( italic( bool ) ) );
// KToggleAction* actionElement_Text_Under = new KToggleAction(i18n( "Underlined" ),
// "underl",
// 0,
// actionCollection(),"textunder");
-// connect(actionElement_Text_Under, SIGNAL( toggled( bool ) ), this, SLOT( underline( bool ) ) );
+// connect(actionElement_Text_Under, TQT_SIGNAL( toggled( bool ) ), TQT_TQOBJECT(this), TQT_SLOT( underline( bool ) ) );
formulaStringAction = new KAction( i18n( "Edit Formula String..." ),
0,
- this, SLOT( formulaString() ),
+ TQT_TQOBJECT(this), TQT_SLOT( formulaString() ),
actionCollection(), "formula_formulastring" );
// notify on cursor change
- connect(formulaWidget, SIGNAL(cursorChanged(bool, bool)),
- this, SLOT(cursorChanged(bool, bool)));
+ connect(formulaWidget, TQT_SIGNAL(cursorChanged(bool, bool)),
+ TQT_TQOBJECT(this), TQT_SLOT(cursorChanged(bool, bool)));
- connect( formula, SIGNAL( statusMsg( const QString& ) ),
- this, SLOT( slotActionStatusText( const QString& ) ) );
+ connect( formula, TQT_SIGNAL( statusMsg( const TQString& ) ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotActionStatusText( const TQString& ) ) );
if ( !_doc->isEmbedded() && first_window ) {
- QTimer::singleShot( 200, this, SLOT(slotShowTipOnStart()) );
+ TQTimer::singleShot( 200, TQT_TQOBJECT(this), TQT_SLOT(slotShowTipOnStart()) );
first_window = false;
}
}
@@ -169,7 +169,7 @@ DCOPObject* KFormulaPartView::dcopObject()
}
-void KFormulaPartView::focusInEvent(QFocusEvent*)
+void KFormulaPartView::focusInEvent(TQFocusEvent*)
{
formulaWidget->setFocus();
}
@@ -185,7 +185,7 @@ void KFormulaPartView::slotShowTipOnStart() {
}
void KFormulaPartView::slotShowTip() {
- KTipDialog::showTip( this, QString::null, true );
+ KTipDialog::showTip( this, TQString(), true );
}
@@ -206,7 +206,7 @@ void KFormulaPartView::setEnabled(bool enabled)
removeEnclosingAction->setEnabled(enabled);
}
-void KFormulaPartView::resizeEvent( QResizeEvent * )
+void KFormulaPartView::resizeEvent( TQResizeEvent * )
{
scrollview->setGeometry(0, 0, width(), height());
}
@@ -263,11 +263,11 @@ void KFormulaPartView::sizeSelected( int size )
formulaWidget->setFocus();
}
-QStringList KFormulaPartView::readFormulaString( QString text )
+TQStringList KFormulaPartView::readFormulaString( TQString text )
{
FormulaStringParser parser( document()->getDocument()->getSymbolTable(), text );
- QDomDocument formula = parser.parse();
- QStringList errorList = parser.errorList();
+ TQDomDocument formula = parser.parse();
+ TQStringList errorList = parser.errorList();
//if ( errorList.count() == 0 ) {
formulaView()->slotSelectAll();
document()->getFormula()->paste( formula, i18n( "Read Formula String" ) );
diff --git a/kformula/kformula_view.h b/kformula/kformula_view.h
index 4bb70bf3..0c1f37bc 100644
--- a/kformula/kformula_view.h
+++ b/kformula/kformula_view.h
@@ -26,8 +26,8 @@ class KFormulaDoc;
class KFormulaPartView;
class KFormulaWidget;
class KSelectAction;
-class QPaintEvent;
-class QScrollView;
+class TQPaintEvent;
+class TQScrollView;
class DCOPObject;
namespace KFormula {
@@ -35,8 +35,8 @@ namespace KFormula {
}
#include <KoView.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
/**
* The parts view.
@@ -44,9 +44,10 @@ namespace KFormula {
class KFormulaPartView : public KoView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KFormulaPartView(KFormulaDoc* _doc, QWidget* _parent=0, const char* _name=0);
+ KFormulaPartView(KFormulaDoc* _doc, TQWidget* _parent=0, const char* _name=0);
virtual ~KFormulaPartView();
virtual DCOPObject* dcopObject();
@@ -58,12 +59,12 @@ public:
const KFormula::View* formulaView() const;
KFormula::View* formulaView();
- QStringList readFormulaString( QString text );
+ TQStringList readFormulaString( TQString text );
protected:
- virtual void resizeEvent(QResizeEvent* _ev);
- virtual void focusInEvent(QFocusEvent*);
+ virtual void resizeEvent(TQResizeEvent* _ev);
+ virtual void focusInEvent(TQFocusEvent*);
virtual void updateReadWrite(bool);
@@ -88,7 +89,7 @@ private:
KFormulaDoc *m_pDoc;
KFormulaWidget* formulaWidget;
- QScrollView* scrollview;
+ TQScrollView* scrollview;
KAction* cutAction;
KAction* copyAction;
diff --git a/kformula/kformula_view_iface.cc b/kformula/kformula_view_iface.cc
index 4ad217f6..c3b85908 100644
--- a/kformula/kformula_view_iface.cc
+++ b/kformula/kformula_view_iface.cc
@@ -163,7 +163,7 @@ void KformulaViewIface::makeGreek()
m_view->document()->getDocument()->wrapper()->makeGreek();
}
-void KformulaViewIface::insertSymbol( QString name )
+void KformulaViewIface::insertSymbol( TQString name )
{
m_view->document()->getDocument()->wrapper()->insertSymbol( name );
}
@@ -243,12 +243,12 @@ void KformulaViewIface::eraseSelection( int direction )
m_view->formulaView()->eraseSelection( static_cast<KFormula::Direction>( direction ) );
}
-void KformulaViewIface::addText( QString str )
+void KformulaViewIface::addText( TQString str )
{
m_view->formulaView()->addText( str );
}
-QStringList KformulaViewIface::readFormulaString( QString text )
+TQStringList KformulaViewIface::readFormulaString( TQString text )
{
return m_view->readFormulaString( text );
}
diff --git a/kformula/kformula_view_iface.h b/kformula/kformula_view_iface.h
index 04f50af4..e8ab0ae9 100644
--- a/kformula/kformula_view_iface.h
+++ b/kformula/kformula_view_iface.h
@@ -22,8 +22,8 @@
#include <KoViewIface.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
class KFormulaPartView;
@@ -60,7 +60,7 @@ k_dcop:
void addGenericUpperIndex();
void removeEnclosing();
void makeGreek();
- void insertSymbol( QString name );
+ void insertSymbol( TQString name );
void appendColumn();
void insertColumn();
@@ -84,9 +84,9 @@ k_dcop:
bool isEnd() const;
void eraseSelection( int direction );
- void addText( QString str );
+ void addText( TQString str );
- QStringList readFormulaString( QString text );
+ TQStringList readFormulaString( TQString text );
private:
KFormulaPartView *m_view;
diff --git a/kformula/kformulawidget.cc b/kformula/kformulawidget.cc
index 862814e0..b6a9145b 100644
--- a/kformula/kformulawidget.cc
+++ b/kformula/kformulawidget.cc
@@ -20,7 +20,7 @@
#include <iostream>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -34,19 +34,19 @@
KFormulaWidget::KFormulaWidget(KFormula::Container* doc,
- QWidget* parent, const char* name, WFlags f)
- : QWidget(parent, name, f | WRepaintNoErase | WResizeNoErase),
+ TQWidget* tqparent, const char* name, WFlags f)
+ : TQWidget(tqparent, name, f | WRepaintNoErase | WResizeNoErase),
formulaView(doc)
{
- connect(doc, SIGNAL(formulaChanged(int, int)),
- this, SLOT(slotFormulaChanged(int, int)));
- connect(&formulaView, SIGNAL(cursorChanged(bool, bool)),
- this, SLOT(slotCursorChanged(bool, bool)));
+ connect(doc, TQT_SIGNAL(formulaChanged(int, int)),
+ this, TQT_SLOT(slotFormulaChanged(int, int)));
+ connect(&formulaView, TQT_SIGNAL(cursorChanged(bool, bool)),
+ this, TQT_SLOT(slotCursorChanged(bool, bool)));
- setFocusPolicy(QWidget::StrongFocus);
- setBackgroundMode(NoBackground/*QWidget::PaletteBase*/);
+ setFocusPolicy(TQ_StrongFocus);
+ setBackgroundMode(NoBackground/*TQWidget::PaletteBase*/);
- QRect rect = doc->boundingRect();
+ TQRect rect = doc->boundingRect();
slotFormulaChanged(rect.width(), rect.height());
}
@@ -55,7 +55,7 @@ KFormulaWidget::~KFormulaWidget()
}
-QPoint KFormulaWidget::getCursorPoint() const
+TQPoint KFormulaWidget::getCursorPoint() const
{
return formulaView.getCursorPoint();
}
@@ -66,53 +66,53 @@ void KFormulaWidget::setReadOnly(bool ro)
}
-void KFormulaWidget::paintEvent(QPaintEvent* event)
+void KFormulaWidget::paintEvent(TQPaintEvent* event)
{
- // Always repaint the buffer. This is not so much more work
- // than it seems to be as each cursor movement requires a repaint.
- QPainter p( &buffer );
+ // Always tqrepaint the buffer. This is not so much more work
+ // than it seems to be as each cursor movement requires a tqrepaint.
+ TQPainter p( &buffer );
//p.translate( -fr.x(), -fr.y() );
- formulaView.draw( p, event->rect(), colorGroup() );
+ formulaView.draw( p, event->rect(), tqcolorGroup() );
- QPainter painter;
+ TQPainter painter;
painter.begin(this);
painter.drawPixmap( event->rect().x(), event->rect().y(),
buffer, event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height() );
painter.end();
}
-void KFormulaWidget::keyPressEvent(QKeyEvent* event)
+void KFormulaWidget::keyPressEvent(TQKeyEvent* event)
{
formulaView.keyPressEvent(event);
}
-void KFormulaWidget::focusInEvent(QFocusEvent* event)
+void KFormulaWidget::focusInEvent(TQFocusEvent* event)
{
formulaView.focusInEvent(event);
}
-void KFormulaWidget::focusOutEvent(QFocusEvent* event)
+void KFormulaWidget::focusOutEvent(TQFocusEvent* event)
{
formulaView.focusOutEvent(event);
}
-void KFormulaWidget::mousePressEvent(QMouseEvent* event)
+void KFormulaWidget::mousePressEvent(TQMouseEvent* event)
{
formulaView.mousePressEvent(event);
}
-void KFormulaWidget::mouseReleaseEvent(QMouseEvent* event)
+void KFormulaWidget::mouseReleaseEvent(TQMouseEvent* event)
{
formulaView.mouseReleaseEvent(event);
}
-void KFormulaWidget::mouseDoubleClickEvent(QMouseEvent* event)
+void KFormulaWidget::mouseDoubleClickEvent(TQMouseEvent* event)
{
formulaView.mouseDoubleClickEvent(event);
}
-void KFormulaWidget::mouseMoveEvent(QMouseEvent* event)
+void KFormulaWidget::mouseMoveEvent(TQMouseEvent* event)
{
formulaView.mouseMoveEvent(event);
}
diff --git a/kformula/kformulawidget.h b/kformula/kformulawidget.h
index c266de4d..f49757b7 100644
--- a/kformula/kformulawidget.h
+++ b/kformula/kformulawidget.h
@@ -21,10 +21,10 @@
#ifndef KFORMULAWIDGET_H
#define KFORMULAWIDGET_H
-#include <qdom.h>
-#include <qpixmap.h>
-#include <qpoint.h>
-#include <qwidget.h>
+#include <tqdom.h>
+#include <tqpixmap.h>
+#include <tqpoint.h>
+#include <tqwidget.h>
#include <kformuladefs.h>
#include <kformulaview.h>
@@ -41,18 +41,19 @@ KFORMULA_NAMESPACE_END
* The view. A widget that shows the formula. There are methods
* to move the cursor around. To edit the formula use the document.
*/
-class KFormulaWidget : public QWidget {
+class KFormulaWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- KFormulaWidget(KFormula::Container*, QWidget* parent=0, const char* name=0, WFlags f=0);
+ KFormulaWidget(KFormula::Container*, TQWidget* tqparent=0, const char* name=0, WFlags f=0);
~KFormulaWidget();
/**
* @returns the point inside the formula widget where the cursor is.
*/
- QPoint getCursorPoint() const;
+ TQPoint getCursorPoint() const;
/**
* Puts the widget in read only mode.
@@ -84,15 +85,15 @@ protected slots:
protected:
- virtual void mousePressEvent(QMouseEvent* event);
- virtual void mouseReleaseEvent(QMouseEvent* event);
- virtual void mouseDoubleClickEvent(QMouseEvent* event);
- virtual void mouseMoveEvent(QMouseEvent* event);
+ virtual void mousePressEvent(TQMouseEvent* event);
+ virtual void mouseReleaseEvent(TQMouseEvent* event);
+ virtual void mouseDoubleClickEvent(TQMouseEvent* event);
+ virtual void mouseMoveEvent(TQMouseEvent* event);
- virtual void paintEvent(QPaintEvent* event);
- virtual void keyPressEvent(QKeyEvent* event);
- virtual void focusInEvent(QFocusEvent* event);
- virtual void focusOutEvent(QFocusEvent* event);
+ virtual void paintEvent(TQPaintEvent* event);
+ virtual void keyPressEvent(TQKeyEvent* event);
+ virtual void focusInEvent(TQFocusEvent* event);
+ virtual void focusOutEvent(TQFocusEvent* event);
/**
* The document we show.
@@ -111,7 +112,7 @@ private:
*/
KFormula::View formulaView;
- QPixmap buffer;
+ TQPixmap buffer;
};
#endif // KFORMULAWIDGET_H