diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 21:30:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-01 21:30:26 +0000 |
commit | 94ddde53d91cbdb554bbe78b108ccbd6a7d7c13a (patch) | |
tree | 961f7eb9997011a96d54a249dcb663025f686102 /src/mainwidget.cpp | |
parent | dad5420e97a9a56cce014e9380026063ee9d279c (diff) | |
download | potracegui-94ddde53d91cbdb554bbe78b108ccbd6a7d7c13a.tar.gz potracegui-94ddde53d91cbdb554bbe78b108ccbd6a7d7c13a.zip |
TQt4 port potracegui
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/potracegui@1239033 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/mainwidget.cpp')
-rw-r--r-- | src/mainwidget.cpp | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp index 6e85ce1..6863fcb 100644 --- a/src/mainwidget.cpp +++ b/src/mainwidget.cpp @@ -23,15 +23,15 @@ #include "options.h" #include "autotraceformats.h" -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qbuffer.h> -#include <qbuttongroup.h> -#include <qtabwidget.h> -#include <qcursor.h> -#include <qapplication.h> -#include <qwidgetstack.h> -#include <qglobal.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqbuffer.h> +#include <tqbuttongroup.h> +#include <tqtabwidget.h> +#include <tqcursor.h> +#include <tqapplication.h> +#include <tqwidgetstack.h> +#include <tqglobal.h> #include <kurldrag.h> #include <kfiledialog.h> @@ -48,19 +48,19 @@ #include <fstream> using namespace std; -MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl): MainWidgetBase(parent,name,fl), m_changed(false) { +MainWidget::MainWidget(TQWidget* tqparent, const char* name, WFlags fl): MainWidgetBase(tqparent,name,fl), m_changed(false) { KImageIO::registerFormats(); setAcceptDrops(true); /*Scrolled image viewers*/ delete imagesTabs->page(0); - QScrollView *originalScroll=new QScrollView(this); - QScrollView *previewScroll=new QScrollView(this); + TQScrollView *originalScroll=new TQScrollView(this); + TQScrollView *previewScroll=new TQScrollView(this); imagesTabs->addTab(originalScroll,i18n("Original image")); imagesTabs->addTab(previewScroll,i18n("Preview")); - originalLabel=new QLabel(this); - previewLabel=new QLabel(this); + originalLabel=new TQLabel(this); + previewLabel=new TQLabel(this); originalLabel->setGeometry(0,0,10,10); previewLabel->setGeometry(0,0,10,10); originalScroll->addChild(originalLabel); @@ -73,14 +73,14 @@ MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl): MainWidget m_state.clear(); m_oldPreviews.clear(); m_state.push_back(o); - m_oldPreviews.push_back(QPixmap()); + m_oldPreviews.push_back(TQPixmap()); m_currentState=m_state.begin(); m_currentPreview=m_oldPreviews.begin(); - connect(&tracer,SIGNAL(processExited()),this,SLOT(tracerExited())); - connect(&tracer,SIGNAL(wroteToStdin()),this,SLOT(writeCompleted())); - connect(traceBtn,SIGNAL(clicked()),this,SLOT(trace())); - connect(defaultBtn,SIGNAL(clicked()),this,SLOT(defaultOptions())); + connect(&tracer,TQT_SIGNAL(processExited()),this,TQT_SLOT(tracerExited())); + connect(&tracer,TQT_SIGNAL(wroteToStdin()),this,TQT_SLOT(writeCompleted())); + connect(traceBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(trace())); + connect(defaultBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(defaultOptions())); emit(signalChangeStatusbar(i18n("Checking autotrace formats."))); AutotraceFormats *formats=new AutotraceFormats(); @@ -105,17 +105,17 @@ MainWidget::~MainWidget() { } void MainWidget::fileOpen() { - KFileDialog d(QString::null,KImageIO::pattern(),this,i18n("Select an image"),true); + KFileDialog d(TQString(),KImageIO::pattern(),this,i18n("Select an image"),true); d.exec(); - if(d.result()==QDialog::Accepted) + if(d.result()==TQDialog::Accepted) getImageFromURL(d.selectedURL()); } void MainWidget::fileSave() { if(m_outputFilename=="" && m_changed) { - QString filter; + TQString filter; if(backendCombo->currentText()=="potrace") { //potrace formats if((**m_currentState)["outputFormat"]==i18n("eps")) filter=i18n("*.eps|Encapsulated postscript"); @@ -133,14 +133,14 @@ void MainWidget::fileSave() { else { //autotrace formats filter="*."+(**m_currentState)["outputFormat"]; } - QString saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to")); + TQString saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to")); bool salva=false; while(saveFilename!="") { int res; - if(QFile::exists(saveFilename)) - res=KMessageBox::warningYesNo(this, i18n("Overwrite %1 ?").arg(saveFilename)); + if(TQFile::exists(saveFilename)) + res=KMessageBox::warningYesNo(this, i18n("Overwrite %1 ?").tqarg(saveFilename)); else { salva=true; @@ -152,7 +152,7 @@ void MainWidget::fileSave() { break; } else - saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to")); + saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to")); } if(salva) @@ -165,14 +165,14 @@ void MainWidget::fileSave() { emit signalChangeStatusbar(i18n(i18n("Error while saving file"))); return; } - emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename)); char ch; while(in.get(ch)) out.put(ch); in.close(); out.close(); m_changed=false; - emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename)); } else emit signalChangeStatusbar(i18n("File not saved")); @@ -186,14 +186,14 @@ void MainWidget::fileSave() { emit signalChangeStatusbar(i18n("Error while saving file")); return; } - emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename)); char ch; while(in.get(ch)) out.put(ch); in.close(); out.close(); - emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename)); m_changed=false; } } @@ -201,7 +201,7 @@ void MainWidget::fileSave() { void MainWidget::fileSaveAs() { if(previewLabel->pixmap()!=0 || previewLabel->text()!="") { - QString filter; + TQString filter; if(backendCombo->currentText()=="potrace") { //potrace formats if((**m_currentState)["outputFormat"]==i18n("eps")) filter=i18n("*.eps|Encapsulated postscript"); @@ -219,14 +219,14 @@ void MainWidget::fileSaveAs() { else { //autotrace formats filter="*."+(**m_currentState)["outputFormat"]; } - QString saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to")); + TQString saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to")); bool salva=false; while(saveFilename!="") { int res; - if(QFile::exists(saveFilename)) - res=KMessageBox::warningYesNo(this,i18n("Overwrite %1 ?").arg(saveFilename)); + if(TQFile::exists(saveFilename)) + res=KMessageBox::warningYesNo(this,i18n("Overwrite %1 ?").tqarg(saveFilename)); else { salva=true; @@ -238,7 +238,7 @@ void MainWidget::fileSaveAs() { break; } else - saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to")); + saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to")); } if(salva) @@ -251,14 +251,14 @@ void MainWidget::fileSaveAs() { emit signalChangeStatusbar(i18n("Error while saving file")); return; } - emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename)); char ch; while(in.get(ch)) out.put(ch); in.close(); out.close(); m_changed=false; - emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename)); + emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename)); } else emit signalChangeStatusbar(i18n("File not saved")); @@ -277,7 +277,7 @@ void MainWidget::fileClose() { m_state.clear(); m_oldPreviews.clear(); m_state.push_back(o); - m_oldPreviews.push_back(QPixmap()); + m_oldPreviews.push_back(TQPixmap()); m_currentState=m_state.begin(); m_currentPreview=m_oldPreviews.begin(); readOptions(); @@ -286,7 +286,7 @@ void MainWidget::fileClose() { void MainWidget::cut() { if(originalLabel->pixmap()!=0) { - QApplication::clipboard()->setPixmap(QPixmap(*(originalLabel->pixmap()))); + TQApplication::tqclipboard()->setPixmap(TQPixmap(*(originalLabel->pixmap()))); fileClose(); } } @@ -294,12 +294,12 @@ void MainWidget::cut() { void MainWidget::copy() { if(originalLabel->pixmap()!=0) { - QApplication::clipboard()->setPixmap(QPixmap(*(originalLabel->pixmap()))); + TQApplication::tqclipboard()->setPixmap(TQPixmap(*(originalLabel->pixmap()))); } } void MainWidget::paste() { - QPixmap clip=QApplication::clipboard()->pixmap(); + TQPixmap clip=TQApplication::tqclipboard()->pixmap(); if(!clip.isNull()) { if(!createTmpFilename()) @@ -309,7 +309,7 @@ void MainWidget::paste() { } m_outputFilename=""; - QPixmap pix(QApplication::clipboard()->pixmap()); + TQPixmap pix(TQApplication::tqclipboard()->pixmap()); originalLabel->clear(); originalLabel->setGeometry(0,0,pix.width(),pix.height()); originalLabel->setPixmap(pix); @@ -333,7 +333,7 @@ void MainWidget::paste() { if(previewLabel->pixmap()!=0) m_oldPreviews.push_back(*(previewLabel->pixmap())); else - m_oldPreviews.push_back(QPixmap()); + m_oldPreviews.push_back(TQPixmap()); m_currentState=m_state.begin(); m_currentPreview=m_oldPreviews.begin(); @@ -342,7 +342,7 @@ void MainWidget::paste() { } void MainWidget::getImageFromURL(KURL url) { - QString filename; // prevent overwriting previous local file with current remote one + TQString filename; // prevent overwriting previous local file with current remote one if (!url.isLocalFile()) { // download to temporary file if (!KIO::NetAccess::download(url,filename,this)) @@ -359,14 +359,14 @@ void MainWidget::getImageFromURL(KURL url) { } m_outputFilename=""; - QPixmap pix(filename); + TQPixmap pix(filename); originalLabel->clear(); originalLabel->setGeometry(0,0,pix.width(),pix.height()); originalLabel->setPixmap(pix); previewLabel->clear(); previewLabel->setGeometry(0,0,10,10); imagesTabs->setCurrentPage(0); - emit signalChangeStatusbar(i18n("File %1 loaded.").arg(filename)); + emit signalChangeStatusbar(i18n("File %1 loaded.").tqarg(filename)); if (!url.isLocalFile()) KIO::NetAccess::removeTempFile(filename); @@ -386,7 +386,7 @@ void MainWidget::getImageFromURL(KURL url) { if(previewLabel->pixmap()!=0) m_oldPreviews.push_back(*(previewLabel->pixmap())); else - m_oldPreviews.push_back(QPixmap()); + m_oldPreviews.push_back(TQPixmap()); m_currentState=m_state.begin(); m_currentPreview=m_oldPreviews.begin(); @@ -416,14 +416,14 @@ void MainWidget::readOptions() { { //pgm format antialiasGamma->setValue(((**m_currentState)["antialiasGamma"]).toFloat()); //Scale - if(((**m_currentState)["scale"]).find('x')==-1) + if(((**m_currentState)["scale"]).tqfind('x')==-1) { //only one value scaleAll->setValue(((**m_currentState)["scale"]).toFloat()); scaleAllBTN->setChecked(true); } else { - QString tmp=(**m_currentState)["scale"]; + TQString tmp=(**m_currentState)["scale"]; scaleX->setValue((tmp.section('x',0,0)).toFloat()); scaleY->setValue((tmp.section('x',1,1)).toFloat()); scaleXYBTN->setChecked(true); @@ -431,9 +431,9 @@ void MainWidget::readOptions() { } //Color - foregroundBtn->setColor(QColor((**m_currentState)["foregroundBtn"])); + foregroundBtn->setColor(TQColor((**m_currentState)["foregroundBtn"])); opaque->setChecked((**m_currentState)["opaque"]=="y"); - backgroundBtn->setColor(QColor((**m_currentState)["backgroundBtn"])); + backgroundBtn->setColor(TQColor((**m_currentState)["backgroundBtn"])); //Algorithm policy->setCurrentItem(((**m_currentState)["policy"]).toInt()); @@ -450,21 +450,21 @@ void MainWidget::readOptions() { rotation->setValue(((**m_currentState)["rotation"]).toFloat()); //Resolution - if(((**m_currentState)["resolution"]).find('x')==-1) + if(((**m_currentState)["resolution"]).tqfind('x')==-1) { //only one value resolutionAll->setValue(((**m_currentState)["resolution"]).toFloat()); resolutionAllBTN->setChecked(true); } else { - QString tmp=(**m_currentState)["resolution"]; + TQString tmp=(**m_currentState)["resolution"]; resolutionX->setValue((tmp.section('x',0,0)).toFloat()); resolutionY->setValue((tmp.section('x',1,1)).toFloat()); resolutionXYBTN->setChecked(true); } //Margins - QString tmp=(**m_currentState)["margins"]; + TQString tmp=(**m_currentState)["margins"]; marginsL->setValue((tmp.section('x',0,0)).toFloat()); marginsR->setValue((tmp.section('x',1,1)).toFloat()); marginsT->setValue((tmp.section('x',2,2)).toFloat()); @@ -484,7 +484,7 @@ void MainWidget::getOptions() { void MainWidget::getPotraceOptions( ) { //input-output - (*m_currentState)->setValue("blackLevel",QString::number(blackLevel->value())); + (*m_currentState)->setValue("blackLevel",TQString::number(blackLevel->value())); if(invertInput->isChecked()) (*m_currentState)->setValue("invertInput","y"); else @@ -494,7 +494,7 @@ void MainWidget::getPotraceOptions( ) { { //ps options (*m_currentState)->setValue("pageSize",pageSize->currentText()); (*m_currentState)->setValue("optimizedNumericalCode",(optimizedNumericalCode->isChecked())?"y":"n"); - QButton *b=compressionLevel->selected(); + TQButton *b=compressionLevel->selected(); if(b->text()=="None") (*m_currentState)->setValue("compressionLevel","1"); else if(b->text()=="Level 2") @@ -514,44 +514,44 @@ void MainWidget::getPotraceOptions( ) { } else { //pgm options - (*m_currentState)->setValue("antialiasGamma",QString::number(antialiasGamma->value())); + (*m_currentState)->setValue("antialiasGamma",TQString::number(antialiasGamma->value())); //Scale if(scaleAll->isEnabled()) - (*m_currentState)->setValue("scale",QString::number(scaleAll->value())); + (*m_currentState)->setValue("scale",TQString::number(scaleAll->value())); else - (*m_currentState)->setValue("scale",QString::number(scaleX->value())+"x"+QString::number(scaleY->value())); + (*m_currentState)->setValue("scale",TQString::number(scaleX->value())+"x"+TQString::number(scaleY->value())); } //Color - QColor c=foregroundBtn->color(); + TQColor c=foregroundBtn->color(); (*m_currentState)->setValue("foregroundBtn",c.name()); (*m_currentState)->setValue("opaque",(opaque->isChecked())?"y":"n"); c=backgroundBtn->color(); (*m_currentState)->setValue("backgroundBtn",c.name()); //Algorithm - (*m_currentState)->setValue("policy",QString::number(policy->currentItem())); - (*m_currentState)->setValue("despeckle",QString::number(despeckle->value())); - (*m_currentState)->setValue("cornerThreshold",QString::number(cornerThreshold->value())); - (*m_currentState)->setValue("optimizationTolerance",QString::number(optimizationTolerance->value())); - (*m_currentState)->setValue("outputQuantization",QString::number(outputQuantization->value())); + (*m_currentState)->setValue("policy",TQString::number(policy->currentItem())); + (*m_currentState)->setValue("despeckle",TQString::number(despeckle->value())); + (*m_currentState)->setValue("cornerThreshold",TQString::number(cornerThreshold->value())); + (*m_currentState)->setValue("optimizationTolerance",TQString::number(optimizationTolerance->value())); + (*m_currentState)->setValue("outputQuantization",TQString::number(outputQuantization->value())); (*m_currentState)->setValue("curveOptimization",(curveOptimization->isChecked())?"y":"n"); //Transformation - (*m_currentState)->setValue("width",QString::number(width->value())); - (*m_currentState)->setValue("height",QString::number(height->value())); - (*m_currentState)->setValue("stretch",QString::number(stretch->value())); - (*m_currentState)->setValue("rotation",QString::number(rotation->value())); + (*m_currentState)->setValue("width",TQString::number(width->value())); + (*m_currentState)->setValue("height",TQString::number(height->value())); + (*m_currentState)->setValue("stretch",TQString::number(stretch->value())); + (*m_currentState)->setValue("rotation",TQString::number(rotation->value())); //Resolution if(resolutionAll->isEnabled()) - (*m_currentState)->setValue("resolution",QString::number(resolutionAll->value())); + (*m_currentState)->setValue("resolution",TQString::number(resolutionAll->value())); else - (*m_currentState)->setValue("resolution",QString::number(resolutionX->value())+"x"+QString::number(resolutionY->value())); + (*m_currentState)->setValue("resolution",TQString::number(resolutionX->value())+"x"+TQString::number(resolutionY->value())); //Margins (*m_currentState)->setValue("syncronizeMargins",checkBoxSyncronizeMargins->isChecked()?"y":"n"); - (*m_currentState)->setValue("margins",QString::number(marginsL->value())+"x"+QString::number(marginsR->value())+"x"+QString::number(marginsT->value())+"x"+QString::number(marginsB->value())); + (*m_currentState)->setValue("margins",TQString::number(marginsL->value())+"x"+TQString::number(marginsR->value())+"x"+TQString::number(marginsT->value())+"x"+TQString::number(marginsB->value())); } void MainWidget::getAutotraceOptions( ) { @@ -560,35 +560,35 @@ void MainWidget::getAutotraceOptions( ) { opt->clear(); //input output - QString tmp=autotraceOutputFormat->currentText(); - tmp.truncate(tmp.find(" ")); + TQString tmp=autotraceOutputFormat->currentText(); + tmp.truncate(tmp.tqfind(" ")); opt->setValue("outputFormat",tmp); if(autotraceDpiCheckbox->isChecked() && autotraceDpiInput->value()!=0) - opt->setValue("dpi",QString::number(autotraceDpiInput->value())); + opt->setValue("dpi",TQString::number(autotraceDpiInput->value())); opt->setValue("reduceColorsEnabled",(autotraceCheckBoxReduceColors->isChecked())?"y":"n"); - opt->setValue("colorCount",QString::number(autotraceColorCount->value())); + opt->setValue("colorCount",TQString::number(autotraceColorCount->value())); if(autotraceUseBackground->isChecked()) - opt->setValue("background",autotraceBackground->color().name().upper()); + opt->setValue("background",TQString(autotraceBackground->color().name()).upper()); if(autotraceLog->isChecked()) opt->setValue("log","y"); //corners and curves if(autotraceThreshold->value()!=100) - opt->setValue("threshold",QString::number(autotraceThreshold->value())); + opt->setValue("threshold",TQString::number(autotraceThreshold->value())); if(autotraceAlwaysThreshold->value()!=60) - opt->setValue("alwaysThreshold",QString::number(autotraceAlwaysThreshold->value())); + opt->setValue("alwaysThreshold",TQString::number(autotraceAlwaysThreshold->value())); if(autotraceSurround->value()!=4) - opt->setValue("surround",QString::number(autotraceSurround->value())); + opt->setValue("surround",TQString::number(autotraceSurround->value())); if(autotraceAdjacentCorners->isChecked()) opt->setValue("removeAdjacentCorners","y"); if(autotraceErrorThreshold->value()!=2) - opt->setValue("errorThreshold",QString::number(autotraceErrorThreshold->value())); + opt->setValue("errorThreshold",TQString::number(autotraceErrorThreshold->value())); if(autotraceLineThreshold->value()!=1) - opt->setValue("lineThreshold",QString::number(autotraceLineThreshold->value())); + opt->setValue("lineThreshold",TQString::number(autotraceLineThreshold->value())); if(autotraceReversionThreshold->value()!=0.01) - opt->setValue("reversionThreshold",QString::number(autotraceReversionThreshold->value())); + opt->setValue("reversionThreshold",TQString::number(autotraceReversionThreshold->value())); if(autotraceIterations->value()!=4) - opt->setValue("iterations",QString::number(autotraceIterations->value())); + opt->setValue("iterations",TQString::number(autotraceIterations->value())); if(autotracePreserveWidth->isChecked()) opt->setValue("preserveWidth","y"); @@ -596,23 +596,23 @@ void MainWidget::getAutotraceOptions( ) { if(autotraceCenterline->isChecked()) opt->setValue("centerline","y"); if(autotraceTangentSurround->value()!=3) - opt->setValue("tangentSurround",QString::number(autotraceTangentSurround->value())); + opt->setValue("tangentSurround",TQString::number(autotraceTangentSurround->value())); //despeckle opt->setValue("doDespeckle",(autotraceDoDespeckle->isChecked()?"y":"n")); - opt->setValue("despeckleLevel",QString::number(autotraceDespeckleLevel->value())); - opt->setValue("despeckleTightness",QString::number(autotraceDespeckleTightness->value())); + opt->setValue("despeckleLevel",TQString::number(autotraceDespeckleLevel->value())); + opt->setValue("despeckleTightness",TQString::number(autotraceDespeckleTightness->value())); } -QStringList MainWidget::createCommandLine() { +TQStringList MainWidget::createCommandLine() { if(backendCombo->currentText()=="potrace") return createPotraceCommandLine(); else return createAutotraceCommandLine(); } -QStringList MainWidget::createPotraceCommandLine( ) { - QStringList toReturn; +TQStringList MainWidget::createPotraceCommandLine( ) { + TQStringList toReturn; toReturn+="potrace"; //input @@ -750,11 +750,11 @@ QStringList MainWidget::createPotraceCommandLine( ) { //Margins if((**m_currentState)["margins"]!="0" && (**m_currentState)["margins"]!="0x0x0x0") { - if((**m_currentState)["margins"].find('x')==-1) + if((**m_currentState)["margins"].tqfind('x')==-1) toReturn+="-M"+(**m_currentState)["margins"]+"cm"; else { - QString tmp=(**m_currentState)["margins"]; + TQString tmp=(**m_currentState)["margins"]; toReturn+="-L"+tmp.section('x',0,0)+"cm"; toReturn+="-R"+tmp.section('x',1,1)+"cm"; toReturn+="-T"+tmp.section('x',2,2)+"cm"; @@ -765,9 +765,9 @@ QStringList MainWidget::createPotraceCommandLine( ) { return toReturn; } -QStringList MainWidget::createAutotraceCommandLine( ) { - QStringList toReturn; - QString tmp; +TQStringList MainWidget::createAutotraceCommandLine( ) { + TQStringList toReturn; + TQString tmp; toReturn+="autotrace"; //iput-output @@ -822,7 +822,7 @@ QStringList MainWidget::createAutotraceCommandLine( ) { //input file char inputFile[]="/tmp/potraceguiTmp-XXXXXX"; mkstemp(inputFile); - m_tmpInputFilename=QString(inputFile); + m_tmpInputFilename=TQString(inputFile); originalLabel->pixmap()->save(m_tmpInputFilename,"PPM"); toReturn+="--input-format=PPM"; toReturn+=m_tmpInputFilename; @@ -848,7 +848,7 @@ void MainWidget::trace() { aborted=false; getOptions(); - QStringList commandLine=createCommandLine(); + TQStringList commandLine=createCommandLine(); tracer.clearArguments(); tracer.setArguments(commandLine); @@ -863,8 +863,8 @@ void MainWidget::trace() { { emit(signalChangeStatusbar(i18n("Tracing..."))); traceBtn->setText(i18n("Abort")); - QByteArray pixData; - QBuffer buf(pixData); + TQByteArray pixData; + TQBuffer buf(pixData); buf.open(IO_WriteOnly); originalLabel->pixmap()->save(&buf,"PPM"); tracer.writeToStdin(pixData); @@ -879,25 +879,25 @@ void MainWidget::tracerExited() { setCursor(ArrowCursor); return; } - if(tracer.exitStatus()!=0) + if(tracer.exitqStatus()!=0) { emit(signalChangeStatusbar(i18n("Finished with errors"))); - QString tmp(i18n("Error during the process:")); + TQString tmp(i18n("Error during the process:")); tmp+=i18n("Standard output:\n"); - QString t=tracer.readLineStdout(); - while(t!=QString::null) + TQString t=tracer.readLineStdout(); + while(t!=TQString()) { tmp+= t+"\n"; t=tracer.readLineStdout(); } tmp+=i18n("Standard error:\n"); t=tracer.readLineStderr(); - while(t!=QString::null) + while(t!=TQString()) { tmp+=t+"\n"; t=tracer.readLineStderr(); } - QStringList l=tracer.arguments(); + TQStringList l=tracer.arguments(); tmp+=i18n("Executed:\n")+l.join(" "); previewLabel->setText(tmp); setCursor(ArrowCursor); @@ -908,8 +908,8 @@ void MainWidget::tracerExited() { if(autoTraceCheck->isChecked()) { emit(signalChangeStatusbar(i18n("Loading preview image..."))); - QImage img(m_tmpFilename); - QPixmap pix; + TQImage img(m_tmpFilename); + TQPixmap pix; if(pix.convertFromImage(img,0)) { previewLabel->clear(); @@ -930,7 +930,7 @@ void MainWidget::tracerExited() { //delete autotrace tempfile if(backendCombo->currentText()=="autotrace") { - QFile tmp(m_tmpInputFilename); + TQFile tmp(m_tmpInputFilename); tmp.remove(); } @@ -947,7 +947,7 @@ bool MainWidget::createTmpFilename() { char tmp[]="/tmp/potraceguiTmp-XXXXXX"; if (mkstemp(tmp)!=-1) { - m_tmpFilename=QString(tmp); + m_tmpFilename=TQString(tmp); return true; } else @@ -955,25 +955,25 @@ bool MainWidget::createTmpFilename() { } bool MainWidget::deleteTmpFilename() { - QFile tmp(m_tmpFilename); + TQFile tmp(m_tmpFilename); bool toReturn=tmp.remove(); if(toReturn==true) m_tmpFilename=""; return toReturn; } -int MainWidget::notificationDialog(QString caption, QString text) { +int MainWidget::notificationDialog(TQString caption, TQString text) { KDialogBase w(this, "potracegui", true, caption, KDialogBase::Ok|KDialogBase::Cancel,KDialogBase::Ok,true); - w.setMainWidget(new QLabel(text,&w)); + w.setMainWidget(new TQLabel(text,&w)); w.exec(); return w.result(); } -void MainWidget::dragEnterEvent(QDragEnterEvent* event) { +void MainWidget::dragEnterEvent(TQDragEnterEvent* event) { event->accept(KURLDrag::canDecode(event)); } -void MainWidget::dropEvent(QDropEvent* event) { +void MainWidget::dropEvent(TQDropEvent* event) { KURL::List urls; if (KURLDrag::decode(event,urls)) { @@ -990,7 +990,7 @@ void MainWidget::defaultOptions() { m_state.clear(); m_oldPreviews.clear(); m_state.push_back(o); - m_oldPreviews.push_back(QPixmap()); + m_oldPreviews.push_back(TQPixmap()); m_currentState=m_state.begin(); m_currentPreview=m_oldPreviews.begin(); @@ -1023,7 +1023,7 @@ void MainWidget::defaultOptions() { optionsStack->raiseWidget(psPage); } -void MainWidget::showOptions(const QString &selection) { +void MainWidget::showOptions(const TQString &selection) { if(selection==i18n("SVG")) optionsStack->raiseWidget(svgPage); else if(selection==i18n("pgm")) @@ -1034,7 +1034,7 @@ void MainWidget::showOptions(const QString &selection) { optionsStack->raiseWidget(undefinedPage); } -void MainWidget::backendChoosen( const QString & back ) { +void MainWidget::backendChoosen( const TQString & back ) { if(back=="potrace") backendStack->raiseWidget(potracePage); else |