From 94ddde53d91cbdb554bbe78b108ccbd6a7d7c13a Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 1 Jul 2011 21:30:26 +0000 Subject: 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 --- src/MainWidgetBase.ui | 284 +++++++++++++++++++++++------------------------ src/autotraceformats.cpp | 16 +-- src/autotraceformats.h | 29 ++--- src/mainwidget.cpp | 234 +++++++++++++++++++------------------- src/mainwidget.h | 57 +++++----- src/options.cpp | 10 +- src/options.h | 8 +- src/potracegui.cpp | 36 +++--- src/potracegui.h | 5 +- 9 files changed, 341 insertions(+), 338 deletions(-) (limited to 'src') diff --git a/src/MainWidgetBase.ui b/src/MainWidgetBase.ui index e1a5a43..965974a 100644 --- a/src/MainWidgetBase.ui +++ b/src/MainWidgetBase.ui @@ -1,6 +1,6 @@ MainWidgetBase - + MainWidgetBase @@ -25,7 +25,7 @@ unnamed - + imagesTabs @@ -37,13 +37,13 @@ 0 - + 800 600 - + tab @@ -57,19 +57,19 @@ - + - layout7 + tqlayout7 unnamed - + backendStack - + potracePage @@ -80,7 +80,7 @@ unnamed - + tabWidget3 @@ -92,7 +92,7 @@ 0 - + tab @@ -103,7 +103,7 @@ unnamed - + groupBox2 @@ -114,7 +114,7 @@ unnamed - + textLabel2_3 @@ -139,7 +139,7 @@ Pixel threshold for B&W conversion of the image - + invertInput @@ -155,7 +155,7 @@ - + groupBox8 @@ -185,7 +185,7 @@ Output foreground color - + textLabel4_2_2_3 @@ -196,7 +196,7 @@ Output foreground color - + opaque @@ -231,7 +231,7 @@ - + groupBox1 @@ -306,11 +306,11 @@ - + optionsStack - + psPage @@ -321,7 +321,7 @@ unnamed - + psFrame @@ -332,7 +332,7 @@ unnamed - + textLabel3_3 @@ -417,7 +417,7 @@ Output page size - + optimizedNumericalCode @@ -432,7 +432,7 @@ PostScript - + compressionLevel @@ -443,7 +443,7 @@ PostScript unnamed - + level1 @@ -457,7 +457,7 @@ PostScript No compression - + level2 @@ -474,7 +474,7 @@ PostScript Standard compression (needs LZW-enabled compress) - + level3 @@ -494,7 +494,7 @@ PostScript - + svgPage @@ -505,7 +505,7 @@ PostScript unnamed - + svgFrame @@ -516,7 +516,7 @@ PostScript unnamed - + SVGGroup @@ -531,7 +531,7 @@ PostScript - + pgmPage @@ -542,7 +542,7 @@ PostScript unnamed - + pgmFrame @@ -553,7 +553,7 @@ PostScript unnamed - + textLabel5_2 @@ -575,7 +575,7 @@ PostScript Gamma value for anti-aliasing - + buttonGroup1 @@ -586,15 +586,15 @@ PostScript unnamed - + - layout3 + tqlayout3 unnamed - + scaleAllBTN @@ -618,15 +618,15 @@ PostScript - + - layout4 + tqlayout4 unnamed - + textLabel10_3 @@ -651,7 +651,7 @@ PostScript Scale factor (>1 enlarges, <1 shrinks) - + textLabel9_3 @@ -665,7 +665,7 @@ PostScript Scale factor (>1 enlarges, <1 shrinks) - + scaleXYBTN @@ -698,7 +698,7 @@ PostScript - + undefinedPage @@ -735,7 +735,7 @@ PostScript Expanding - + 20 40 @@ -752,7 +752,7 @@ PostScript Expanding - + 20 40 @@ -769,7 +769,7 @@ PostScript Expanding - + 40 20 @@ -786,7 +786,7 @@ PostScript Expanding - + 40 20 @@ -806,7 +806,7 @@ PostScript Expanding - + 20 16 @@ -815,7 +815,7 @@ PostScript - + tab @@ -836,14 +836,14 @@ PostScript Expanding - + 20 297 - + curveOptimization @@ -993,7 +993,7 @@ decomposition Set output quantization. Coordinates in the output are rounded to 1/value pixels. The default value of 10 usually gives good results. In the case of the gimppath backend, this option is used to set the desired magnification. This option has no effect for the XFig backend, which always rasterizes to 1/1200 inch. - + textLabel1_4 @@ -1007,7 +1007,7 @@ decomposition Set output quantization. Coordinates in the output are rounded to 1/value pixels. The default value of 10 usually gives good results. In the case of the gimppath backend, this option is used to set the desired magnification. This option has no effect for the XFig backend, which always rasterizes to 1/1200 inch. - + textLabel4 @@ -1021,7 +1021,7 @@ decomposition Set the curve optimization tolerance. The default value is 0.2. Larger values allow more consecutive Bezier curve segments to be joined together in a single segment, at the expense of accuracy. - + textLabel3 @@ -1035,7 +1035,7 @@ decomposition Set the corner threshold parameter. The default value is 1. The smaller this value, the more sharp corners will be produced. If this parameter is negative, then no smoothing will be performed and the output is a polygon. The largest useful value is 4/3 or 1.334, which suppresses all corners and leads to completely smooth output. - + textLabel2 @@ -1046,7 +1046,7 @@ decomposition Suppress speckles of up to this many pixels - + textLabel1 @@ -1060,7 +1060,7 @@ decomposition - + TabPage @@ -1071,7 +1071,7 @@ decomposition unnamed - + groupBox7 @@ -1092,7 +1092,7 @@ decomposition Expanding - + 80 31 @@ -1109,7 +1109,7 @@ decomposition Expanding - + 80 31 @@ -1154,7 +1154,7 @@ decomposition Expanding - + 80 31 @@ -1195,14 +1195,14 @@ decomposition Expanding - + 80 31 - + textLabel1_3 @@ -1218,7 +1218,7 @@ decomposition cm - + textLabel1_3_2 @@ -1234,7 +1234,7 @@ decomposition cm - + textLabel1_3_4 @@ -1250,7 +1250,7 @@ decomposition degree - + textLabel3_2 @@ -1261,7 +1261,7 @@ decomposition Rotate output by x degrees - + textLabel8 @@ -1272,7 +1272,7 @@ decomposition Aspect ratio (<1 stretched in the x direction, >1 stretched in the y direction) - + textLabel6 @@ -1283,7 +1283,7 @@ decomposition Output image height - + textLabel5 @@ -1296,7 +1296,7 @@ decomposition - + buttonGroup3 @@ -1307,7 +1307,7 @@ decomposition unnamed - + resolutionAllBTN @@ -1324,7 +1324,7 @@ decomposition All dimensions - + textLabel1_2 @@ -1335,7 +1335,7 @@ decomposition X - + textLabel2_2 @@ -1346,7 +1346,7 @@ decomposition Y - + resolutionXYBTN @@ -1405,7 +1405,7 @@ pixels in the input Expanding - + 20 40 @@ -1414,7 +1414,7 @@ pixels in the input - + TabPage @@ -1435,14 +1435,14 @@ pixels in the input Expanding - + 20 270 - + buttonGroup2 @@ -1453,7 +1453,7 @@ pixels in the input unnamed - + textLabel1_3_7 @@ -1502,7 +1502,7 @@ pixels in the input Set output margins - + textLabel1_3_3 @@ -1518,7 +1518,7 @@ pixels in the input cm - + textLabel1_3_5 @@ -1534,7 +1534,7 @@ pixels in the input cm - + textLabel1_3_6 @@ -1579,7 +1579,7 @@ pixels in the input Expanding - + 71 21 @@ -1596,7 +1596,7 @@ pixels in the input Expanding - + 71 21 @@ -1613,7 +1613,7 @@ pixels in the input Expanding - + 71 21 @@ -1630,14 +1630,14 @@ pixels in the input Expanding - + 71 21 - + textLabel13 @@ -1656,7 +1656,7 @@ pixels in the input Top: - + textLabel12 @@ -1675,7 +1675,7 @@ pixels in the input Right: - + textLabel11 @@ -1694,7 +1694,7 @@ pixels in the input Left: - + textLabel14 @@ -1713,7 +1713,7 @@ pixels in the input Bottom: - + checkBoxSyncronizeMargins @@ -1734,7 +1734,7 @@ pixels in the input - + autotracePage @@ -1745,14 +1745,14 @@ pixels in the input unnamed - + autotraceTabs - + tab @@ -1763,7 +1763,7 @@ pixels in the input unnamed - + groupBox11 @@ -1784,7 +1784,7 @@ pixels in the input - + groupBox9 @@ -1795,7 +1795,7 @@ pixels in the input unnamed - + autotraceDpiCheckbox @@ -1809,7 +1809,7 @@ pixels in the input <p>Dot per inch of input image</p><p>(affects scaling in mif output)</p> - + autotraceCheckBoxReduceColors @@ -1859,7 +1859,7 @@ pixels in the input - + groupBox8_2 @@ -1870,7 +1870,7 @@ pixels in the input unnamed - + autotraceUseBackground @@ -1907,7 +1907,7 @@ pixels in the input - + groupBox10 @@ -1921,7 +1921,7 @@ pixels in the input unnamed - + autotraceLog @@ -1950,7 +1950,7 @@ pixels in the input Expanding - + 20 30 @@ -1959,7 +1959,7 @@ pixels in the input - + tab @@ -1970,7 +1970,7 @@ pixels in the input unnamed - + groupBox12 @@ -1981,7 +1981,7 @@ pixels in the input unnamed - + textLabel3_4 @@ -1995,7 +1995,7 @@ pixels in the input <p>Consider any pixel which forms an angle with its predecessor(s) and successor(s) that is smaller than the specified angle (in degrees) as a corner.</p> - + textLabel4_2 @@ -2009,7 +2009,7 @@ pixels in the input <p>Consider any angle at a pixel which falls below the specified angle (in degrees) as a corner, even if it is bordered by other corner pixels.</p> - + textLabel5_3 @@ -2074,7 +2074,7 @@ pixels in the input <p>Consider any pixel which forms an angle with its predecessor(s) and successor(s) that is smaller than the specified angle (in degrees) as a corner.</p> - + autotraceAdjacentCorners @@ -2100,14 +2100,14 @@ pixels in the input Expanding - + 20 20 - + groupBox13 @@ -2154,7 +2154,7 @@ pixels in the input <p>If a spline does not deviate from the straight line defined by its endpoints by more than the specified number of pixels, then treat it as a straight line.</p> - + textLabel7 @@ -2168,7 +2168,7 @@ pixels in the input <p>When a spline is closer to a straight line than the specified real number weighted by the square of the curve length, maintain it as a straight line, even if it is a list with curves.</p> - + textLabel8_2 @@ -2193,7 +2193,7 @@ pixels in the input <p>Subdivide fitted curves that are offset by a number of pixels exceeding the specified real number</p> - + textLabel6_2 @@ -2207,7 +2207,7 @@ pixels in the input <p>Subdivide fitted curves that are offset by a number of pixels exceeding the specified real number</p> - + textLabel1_5 @@ -2221,7 +2221,7 @@ pixels in the input <p>If a spline does not deviate from the straight line defined by its endpoints by more than the specified number of pixels, then treat it as a straight line.</p> - + autotracePreserveWidth @@ -2239,7 +2239,7 @@ pixels in the input - + TabPage @@ -2250,7 +2250,7 @@ pixels in the input unnamed - + buttonGroup5 @@ -2261,7 +2261,7 @@ pixels in the input unnamed - + autotraceNoCenterline @@ -2275,7 +2275,7 @@ pixels in the input true - + autotraceCenterline @@ -2291,7 +2291,7 @@ pixels in the input - + groupBox15 @@ -2302,7 +2302,7 @@ pixels in the input unnamed - + textLabel9 @@ -2342,14 +2342,14 @@ pixels in the input Expanding - + 20 110 - + groupBox16 @@ -2394,7 +2394,7 @@ pixels in the input <p>Employ the specified integer as the value for despeckling(range: 1-20)</p> - + textLabel10 @@ -2408,7 +2408,7 @@ pixels in the input <p>Employ the specified integer as the value for despeckling(range: 1-20)</p> - + textLabel11_2 @@ -2422,7 +2422,7 @@ pixels in the input <p>Employ the specified real number as the value for despeckle tightness (range: 0-8)</p> - + autotraceDoDespeckle @@ -2444,9 +2444,9 @@ pixels in the input - + - layout6 + tqlayout6 @@ -2462,7 +2462,7 @@ pixels in the input Expanding - + 40 20 @@ -2513,7 +2513,7 @@ pixels in the input Expanding - + 40 20 @@ -2532,16 +2532,16 @@ pixels in the input Expanding - + 20 16 - + - layout3 + tqlayout3 @@ -2557,7 +2557,7 @@ pixels in the input Expanding - + 113 20 @@ -2585,7 +2585,7 @@ pixels in the input Expanding - + 60 20 @@ -2605,15 +2605,15 @@ pixels in the input - + - layout2 + tqlayout2 unnamed - + autoTraceCheck @@ -2627,7 +2627,7 @@ pixels in the input true - + preserveCheck @@ -2848,14 +2848,14 @@ pixels in the input preserveCheck imagesTabs - + showOptions( const QString & ) backendChoosen( const QString & ) valueChanged() marginValueChanged( double ) syncronizeMarginsChanged( bool isChecked ) - - + + knuminput.h knuminput.h diff --git a/src/autotraceformats.cpp b/src/autotraceformats.cpp index 4f8ff9c..c394694 100644 --- a/src/autotraceformats.cpp +++ b/src/autotraceformats.cpp @@ -19,9 +19,9 @@ ***************************************************************************/ #include "autotraceformats.h" -AutotraceFormats::AutotraceFormats(QObject *parent, const char *name): QObject(parent, name), allOK(true) { - inputProcess=new QProcess(this); - outputProcess=new QProcess(this); +AutotraceFormats::AutotraceFormats(TQObject *tqparent, const char *name): TQObject(tqparent, name), allOK(true) { + inputProcess=new TQProcess(this); + outputProcess=new TQProcess(this); inputProcess->addArgument("autotrace"); inputProcess->addArgument("--list-input-formats"); @@ -29,8 +29,8 @@ AutotraceFormats::AutotraceFormats(QObject *parent, const char *name): QObject(p outputProcess->addArgument("autotrace"); outputProcess->addArgument("--list-output-formats"); - connect(inputProcess,SIGNAL(readyReadStderr()),this,SLOT(inputRead())); - connect(outputProcess,SIGNAL(readyReadStderr()),this,SLOT(outputRead())); + connect(inputProcess,TQT_SIGNAL(readyReadStderr()),this,TQT_SLOT(inputRead())); + connect(outputProcess,TQT_SIGNAL(readyReadStderr()),this,TQT_SLOT(outputRead())); if(!(inputProcess->start()) || !(outputProcess->start())) { allOK=false; @@ -45,7 +45,7 @@ void AutotraceFormats::inputRead( ) { void AutotraceFormats::outputRead( ) { while(outputProcess->canReadLineStderr()) { - QString tmp=outputProcess->readLineStderr(); + TQString tmp=outputProcess->readLineStderr(); if(!(tmp.startsWith("Supported"))) output+=tmp.stripWhiteSpace(); } @@ -59,11 +59,11 @@ bool AutotraceFormats::done( ) { return (!(inputProcess->isRunning()) && !(outputProcess->isRunning())); } -QStringList AutotraceFormats::inputFormats( ) { +TQStringList AutotraceFormats::inputFormats( ) { return input; } -QStringList AutotraceFormats::outputFormats( ) { +TQStringList AutotraceFormats::outputFormats( ) { return output; } diff --git a/src/autotraceformats.h b/src/autotraceformats.h index 00359d8..aa00e9b 100644 --- a/src/autotraceformats.h +++ b/src/autotraceformats.h @@ -20,34 +20,35 @@ #ifndef AUTOTRACEFORMATS_H #define AUTOTRACEFORMATS_H -#include -#include -#include +#include +#include +#include //! Class to read autotrace input and output formats /** This class executes autotrace to gain informations about the formats it can use * \author Antonio Fasolato */ -class AutotraceFormats : public QObject +class AutotraceFormats : public TQObject { Q_OBJECT + TQ_OBJECT public: - //! Standard QObject-like constructor + //! Standard TQObject-like constructor /** The constructor, nothing fancy - * \param parent The parent of the QObject - * \param name The name of the QObject + * \param tqparent The tqparent of the TQObject + * \param name The name of the TQObject */ - AutotraceFormats(QObject *parent = 0, const char *name = 0); + AutotraceFormats(TQObject *tqparent = 0, const char *name = 0); //!Returns the list of supported input formats /** This class returns the list of formats returned by autotrace -list-input-formats * \return The supported formats */ - QStringList inputFormats(); + TQStringList inputFormats(); //!Returns the list of supported output formats /** This class returns the list of formats returned by autotrace -list-output-formats * \return The supported formats */ - QStringList outputFormats(); + TQStringList outputFormats(); //! Function to test the execution of autotrace /** This functions returns true if the autotrace command could be run succesfully. If it returns * false autotrace executable can not be found in the environment @@ -62,13 +63,13 @@ public: private: //! The process to get input formats - QProcess *inputProcess; + TQProcess *inputProcess; //! The process to get output formats - QProcess *outputProcess; + TQProcess *outputProcess; //! The list of input formats - QStringList input; + TQStringList input; //! The list of output formats - QStringList output; + TQStringList output; //! true if autotrace could be run bool allOK; 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 -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -48,19 +48,19 @@ #include 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 diff --git a/src/mainwidget.h b/src/mainwidget.h index 51f65fc..175e593 100644 --- a/src/mainwidget.h +++ b/src/mainwidget.h @@ -23,13 +23,13 @@ #include "MainWidgetBase.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -48,25 +48,26 @@ class Options; class MainWidget : public MainWidgetBase { Q_OBJECT + TQ_OBJECT //! For simplicity friend class potracegui; public: //! Default constructor (all parameters are simply passed to MainWidgetBase) - MainWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + MainWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); //! Default destructor ~MainWidget(); private: //! Contains the temporary file name used while tracing - QString m_tmpFilename; + TQString m_tmpFilename; //! Contains the input file name for autotrace - QString m_tmpInputFilename; + TQString m_tmpInputFilename; //! Contains the real file name where to save the traced image - QString m_outputFilename; + TQString m_outputFilename; //! The process of potrace (used to abort it and to control its exit status) - QProcess tracer; + TQProcess tracer; //! To know if the tracing has exited normally, or it has been interrupted bool aborted; //! To know if the current document is different from the saved one @@ -74,15 +75,15 @@ private: //! The history of the options (not used yet, it will permit undo/redo in the future) vector m_state; //! The history of the previews (not used yet, it will permit undo/redo in the future) - vector m_oldPreviews; + vector m_oldPreviews; //! The current options vector::iterator m_currentState; //! The current preview image - vector::iterator m_currentPreview; + vector::iterator m_currentPreview; //! Label to display the original image - QLabel *originalLabel; + TQLabel *originalLabel; //! Label to display the traced image - QLabel *previewLabel; + TQLabel *previewLabel; //! Retrives an image from an URL /*! @@ -115,21 +116,21 @@ private: //! Creates the command line for tracing /*! * It reads m_currentState and creates from all the options a commandline to be executed - * \returns A QStringList that can be used as a commandline to a QProcess + * \returns A TQStringList that can be used as a commandline to a TQProcess */ - QStringList createCommandLine(); + TQStringList createCommandLine(); //! Creates the command line for tracing with potrace /*! * It reads m_currentState and creates from all the options a commandline to be executed - * \returns A QStringList that can be used as a commandline to a QProcess + * \returns A TQStringList that can be used as a commandline to a TQProcess */ - QStringList createPotraceCommandLine(); + TQStringList createPotraceCommandLine(); //! Creates the command line for tracing with autotrace /*! * It reads m_currentState and creates from all the options a commandline to be executed - * \returns A QStringList that can be used as a commandline to a QProcess + * \returns A TQStringList that can be used as a commandline to a TQProcess */ - QStringList createAutotraceCommandLine(); + TQStringList createAutotraceCommandLine(); //! Sets m_tmpFilename to a new temporary filename (generated through mkstemp()) bool createTmpFilename(); //! Deletes the file pointed by m_tmpFilename @@ -140,14 +141,14 @@ private: * \param text The text to display into the dialog * \returns The code of the dialog button pressed. */ - int notificationDialog(QString caption, QString text); + int notificationDialog(TQString caption, TQString text); //! Accepts only a KURL - void dragEnterEvent(QDragEnterEvent* event); + void dragEnterEvent(TQDragEnterEvent* event); //! Receives a KURL and loads it. /*! * \sa getImageFromURL() */ - void dropEvent(QDropEvent* event); + void dropEvent(TQDropEvent* event); private slots: //! Opens a file (whith a KFileDialog) @@ -179,9 +180,9 @@ private slots: //! Reverts to the default options void defaultOptions(); //! When an output format for potrace has been selected, it shows the relevant options - void showOptions(const QString &selection); + void showOptions(const TQString &selection); //! When a backend has been selected, it shows the relevant options - void backendChoosen(const QString &back); + void backendChoosen(const TQString &back); //! Syncronize margins if corresponding checkbox is checked void marginValueChanged( double newValue); @@ -191,7 +192,7 @@ signals: /*! * \param message The message to display into the statusbar */ - void signalChangeStatusbar(QString message); + void signalChangeStatusbar(TQString message); protected: bool marginValueSynconizingNecessary; }; diff --git a/src/options.cpp b/src/options.cpp index e3aaa71..6945c11 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -13,16 +13,16 @@ #include using namespace std; -#include +#include Options::Options(): options() { } -void Options::setValue(QString key, QString value) { +void Options::setValue(TQString key, TQString value) { if(options.find(key)!=options.end()) options.erase(options.find(key)); - map::value_type v(key,value); + map::value_type v(key,value); options.insert(v); } @@ -34,7 +34,7 @@ void Options::clear() { options.clear(); } -QString Options::operator[](QString key) { +TQString Options::operator[](TQString key) { if(options.find(key)!=options.end()) return options[key]; else @@ -80,7 +80,7 @@ void Options::defaultOptions(){ } void Options::debug() { - for(map::iterator i=options.begin(); i!=options.end(); i++) + for(map::iterator i=options.begin(); i!=options.end(); i++) cout << (*i).first << "=" << (*i).second << endl; } diff --git a/src/options.h b/src/options.h index 3ab53c0..0caa9ef 100644 --- a/src/options.h +++ b/src/options.h @@ -13,7 +13,7 @@ #include using namespace std; -#include +#include //! Class that contains all the options for a document. @@ -38,7 +38,7 @@ public: * * \sa operator[]() */ - void setValue(QString key, QString value); + void setValue(TQString key, TQString value); //! Checks if the object contains no keys /*! * \returns \b true if the object is empty, \b false otherwise @@ -53,14 +53,14 @@ public: * \returns The value associated with the key * \sa setValue() */ - QString operator[](QString key); + TQString operator[](TQString key); //! Sets all the options to their default value. void defaultOptions(); //! Prints the list of options void debug(); private: - map options; /*!< The map containing the options */ + map options; /*!< The map containing the options */ }; #endif diff --git a/src/potracegui.cpp b/src/potracegui.cpp index 70168b2..815bbb7 100644 --- a/src/potracegui.cpp +++ b/src/potracegui.cpp @@ -21,8 +21,8 @@ #include "potracegui.h" #include "mainwidget.h" -#include -#include +#include +#include #include #include @@ -55,7 +55,7 @@ potracegui::potracegui() setAutoSaveSettings(); setAcceptDrops(true); - connect(m_centralWidget,SIGNAL(signalChangeStatusbar(QString)),this,SLOT(changeStatusbar(QString))); + connect(m_centralWidget,TQT_SIGNAL(signalChangeStatusbar(TQString)),this,TQT_SLOT(changeStatusbar(TQString))); createInterface(); } @@ -67,21 +67,21 @@ potracegui::~potracegui() void potracegui::createInterface() { /*handled by potracegui*/ - KStdAction::openNew(this, SLOT(fileNew()),actionCollection()); - KStdAction::quit(this, SLOT(quit()),actionCollection()); - m_toolbarAction=KStdAction::showToolbar(this, SLOT(showToolbar()),actionCollection()); - m_statusbarAction=KStdAction::showStatusbar(this, SLOT(showStatusbar()),actionCollection()); - KStdAction::keyBindings(this, SLOT(configureKeys()),actionCollection()); - KStdAction::configureToolbars(this, SLOT(configureTB()),actionCollection()); + KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()),actionCollection()); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quit()),actionCollection()); + m_toolbarAction=KStdAction::showToolbar(TQT_TQOBJECT(this), TQT_SLOT(showToolbar()),actionCollection()); + m_statusbarAction=KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(showStatusbar()),actionCollection()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configureKeys()),actionCollection()); + KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configureTB()),actionCollection()); /*handled by MainWidget*/ - KStdAction::open(m_centralWidget, SLOT(fileOpen()),actionCollection()); - KStdAction::save(m_centralWidget, SLOT(fileSave()),actionCollection()); - KStdAction::saveAs(m_centralWidget, SLOT(fileSaveAs()),actionCollection()); - KStdAction::close(m_centralWidget, SLOT(fileClose()),actionCollection()); - KStdAction::cut(m_centralWidget, SLOT(cut()),actionCollection()); - KStdAction::copy(m_centralWidget, SLOT(copy()),actionCollection()); - KStdAction::paste(m_centralWidget, SLOT(paste()),actionCollection()); + KStdAction::open(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileOpen()),actionCollection()); + KStdAction::save(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileSave()),actionCollection()); + KStdAction::saveAs(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileSaveAs()),actionCollection()); + KStdAction::close(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileClose()),actionCollection()); + KStdAction::cut(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(cut()),actionCollection()); + KStdAction::copy(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(copy()),actionCollection()); + KStdAction::paste(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(paste()),actionCollection()); /*Create menu and toolbar*/ createGUI(); @@ -123,7 +123,7 @@ void potracegui::configureKeys() void potracegui::configureTB() { KEditToolbar dlg(actionCollection()); - connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(NewTBConfig())); + connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(NewTBConfig())); dlg.exec(); } @@ -133,7 +133,7 @@ void potracegui::NewTBConfig() saveMainWindowSettings(KGlobal::config()); } -void potracegui::changeStatusbar(QString message) +void potracegui::changeStatusbar(TQString message) { statusBar()->message(message); } diff --git a/src/potracegui.h b/src/potracegui.h index ab0aeaa..5a0a1f8 100644 --- a/src/potracegui.h +++ b/src/potracegui.h @@ -28,7 +28,7 @@ #include #include -#include +#include class KToggleAction; class MainWidget; @@ -43,6 +43,7 @@ class MainWidget; class potracegui : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** * @short Default Constructor @@ -92,7 +93,7 @@ private slots: /*! * \param message The message to show */ - void changeStatusbar(QString message); + void changeStatusbar(TQString message); }; #endif // _POTRACEGUI_H_ -- cgit v1.2.1