Commit e60300ab authored by Martin Pfeiffer's avatar Martin Pfeiffer

--deprecated

svn path=/trunk/koffice/; revision=543020
parent dc49e7b6
......@@ -23,8 +23,7 @@
#include <QLabel>
#include <QCheckBox>
#include <QLayout>
//Added by qt3to4:
#include <Q3GridLayout>
#include <QGridLayout>
#include <klocale.h>
KFORMULA_NAMESPACE_BEGIN
......@@ -41,7 +40,7 @@ MatrixDialog::MatrixDialog( QWidget *parent, int _width, int _height )
QLabel *rows, *columns;
QWidget *page = new QWidget( this );
setMainWidget(page);
Q3GridLayout *grid = new Q3GridLayout(page, 4, 2, 10);
QGridLayout *grid = new QGridLayout(page);
rows = new QLabel(i18n("Rows:"), page);
columns = new QLabel(i18n("Columns:"), page);
......@@ -51,12 +50,16 @@ MatrixDialog::MatrixDialog( QWidget *parent, int _width, int _height )
QSpinBox *width, *height;
height = new QSpinBox(1, MAX_SIZE, 1, page);
height = new QSpinBox(page);
height->setRange( 1, MAX_SIZE );
height->setSingleStep( 1 );
grid->addWidget(height, 1, 0);
height->setValue(h);
connect(height, SIGNAL(valueChanged(int)), SLOT(setHeight(int)));
width = new QSpinBox(1, MAX_SIZE, 1, page);
width = new QSpinBox(page);
width->setRange ( 1, MAX_SIZE );
width->setSingleStep(1);
grid->addWidget(width, 1, 1);
width->setValue(w);
connect(width, SIGNAL(valueChanged(int)), SLOT(setWidth(int)));
......
......@@ -183,7 +183,7 @@ void BasicElement::writeMathML( QDomDocument& doc, QDomNode parent, bool /*oasis
bool BasicElement::buildFromDom(QDomElement element)
{
if (element.tagName() != getTagName()) {
kWarning( DEBUGID ) << "Wrong tag name " << element.tagName().latin1() << " for " << getTagName().latin1() << ".\n";
kWarning( DEBUGID ) << "Wrong tag name " << element.tagName().toLatin1() << " for " << getTagName().toLatin1() << ".\n";
return false;
}
if (!readAttributesFromDom(element)) {
......
......@@ -109,7 +109,7 @@ void CMStyle::installFonts()
urlList.append(KUrl::fromPath(locate("data", "kformula/fonts/" + *it + ".ttf")));
}
KIO::copy(urlList, KUrl("fonts:/Personal/"), false);
KMessageBox::information(qApp->mainWidget(),
KMessageBox::information(qApp->activeWindow(),
i18n("Some fonts have been installed to assure that symbols in formulas are properly visualized. You must restart the application in order so that changes take effect"));
}
m_installed = true;
......@@ -537,7 +537,7 @@ bool CMArtwork::calcCMDelimiterSize( const ContextStyle& context,
luPt parentSize )
{
QFont f( "cmex10" );
f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) );
f.setPointSizeF( context.layoutUnitPtToPt( fontSize ) );
QFontMetrics fm( f );
for ( char i=1; c != 0; ++i ) {
......@@ -568,7 +568,7 @@ void CMArtwork::calcLargest( const ContextStyle& context,
uchar c, luPt fontSize )
{
QFont f( "cmex10" );
f.setPointSizeFloat( context.layoutUnitPtToPt( fontSize ) );
f.setPointSizeF( context.layoutUnitPtToPt( fontSize ) );
QFontMetrics fm( f );
cmChar = c;
......@@ -597,7 +597,7 @@ void CMArtwork::drawCMDelimiter( QPainter& painter, const ContextStyle& style,
luPt height )
{
QFont f( "cmex10" );
f.setPointSizeFloat( style.layoutUnitToFontSize( height, false ) );
f.setPointSizeF( style.layoutUnitToFontSize( height, false ) );
painter.setFont( f );
painter.drawText( style.layoutUnitToPixelX( x ),
......
......@@ -386,7 +386,7 @@ void AbstractOperatorType::saveMathML( SequenceElement* se, QDomDocument& doc, Q
{
QDomElement op = doc.createElement( oasisFormat ? "math:mo" : "mo" );
BasicElement* be = se->getChild( start() );
if ( be->getCharacter().latin1() != 0 ) {
if ( be->getCharacter().toLatin1() != 0 ) {
// latin-1 char
op.appendChild( doc.createTextNode( be->getCharacter() ) );
}
......
......@@ -436,7 +436,7 @@ bool EsstixArtwork::calcEsstixDelimiterSize( const ContextStyle& context,
for ( char i=1; c != 0; ++i ) {
//f.setPointSizeFloat( context.layoutUnitToFontSize( i*fontSize, false ) );
f.setPointSizeFloat( context.layoutUnitPtToPt( i*fontSize ) );
f.setPointSizeF( context.layoutUnitPtToPt( i*fontSize ) );
QFontMetrics fm( f );
LuPixelRect bound = fm.boundingRect( c );
......@@ -467,7 +467,7 @@ void EsstixArtwork::drawEsstixDelimiter( QPainter& painter, const ContextStyle&
luPt height )
{
QFont f( "esstixseven" );
f.setPointSizeFloat( style.layoutUnitToFontSize( fontSizeFactor*height, false ) );
f.setPointSizeF( style.layoutUnitToFontSize( fontSizeFactor*height, false ) );
painter.setFont( f );
painter.drawText( style.layoutUnitToPixelX( x ),
......
......@@ -299,7 +299,7 @@ void Artwork::drawBigRoundBracket( QPainter& p, const ContextStyle& style, const
QChar line = style.symbolTable().character( chars[2] );
QFont f = style.symbolTable().font( chars[0] );
f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) );
f.setPointSizeF( style.layoutUnitToFontSize( charHeight, false ) );
p.setFont(f);
QFontMetrics fm(f);
......@@ -348,7 +348,7 @@ void Artwork::calcCurlyBracket( const ContextStyle& style, const QChar chars[],
QChar middle = style.symbolTable().character( chars[3] );
QFont f = style.symbolTable().font( chars[0] );
f.setPointSizeFloat( style.layoutUnitPtToPt( charHeight ) );
f.setPointSizeF( style.layoutUnitPtToPt( charHeight ) );
QFontMetrics fm( f );
LuPtRect upperBound = fm.boundingRect( uppercorner );
LuPtRect lowerBound = fm.boundingRect( lowercorner );
......@@ -370,7 +370,7 @@ void Artwork::drawBigCurlyBracket( QPainter& p, const ContextStyle& style, const
{
//QFont f = style.getSymbolFont();
QFont f = style.symbolTable().font( chars[0] );
f.setPointSizeFloat( style.layoutUnitToFontSize( charHeight, false ) );
f.setPointSizeF( style.layoutUnitToFontSize( charHeight, false ) );
p.setFont(f);
QChar uppercorner = style.symbolTable().character( chars[0] );
......
......@@ -60,8 +60,8 @@
KFORMULA_NAMESPACE_BEGIN
ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config, KVBox* box, char* name )
: QObject( box->parent(), name ), m_document( document ), m_view( view ), m_config( config ), m_changed( false )
ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config, KVBox* box, char* /*name*/ )
: QObject( box->parent() ), m_document( document ), m_view( view ), m_config( config ), m_changed( false )
{
const ContextStyle& contextStyle = document->getContextStyle( true );
......@@ -178,13 +178,13 @@ ConfigurePage::ConfigurePage( Document* document, QWidget* view, KConfig* config
grid = new Q3GridLayout( styleBox->layout(), 3, 1 );
grid->setSpacing( KDialog::spacingHint() );
esstixStyle = new QRadioButton( i18n( "Esstix font style" ), styleBox, "esstixStyle" );
esstixStyle = new QRadioButton( i18n( "Esstix font style" ), styleBox );
esstixStyle->setChecked( contextStyle.getFontStyle() == "esstix" );
cmStyle = new QRadioButton( i18n( "Computer modern (TeX) style" ), styleBox, "cmStyle" );
cmStyle = new QRadioButton( i18n( "Computer modern (TeX) style" ), styleBox );
cmStyle->setChecked( contextStyle.getFontStyle() == "tex" );
symbolStyle = new QRadioButton( i18n( "Symbol font style" ), styleBox, "symbolStyle" );
symbolStyle = new QRadioButton( i18n( "Symbol font style" ), styleBox );
symbolStyle->setChecked( !esstixStyle->isChecked() && !cmStyle->isChecked() );
grid->addWidget( symbolStyle, 0, 0 );
......
......@@ -20,9 +20,8 @@
#include <q3ptrlist.h>
#include <QStringList>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3MemArray>
#include <QList>
#include <QVector>
#include <kdebug.h>
#include <kglobal.h>
......@@ -1113,8 +1112,8 @@ void DocumentWrapper::initSymbolNamesAction()
QStringList names = st.allNames();
//QStringList i18nNames;
Q3ValueList<QFont> fonts;
Q3MemArray<QChar> chars( names.count() );
QList<QFont> fonts;
QVector<QChar> chars( names.count() );
int i = 0;
for ( QStringList::Iterator it = names.begin();
......
......@@ -676,9 +676,9 @@ void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode )
{
QDomElement bracket = doc.createElement( "BRACKET" );
QString value = element.attribute( "open", "(" );
bracket.setAttribute( "LEFT", QString::number( value.at( 0 ).latin1() ) );
bracket.setAttribute( "LEFT", QString::number( value.at( 0 ).toLatin1() ) );
value = element.attribute( "close", ")" );
bracket.setAttribute( "RIGHT", QString::number( value.at( 0 ).latin1() ) );
bracket.setAttribute( "RIGHT", QString::number( value.at( 0 ).toLatin1() ) );
QDomElement content = doc.createElement( "CONTENT" );
QDomElement sequence = doc.createElement( "SEQUENCE" );
......@@ -687,7 +687,7 @@ void MathML2KFormulaPrivate::mfenced( QDomElement element, QDomNode docnode )
QString separators = element.attribute( "separators", "," );
QDomNode n = element.firstChild();
uint i = 0;
int i = 0;
while ( !n.isNull() ) {
if ( n.isElement() ) {
if ( i != 0 && !separators.isEmpty() ) {
......@@ -1188,7 +1188,7 @@ void MathML2KFormulaPrivate::msubsup( QDomElement element, QDomNode docnode )
void MathML2KFormulaPrivate::createTextElements( QString text, QDomNode docnode )
{
for ( uint i = 0; i < text.length(); ++i ) {
for ( int i = 0; i < text.length(); ++i ) {
QDomElement textelement = doc.createElement( "TEXT" );
textelement.setAttribute( "CHAR", QString( text.at( i ) ) );
style.setStyles( textelement );
......@@ -1714,11 +1714,11 @@ bool MathML2KFormula::processElement( QDomNode node, QDomDocument& doc, QDomNode
}
else if ( n.isEntityReference() ) {
kDebug( DEBUGID ) << "isEntityReference: "
<< n.toEntityReference().nodeName().latin1()
<< n.toEntityReference().nodeName().toLatin1()
<< endl;
}
else
kDebug( DEBUGID ) << "ci: " << n.nodeName().latin1() << endl;
kDebug( DEBUGID ) << "ci: " << n.nodeName().toLatin1() << endl;
}
else if ( tag == "list" ) {
......
......@@ -54,7 +54,7 @@ MimeSource::MimeSource(Document* doc, const QDomDocument& formula)
list.setAutoDelete(true);
if ( cursor.buildElementsFromDom( document.documentElement(), list ) ) {
cursor.insert(list);
latexString = rootElement->toLatex().utf8();
latexString = rootElement->toLatex().toUtf8();
if (latexString.size() > 0) {
latexString.truncate(latexString.size()-1);
}
......@@ -135,7 +135,7 @@ QByteArray MimeSource::encodedData ( const char *format ) const
QBuffer buff(&d);
buff.open(QIODevice::WriteOnly);
QImageWriter io(&buff,"PPM");
QImage ima=pm.convertToImage();
QImage ima=pm.toImage();
ima.detach();
//io.write(ima);
if(!io.write(ima))
......
......@@ -1173,7 +1173,7 @@ KCommand* MultilineSequenceElement::input( Container* container, QKeyEvent* even
KCommand* MultilineSequenceElement::input( Container* container, QChar ch )
{
int latin1 = ch.latin1();
int latin1 = ch.toLatin1();
switch (latin1) {
case '&': {
Request r( req_addTabMark );
......@@ -1515,7 +1515,7 @@ void MultilineElement::calcSizes( const ContextStyle& context,
{
luPt mySize = context.getAdjustedSize( tstyle );
QFont font = context.getDefaultFont();
font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
font.setPointSizeF( context.layoutUnitPtToPt( mySize ) );
QFontMetrics fm( font );
luPixel leading = context.ptToLayoutUnitPt( fm.leading() );
luPixel distY = context.ptToPixelY( context.getThinSpace( tstyle ) );
......
......@@ -566,13 +566,13 @@ bool RootElement::readContentFromDom(QDomNode& node)
}
node = node.nextSibling();
if ( node.nodeName().upper() == "ROOTINDEX" ) {
if ( node.nodeName().toUpper() == "ROOTINDEX" ) {
if ( !buildChild( index=new SequenceElement( this ), node, "ROOTINDEX" ) ) {
return false;
}
}
// backward compatibility
else if ( node.nodeName().upper() == "INDEX" ) {
else if ( node.nodeName().toUpper() == "INDEX" ) {
if ( !buildChild( index=new SequenceElement( this ), node, "INDEX" ) ) {
return false;
}
......
......@@ -20,9 +20,6 @@
#include <q3listbox.h>
#include <QPainter>
#include <Q3ComboBox>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3MemArray>
#include <kapplication.h>
#include <kcombobox.h>
......@@ -120,10 +117,10 @@ SymbolAction::SymbolAction( const QString& text, const KShortcut& cut,
setEditable( FALSE );
}
int SymbolAction::plug( QWidget* w, int index )
void SymbolAction::plug( QWidget* w, int /*index*/ )
{
if (!KAuthorized::authorizeKAction(name()))
return -1;
if (!KAuthorized::authorizeKAction(objectName()))
return;
if ( w->inherits( "KToolBar" ) )
{
#warning "kde4: port it"
......@@ -145,19 +142,21 @@ int SymbolAction::plug( QWidget* w, int index )
return containerCount() - 1;
#endif
return 0;
return;
}
else return KSelectAction::plug( w, index );
else
w->addAction( this ); // possibly insertAction is needed
}
void SymbolAction::setSymbols( const QStringList &names, const Q3ValueList<QFont>& fonts,
const Q3MemArray<QChar>& chars )
void SymbolAction::setSymbols( const QStringList &names, const QList<QFont>& fonts,
const QVector<QChar>& chars )
{
m_fonts = fonts;
m_chars = chars;
setItems( names );
int len = containerCount();
int len = associatedWidgets().count();
for ( int i = 0; i < len; ++i )
updateItems( i );
}
......
......@@ -20,9 +20,9 @@
#ifndef _SYMBOLACTION_H_
#define _SYMBOLACTION_H_
#include <q3valuelist.h>
#include <QList>
#include <QStringList>
#include <q3memarray.h>
#include <QVector>
#include "kformuladefs.h"
#include <kselectaction.h>
......@@ -37,13 +37,13 @@ public:
const QObject* receiver, const char* slot, KActionCollection* parent,
const char* name = 0 );
int plug( QWidget*, int index = -1 );
void setSymbols( const QStringList&, const Q3ValueList<QFont>&, const Q3MemArray<QChar>& );
void plug( QWidget*, int index = -1 );
void setSymbols( const QStringList&, const QList<QFont>&, const QVector<QChar>& );
void updateItems( int );
private:
Q3ValueList<QFont> m_fonts;
Q3MemArray<QChar> m_chars;
QList<QFont> m_fonts;
QVector<QChar> m_chars;
};
KFORMULA_NAMESPACE_END
......
......@@ -766,12 +766,12 @@ bool SymbolElement::readContentFromDom(QDomNode& node)
while (!node.isNull() && !(upperRead && lowerRead)) {
if (!lowerRead && (node.nodeName().upper() == "LOWER")) {
if (!lowerRead && (node.nodeName().toUpper() == "LOWER")) {
lowerRead = buildChild( lower=new SequenceElement( this ), node, "LOWER" );
if ( !lowerRead ) return false;
}
if (!upperRead && (node.nodeName().upper() == "UPPER")) {
if (!upperRead && (node.nodeName().toUpper() == "UPPER")) {
upperRead = buildChild( upper=new SequenceElement( this ), node, "UPPER" );
if ( !upperRead ) return false;
}
......
......@@ -49,7 +49,7 @@ SymbolFontHelper::SymbolFontHelper()
QChar SymbolFontHelper::unicodeFromSymbolFont( QChar pos ) const
{
if ( compatibility.contains( pos ) ) {
return compatibility[ pos.latin1() ];
return compatibility[ pos.toLatin1() ];
}
return QChar::Null;
}
......@@ -177,7 +177,7 @@ QStringList SymbolTable::allNames() const
for ( EntryTable::const_iterator iter = entries.begin();
iter != entries.end();
++iter ) {
if ( QChar( character( iter.data() ) ) != QChar::Null ) {
if ( QChar( character( iter.value() ) ) != QChar::Null ) {
list.append( iter.key() );
}
}
......
......@@ -114,7 +114,7 @@ void TextElement::calcSizes(const ContextStyle& context, ContextStyle::TextStyle
//kDebug( DEBUGID ) << "TextElement::calcSizes size=" << mySize << endl;
QFont font = getFont( context );
font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
font.setPointSizeF( context.layoutUnitPtToPt( mySize ) );
QFontMetrics fm( font );
QChar ch = getRealCharacter(context);
......@@ -160,7 +160,7 @@ void TextElement::draw( QPainter& painter, const LuPixelRect& /*r*/,
luPt mySize = context.getAdjustedSize( tstyle );
QFont font = getFont( context );
font.setPointSizeFloat( context.layoutUnitToFontSize( mySize, false ) );
font.setPointSizeF( context.layoutUnitToFontSize( mySize, false ) );
painter.setFont( font );
//kDebug( DEBUGID ) << "TextElement::draw font=" << font.rawName() << endl;
......@@ -494,7 +494,7 @@ void EmptyElement::calcSizes( const ContextStyle& context,
//kDebug( DEBUGID ) << "TextElement::calcSizes size=" << mySize << endl;
QFont font = context.getDefaultFont();
font.setPointSizeFloat( context.layoutUnitPtToPt( mySize ) );
font.setPointSizeF( context.layoutUnitPtToPt( mySize ) );
QFontMetrics fm( font );
QChar ch = 'A';
......
......@@ -39,7 +39,7 @@
#include <kpushbutton.h>
#include <kjanuswidget.h>
#include <kglobalsettings.h>
#include <ktextedit.h>
#include <kfileiconview.h>
#include <kfileitem.h>
#include <kmessagebox.h>
......@@ -55,7 +55,7 @@
#include <QObject>
#include <QDesktopWidget>
#include <QToolTip>
//Added by qt3to4:
#include <QTextEdit>
#include <QByteArray>
#include <QHideEvent>
#include <QGridLayout>
......@@ -167,7 +167,7 @@ class KoTemplateChooseDiaPrivate {
KJanusWidget * m_jwidget;
KFileIconView *m_recent;
QGroupBox * boxdescription;
KTextEdit * textedit;
QTextEdit * textedit;
// choose a file
MyFileDialog *m_filedialog;
......@@ -454,7 +454,7 @@ void KoTemplateChooseDia::setupTemplateDialog(QWidget * widgetbase, QGridLayout
//d->boxdescription->setInsideMargin ( 3 );
//d->boxdescription->setInsideSpacing ( 3 );
d->textedit = new KTextEdit( d->boxdescription );
d->textedit = new QTextEdit( d->boxdescription );
d->textedit->setReadOnly(1);
d->textedit->setPlainText(descriptionText(i18n("Empty Document"), i18n("Creates an empty document")));
d->textedit->setLineWidth(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment