summaryrefslogtreecommitdiffstats
path: root/kpresenter/autoformEdit
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 /kpresenter/autoformEdit
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 'kpresenter/autoformEdit')
-rw-r--r--kpresenter/autoformEdit/AFChoose.cpp80
-rw-r--r--kpresenter/autoformEdit/AFChoose.h35
-rw-r--r--kpresenter/autoformEdit/ATFInterpreter.cpp80
-rw-r--r--kpresenter/autoformEdit/ATFInterpreter.h52
4 files changed, 124 insertions, 123 deletions
diff --git a/kpresenter/autoformEdit/AFChoose.cpp b/kpresenter/autoformEdit/AFChoose.cpp
index d5f00758..64268e28 100644
--- a/kpresenter/autoformEdit/AFChoose.cpp
+++ b/kpresenter/autoformEdit/AFChoose.cpp
@@ -20,11 +20,11 @@
#include "AFChoose.h"
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qtextstream.h>
-#include <qdir.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqtextstream.h>
+#include <tqdir.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
#include <ksimpleconfig.h>
@@ -34,8 +34,8 @@
#include <KPrFactory.h>
-AFChoose::AFChoose(QWidget *parent, const QString &caption, const char *name)
- : QTabDialog(parent,name,true)
+AFChoose::AFChoose(TQWidget *tqparent, const TQString &caption, const char *name)
+ : TQTabDialog(tqparent,name,true)
{
setCaption(caption);
setCancelButton(i18n("&Cancel"));
@@ -43,8 +43,8 @@ AFChoose::AFChoose(QWidget *parent, const QString &caption, const char *name)
groupList.setAutoDelete(true);
getGroups();
setupTabs();
- connect(this,SIGNAL(applyButtonPressed()),this,SLOT(chosen()));
- connect(this,SIGNAL(cancelButtonPressed()),this,SLOT(cancelClicked()));
+ connect(this,TQT_SIGNAL(applyButtonPressed()),this,TQT_SLOT(chosen()));
+ connect(this,TQT_SIGNAL(cancelButtonPressed()),this,TQT_SLOT(cancelClicked()));
}
AFChoose::~AFChoose()
@@ -54,19 +54,19 @@ AFChoose::~AFChoose()
void AFChoose::getGroups()
{
// global autoforms (as we don't have an editor we don't have local ones)
- QString afDir = locate( "autoforms", ".autoforms", KPrFactory::global() );
+ TQString afDir = locate( "autoforms", ".autoforms", KPrFactory::global() );
- QFile f( afDir );
+ TQFile f( afDir );
if ( f.open(IO_ReadOnly) ) {
- QTextStream t( &f );
- QString s;
+ TQTextStream t( &f );
+ TQString s;
while ( !t.eof() ) {
s = t.readLine();
if ( !s.isEmpty() ) {
grpPtr = new Group;
- QString directory=QFileInfo( afDir ).dirPath() + "/" + s.simplifyWhiteSpace();
+ TQString directory=TQFileInfo( afDir ).dirPath() + "/" + s.simplifyWhiteSpace();
grpPtr->dir.setFile(directory);
- QDir d(directory);
+ TQDir d(directory);
if(d.exists(".directory")) {
KSimpleConfig config(d.absPath()+"/.directory", true);
config.setDesktopGroup();
@@ -85,25 +85,25 @@ void AFChoose::setupTabs()
{
for (grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next())
{
- grpPtr->tab = new QVBox(this);
- QWhatsThis::add(grpPtr->tab, i18n( "Choose a predefined shape by clicking on it then clicking the OK button (or just double-click on the shape). You can then insert the shape onto your slide by drawing the area with the mouse pointer." ) );
+ grpPtr->tab = new TQVBox(this);
+ TQWhatsThis::add(grpPtr->tab, i18n( "Choose a predefined tqshape by clicking on it then clicking the OK button (or just double-click on the tqshape). You can then insert the tqshape onto your slide by drawing the area with the mouse pointer." ) );
grpPtr->loadWid = new KIconCanvas(grpPtr->tab);
// Changes for the new KIconCanvas (Werner)
- QDir d( grpPtr->dir.absFilePath() );
+ TQDir d( grpPtr->dir.absFilePath() );
d.setNameFilter( "*.desktop" );
if( d.exists() ) {
- QStringList files=d.entryList( QDir::Files | QDir::Readable, QDir::Name );
+ TQStringList files=d.entryList( TQDir::Files | TQDir::Readable, TQDir::Name );
for(unsigned int i=0; i<files.count(); ++i) {
- QString path=grpPtr->dir.absFilePath() + QChar('/');
+ TQString path=grpPtr->dir.absFilePath() + TQChar('/');
files[i]=path + files[i];
KSimpleConfig config(files[i]);
config.setDesktopGroup();
if (config.readEntry("Type")=="Link") {
- QString text=config.readEntry("Name");
- QString icon=config.readEntry("Icon");
+ TQString text=config.readEntry("Name");
+ TQString icon=config.readEntry("Icon");
if(icon[0]!='/') // allow absolute paths for icons
icon=path + icon;
- QString filename=config.readPathEntry("URL");
+ TQString filename=config.readPathEntry("URL");
if(filename[0]!='/') {
if(filename.left(6)=="file:/") // I doubt this will happen
filename=filename.right(filename.length()-6);
@@ -112,7 +112,7 @@ void AFChoose::setupTabs()
grpPtr->entries.insert(text, filename);
// now load the icon and create the item
// This code is shamelessly borrowed from KIconCanvas::slotLoadFiles
- QImage img;
+ TQImage img;
img.load(icon);
if (img.isNull()) {
kdWarning() << "Couldn't find icon " << icon << endl;
@@ -127,9 +127,9 @@ void AFChoose::setupTabs()
img = img.smoothScale(width, 60);
}
}
- QPixmap pic;
+ TQPixmap pic;
pic.convertFromImage(img);
- QIconViewItem *item = new QIconViewItem(grpPtr->loadWid, text, pic);
+ TQIconViewItem *item = new TQIconViewItem(grpPtr->loadWid, text, pic);
item->setKey(text);
item->setDragEnabled(false);
item->setDropEnabled(false);
@@ -137,18 +137,18 @@ void AFChoose::setupTabs()
continue; // Invalid .desktop file
}
}
- grpPtr->loadWid->setBackgroundColor(colorGroup().base());
- grpPtr->loadWid->setResizeMode(QIconView::Adjust);
+ grpPtr->loadWid->setBackgroundColor(tqcolorGroup().base());
+ grpPtr->loadWid->setResizeMode(TQIconView::Adjust);
grpPtr->loadWid->sort();
- connect(grpPtr->loadWid,SIGNAL(nameChanged(QString)),
- this,SLOT(nameChanged(QString)));
- connect(this, SIGNAL(currentChanged(QWidget *)), this,
- SLOT(tabChanged(QWidget*)));
- connect(grpPtr->loadWid,SIGNAL( doubleClicked ( QIconViewItem *)),this,
- SLOT(slotDoubleClick()));
- grpPtr->label = new QLabel(grpPtr->tab);
+ connect(grpPtr->loadWid,TQT_SIGNAL(nameChanged(TQString)),
+ this,TQT_SLOT(nameChanged(TQString)));
+ connect(this, TQT_SIGNAL(currentChanged(TQWidget *)), this,
+ TQT_SLOT(tabChanged(TQWidget*)));
+ connect(grpPtr->loadWid,TQT_SIGNAL( doubleClicked ( TQIconViewItem *)),this,
+ TQT_SLOT(slotDoubleClick()));
+ grpPtr->label = new TQLabel(grpPtr->tab);
grpPtr->label->setText(" ");
- grpPtr->label->setMaximumHeight(grpPtr->label->sizeHint().height());
+ grpPtr->label->setMaximumHeight(grpPtr->label->tqsizeHint().height());
addTab(grpPtr->tab,grpPtr->name);
}
}
@@ -160,13 +160,13 @@ void AFChoose::slotDoubleClick()
accept();
}
-void AFChoose::nameChanged(QString name)
+void AFChoose::nameChanged(TQString name)
{
for (grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next())
grpPtr->label->setText(name);
}
-void AFChoose::tabChanged(QWidget *w) {
+void AFChoose::tabChanged(TQWidget *w) {
for(grpPtr=groupList.first();grpPtr != 0;grpPtr=groupList.next()) {
if(grpPtr->tab==w)
@@ -193,10 +193,10 @@ void AFChoose::cancelClicked()
emit afchooseCanceled();
}
-void AFChoose::closeEvent ( QCloseEvent *e )
+void AFChoose::closeEvent ( TQCloseEvent *e )
{
emit afchooseCanceled();
- QTabDialog::closeEvent ( e );
+ TQTabDialog::closeEvent ( e );
}
#include "AFChoose.moc"
diff --git a/kpresenter/autoformEdit/AFChoose.h b/kpresenter/autoformEdit/AFChoose.h
index e767e4bf..d109059d 100644
--- a/kpresenter/autoformEdit/AFChoose.h
+++ b/kpresenter/autoformEdit/AFChoose.h
@@ -21,22 +21,23 @@
#ifndef AFCHOOSE_H
#define AFCHOOSE_H
-#include <qtabdialog.h>
-#include <qptrlist.h>
-#include <qmap.h>
-#include <qfileinfo.h>
+#include <tqtabdialog.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+#include <tqfileinfo.h>
-class QLabel;
+class TQLabel;
class KIconCanvas;
-class AFChoose : public QTabDialog
+class AFChoose : public TQTabDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
// constructor - destructor
- AFChoose(QWidget *parent=0, const QString &caption=QString::null, const char *name=0);
+ AFChoose(TQWidget *tqparent=0, const TQString &caption=TQString(), const char *name=0);
~AFChoose();
private:
@@ -44,12 +45,12 @@ private:
// structure of a group
struct Group
{
- QFileInfo dir;
- QString name;
- QWidget *tab;
+ TQFileInfo dir;
+ TQString name;
+ TQWidget *tab;
KIconCanvas *loadWid;
- QLabel *label;
- QMap<QString, QString> entries;
+ TQLabel *label;
+ TQMap<TQString, TQString> entries;
};
// set groups
@@ -61,14 +62,14 @@ private:
// ********** variables **********
// list of groups and a pointer to a group
- QPtrList<Group> groupList;
+ TQPtrList<Group> groupList;
Group *grpPtr;
private slots:
// name changed
- void nameChanged(QString);
- void tabChanged(QWidget *);
+ void nameChanged(TQString);
+ void tabChanged(TQWidget *);
// autoform chosen
void chosen();
@@ -77,12 +78,12 @@ private slots:
void slotDoubleClick();
protected:
- void closeEvent ( QCloseEvent * );
+ void closeEvent ( TQCloseEvent * );
signals:
//autoform chosen
- void formChosen(const QString &);
+ void formChosen(const TQString &);
void afchooseCanceled();
};
diff --git a/kpresenter/autoformEdit/ATFInterpreter.cpp b/kpresenter/autoformEdit/ATFInterpreter.cpp
index a32ff7ea..ff2b1037 100644
--- a/kpresenter/autoformEdit/ATFInterpreter.cpp
+++ b/kpresenter/autoformEdit/ATFInterpreter.cpp
@@ -20,8 +20,8 @@
#include "ATFInterpreter.h"
-#include <qvaluestack.h>
-#include <qfile.h>
+#include <tqvaluestack.h>
+#include <tqfile.h>
const char ATFInterpreter::PNT_BG[] = "POINT {";
const char ATFInterpreter::X_BG[] = "X {";
@@ -92,10 +92,10 @@ ATFInterpreter::~ATFInterpreter()
attrLs.setAutoDelete( true );
}
-void ATFInterpreter::load(const QString & fileName)
+void ATFInterpreter::load(const TQString & fileName)
{
- QString line;
- QFile ptA(fileName);
+ TQString line;
+ TQFile ptA(fileName);
coordList.clear();
lines.clear();
@@ -112,14 +112,14 @@ void ATFInterpreter::load(const QString & fileName)
}
}
-QPointArray ATFInterpreter::getPointArray(int wid,int heig)
+TQPointArray ATFInterpreter::getPointArray(int wid,int heig)
{
unsigned int px = 0,py = 0,a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
unsigned int tmp = 0,num = 0;
bool calc = false,res = false;
char op = OP_EQUAL,var = VAR_1;
- QPtrList<Sign> slp;
- QPointArray pntArray(coordList.count());
+ TQPtrList<Sign> slp;
+ TQPointArray pntArray(coordList.count());
if (!coordList.isEmpty())
{
@@ -199,13 +199,13 @@ QPointArray ATFInterpreter::getPointArray(int wid,int heig)
if (i == 14) py = tmp;
}
}
- pntArray.setPoint(coordList.at(),px,py);
+ pntArray.setPoint(coordList.tqat(),px,py);
}
}
return pntArray;
}
-QPtrList<ATFInterpreter::AttribList> ATFInterpreter::getAttribList()
+TQPtrList<ATFInterpreter::AttribList> ATFInterpreter::getAttribList()
{
if(!attrLs.isEmpty())
return attrLs;
@@ -228,7 +228,7 @@ QPtrList<ATFInterpreter::AttribList> ATFInterpreter::getAttribList()
void ATFInterpreter::interpret()
{
- QValueStack<int> level;
+ TQValueStack<int> level;
Value value;
bool v = false;
int pw = 1;
@@ -237,9 +237,9 @@ void ATFInterpreter::interpret()
level.push(LEVEL_NULL);
- for (QStringList::Iterator it=lines.begin(); it!=lines.end(); ++it)
+ for (TQStringList::Iterator it=lines.begin(); it!=lines.end(); ++it)
{
- if (!(*it).isEmpty() && (*it).at(0) != COMMENT)
+ if (!(*it).isEmpty() && (*it).tqat(0) != COMMENT)
{
if (level.top() == LEVEL_NULL)
{
@@ -257,7 +257,7 @@ void ATFInterpreter::interpret()
level.push(LEVEL_Y);
else if ((*it) == ATTR_BG)
level.push(LEVEL_ATTR);
- else if ((*it) == QString(END))
+ else if ((*it) == TQString(END))
{
level.pop();
coordList.append(coordPtr);
@@ -265,7 +265,7 @@ void ATFInterpreter::interpret()
}
else if (level.top() == LEVEL_X || level.top() == LEVEL_Y || level.top() == LEVEL_ATTR)
{
- switch (((*it).at(0)).latin1())
+ switch (((*it).tqat(0)).latin1())
{
case VAR_1:
{
@@ -304,13 +304,13 @@ void ATFInterpreter::interpret()
} break;
case VAR_VARIA:
{
- if ((*it).find('0') != -1) v = false;
+ if ((*it).tqfind('0') != -1) v = false;
else v = true;
attrib.isVariable = (*it);
} break;
case VAR_PW:
{
- pw = 1; pw = ((*it).at(4)).latin1() - 48;
+ pw = 1; pw = ((*it).tqat(4)).latin1() - 48;
attrib.pwDiv = (*it);
} break;
case '}':
@@ -320,24 +320,24 @@ void ATFInterpreter::interpret()
case LEVEL_X:
{
coordPtr->pntX = value;
- coord.a = QString::null;
- coord.b = QString::null;
- coord.c = QString::null;
- coord.d = QString::null;
- coord.e = QString::null;
- coord.f = QString::null;
- coord.result = QString::null;
+ coord.a = TQString();
+ coord.b = TQString();
+ coord.c = TQString();
+ coord.d = TQString();
+ coord.e = TQString();
+ coord.f = TQString();
+ coord.result = TQString();
} break;
case LEVEL_Y:
{
coordPtr->pntY = value;
- coord.a = QString::null;
- coord.b = QString::null;
- coord.c = QString::null;
- coord.d = QString::null;
- coord.e = QString::null;
- coord.f = QString::null;
- coord.result = QString::null;
+ coord.a = TQString();
+ coord.b = TQString();
+ coord.c = TQString();
+ coord.d = TQString();
+ coord.e = TQString();
+ coord.f = TQString();
+ coord.result = TQString();
} break;
case LEVEL_ATTR:
{
@@ -345,7 +345,7 @@ void ATFInterpreter::interpret()
coordPtr->pwDiv = pw;
pw = 1;
v = false;
- attrib.isVariable = QString::null;
+ attrib.isVariable = TQString();
attrib.pwDiv = 1;
} break;
}
@@ -357,16 +357,16 @@ void ATFInterpreter::interpret()
}
}
-QPtrList<ATFInterpreter::Sign> ATFInterpreter::getVar(const QString &s)
+TQPtrList<ATFInterpreter::Sign> ATFInterpreter::getVar(const TQString &s)
{
- QPtrList<Sign> list;
+ TQPtrList<Sign> list;
for (unsigned int i=1; i<s.length(); ++i)
{
- if(s.at(i)==' ')
+ if(s.tqat(i)==' ')
continue;
signPtr = new Sign;
- switch (s.at(i).latin1())
+ switch (s.tqat(i).latin1())
{
case VAR_W: signPtr->type = ST_WIDTH; break;
case VAR_H: signPtr->type = ST_HEIGHT; break;
@@ -431,20 +431,20 @@ QPtrList<ATFInterpreter::Sign> ATFInterpreter::getVar(const QString &s)
signPtr->type = ST_NUMBER;
if (s.length() - 1 > i)
{
- switch (s.at(i+1).latin1())
+ switch (s.tqat(i+1).latin1())
{
case NUM_0: case NUM_1: case NUM_2: case NUM_3: case NUM_4:
case NUM_5: case NUM_6: case NUM_7: case NUM_8: case NUM_9:
{
- signPtr->num = (s.at(i).latin1() - 48) * 10 + s.at(i+1).latin1() - 48;
+ signPtr->num = (s.tqat(i).latin1() - 48) * 10 + s.tqat(i+1).latin1() - 48;
i++;
} break;
default:
- signPtr->num = s.at(i).latin1() - 48; break;
+ signPtr->num = s.tqat(i).latin1() - 48; break;
}
}
else
- signPtr->num = s.at(i).latin1() - 48;
+ signPtr->num = s.tqat(i).latin1() - 48;
} break;
}
list.append(signPtr);
diff --git a/kpresenter/autoformEdit/ATFInterpreter.h b/kpresenter/autoformEdit/ATFInterpreter.h
index 8e0feebb..e532a49a 100644
--- a/kpresenter/autoformEdit/ATFInterpreter.h
+++ b/kpresenter/autoformEdit/ATFInterpreter.h
@@ -21,9 +21,9 @@
#ifndef ATFINTERP_H
#define ATFINTERP_H
-#include <qpointarray.h>
-#include <qptrlist.h>
-#include <qstringlist.h>
+#include <tqpointarray.h>
+#include <tqptrlist.h>
+#include <tqstringlist.h>
class ATFInterpreter {
@@ -39,20 +39,20 @@ public:
// coordinate structure
struct CoordStruct
{
- QString a;
- QString b;
- QString c;
- QString d;
- QString e;
- QString f;
- QString result;
+ TQString a;
+ TQString b;
+ TQString c;
+ TQString d;
+ TQString e;
+ TQString f;
+ TQString result;
};
// attribute structure
struct AttribStruct
{
- QString isVariable;
- QString pwDiv;
+ TQString isVariable;
+ TQString pwDiv;
};
// structure of signs
@@ -67,13 +67,13 @@ public:
// structure of values
struct Value
{
- QPtrList<Sign> var1;
- QPtrList<Sign> var2;
- QPtrList<Sign> var3;
- QPtrList<Sign> var4;
- QPtrList<Sign> var5;
- QPtrList<Sign> var6;
- QPtrList<Sign> result;
+ TQPtrList<Sign> var1;
+ TQPtrList<Sign> var2;
+ TQPtrList<Sign> var3;
+ TQPtrList<Sign> var4;
+ TQPtrList<Sign> var5;
+ TQPtrList<Sign> var6;
+ TQPtrList<Sign> result;
};
// constructure - destructure
@@ -81,11 +81,11 @@ public:
~ATFInterpreter();
// load autoform
- void load(const QString &);
+ void load(const TQString &);
// get pointarray/attribute list/points
- QPointArray getPointArray(int,int);
- QPtrList<AttribList> getAttribList();
+ TQPointArray getPointArray(int,int);
+ TQPtrList<AttribList> getAttribList();
protected:
@@ -157,19 +157,19 @@ protected:
void interpret();
// get varaible of a line
- QPtrList<Sign> getVar(const QString&);
+ TQPtrList<Sign> getVar(const TQString&);
// ********** variables **********
// list of coordinates and pointers to coordinate/sign/value
- QPtrList<Coord> coordList;
- QPtrList<AttribList> attrLs;
+ TQPtrList<Coord> coordList;
+ TQPtrList<AttribList> attrLs;
Coord *coordPtr;
Sign *signPtr;
Value *valuePtr;
// list of lines
- QStringList lines;
+ TQStringList lines;
};
#endif //ATFINTERP_H