diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-20 02:53:53 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-20 02:53:53 +0000 |
commit | d31c5384fafd8be1afb5eae8d150aa03e1180555 (patch) | |
tree | aca870c79d6146f309a4120474f126fb75ebaa87 /digikam/utilities/imageeditor/tools/imageresize.cpp | |
parent | 9be3ae63454c07422eeeef84a1921e40583d6354 (diff) | |
download | digikam-d31c5384fafd8be1afb5eae8d150aa03e1180555.tar.gz digikam-d31c5384fafd8be1afb5eae8d150aa03e1180555.zip |
TQt4 port Digikam
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/digikam@1232832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'digikam/utilities/imageeditor/tools/imageresize.cpp')
-rw-r--r-- | digikam/utilities/imageeditor/tools/imageresize.cpp | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/digikam/utilities/imageeditor/tools/imageresize.cpp b/digikam/utilities/imageeditor/tools/imageresize.cpp index 57ccc72..12f4e54 100644 --- a/digikam/utilities/imageeditor/tools/imageresize.cpp +++ b/digikam/utilities/imageeditor/tools/imageresize.cpp @@ -25,24 +25,24 @@ #include <cmath> -// Qt includes. - -#include <qvgroupbox.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qframe.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qtabwidget.h> -#include <qtimer.h> -#include <qevent.h> -#include <qpixmap.h> -#include <qbrush.h> -#include <qfile.h> -#include <qimage.h> +// TQt includes. + +#include <tqvgroupbox.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqframe.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqtabwidget.h> +#include <tqtimer.h> +#include <tqevent.h> +#include <tqpixmap.h> +#include <tqbrush.h> +#include <tqfile.h> +#include <tqimage.h> // KDE includes. @@ -96,7 +96,7 @@ public: ImageResizePriv() { currentRenderingMode = NoneRendering; - parent = 0; + tqparent = 0; preserveRatioBox = 0; useGreycstorationBox = 0; mainTab = 0; @@ -120,14 +120,14 @@ public: double prevWP; double prevHP; - QWidget *parent; + TQWidget *tqparent; - QLabel *restorationTips; + TQLabel *restorationTips; - QCheckBox *preserveRatioBox; - QCheckBox *useGreycstorationBox; + TQCheckBox *preserveRatioBox; + TQCheckBox *useGreycstorationBox; - QTabWidget *mainTab; + TQTabWidget *mainTab; RIntNumInput *wInput; RIntNumInput *hInput; @@ -143,18 +143,18 @@ public: GreycstorationWidget *settingsWidget; }; -ImageResize::ImageResize(QWidget* parent) +ImageResize::ImageResize(TQWidget* tqparent) : KDialogBase(Plain, i18n("Resize Image"), Help|Default|User2|User3|Ok|Cancel, Ok, - parent, 0, true, false, - QString(), + tqparent, 0, true, false, + TQString(), i18n("&Save As..."), i18n("&Load...")) { d = new ImageResizePriv; - d->parent = parent; + d->tqparent = tqparent; setHelp("resizetool.anchor", "digikam"); - QString whatsThis; + TQString whatsThis; setButtonWhatsThis( Default, i18n("<p>Reset all filter parameters to their default values.") ); setButtonWhatsThis( User3, i18n("<p>Load all filter parameters from settings text file.") ); setButtonWhatsThis( User2, i18n("<p>Save all filter parameters to settings text file.") ); @@ -170,65 +170,65 @@ ImageResize::ImageResize(QWidget* parent) // ------------------------------------------------------------- - QVBoxLayout *vlay = new QVBoxLayout(plainPage(), 0, spacingHint()); - d->mainTab = new QTabWidget( plainPage() ); + TQVBoxLayout *vlay = new TQVBoxLayout(plainPage(), 0, spacingHint()); + d->mainTab = new TQTabWidget( plainPage() ); - QWidget* firstPage = new QWidget( d->mainTab ); - QGridLayout* grid = new QGridLayout( firstPage, 8, 2, spacingHint()); + TQWidget* firstPage = new TQWidget( d->mainTab ); + TQGridLayout* grid = new TQGridLayout( firstPage, 8, 2, spacingHint()); d->mainTab->addTab( firstPage, i18n("New Size") ); - QLabel *label1 = new QLabel(i18n("Width:"), firstPage); + TQLabel *label1 = new TQLabel(i18n("Width:"), firstPage); d->wInput = new RIntNumInput(firstPage); - d->wInput->setRange(1, QMAX(d->orgWidth * 10, 9999), 1); + d->wInput->setRange(1, TQMAX(d->orgWidth * 10, 9999), 1); d->wInput->setName("d->wInput"); d->wInput->setDefaultValue(d->orgWidth); - QWhatsThis::add( d->wInput, i18n("<p>Set here the new image width in pixels.")); + TQWhatsThis::add( d->wInput, i18n("<p>Set here the new image width in pixels.")); - QLabel *label2 = new QLabel(i18n("Height:"), firstPage); + TQLabel *label2 = new TQLabel(i18n("Height:"), firstPage); d->hInput = new RIntNumInput(firstPage); - d->hInput->setRange(1, QMAX(d->orgHeight * 10, 9999), 1); + d->hInput->setRange(1, TQMAX(d->orgHeight * 10, 9999), 1); d->hInput->setName("d->hInput"); d->hInput->setDefaultValue(d->orgHeight); - QWhatsThis::add( d->hInput, i18n("<p>Set here the new image height in pixels.")); + TQWhatsThis::add( d->hInput, i18n("<p>Set here the new image height in pixels.")); - QLabel *label3 = new QLabel(i18n("Width (%):"), firstPage); + TQLabel *label3 = new TQLabel(i18n("Width (%):"), firstPage); d->wpInput = new RDoubleNumInput(firstPage); d->wpInput->setRange(1.0, 999.0, 1.0); d->wpInput->setName("d->wpInput"); d->wpInput->setDefaultValue(100.0); - QWhatsThis::add( d->wpInput, i18n("<p>Set here the new image width in percent.")); + TQWhatsThis::add( d->wpInput, i18n("<p>Set here the new image width in percent.")); - QLabel *label4 = new QLabel(i18n("Height (%):"), firstPage); + TQLabel *label4 = new TQLabel(i18n("Height (%):"), firstPage); d->hpInput = new RDoubleNumInput(firstPage); d->hpInput->setRange(1.0, 999.0, 1.0); d->hpInput->setName("d->hpInput"); d->hpInput->setDefaultValue(100.0); - QWhatsThis::add( d->hpInput, i18n("<p>Set here the new image height in percent.")); + TQWhatsThis::add( d->hpInput, i18n("<p>Set here the new image height in percent.")); - d->preserveRatioBox = new QCheckBox(i18n("Maintain aspect ratio"), firstPage); - QWhatsThis::add( d->preserveRatioBox, i18n("<p>Enable this option to maintain aspect " + d->preserveRatioBox = new TQCheckBox(i18n("Maintain aspect ratio"), firstPage); + TQWhatsThis::add( d->preserveRatioBox, i18n("<p>Enable this option to maintain aspect " "ratio with new image sizes.")); d->cimgLogoLabel = new KURLLabel(firstPage); - d->cimgLogoLabel->setText(QString()); + d->cimgLogoLabel->setText(TQString()); d->cimgLogoLabel->setURL("http://cimg.sourceforge.net"); KGlobal::dirs()->addResourceType("logo-cimg", KGlobal::dirs()->kde_default("data") + "digikam/data"); - QString directory = KGlobal::dirs()->findResourceDir("logo-cimg", "logo-cimg.png"); - d->cimgLogoLabel->setPixmap( QPixmap( directory + "logo-cimg.png" ) ); - QToolTip::add(d->cimgLogoLabel, i18n("Visit CImg library website")); + TQString directory = KGlobal::dirs()->findResourceDir("logo-cimg", "logo-cimg.png"); + d->cimgLogoLabel->setPixmap( TQPixmap( directory + "logo-cimg.png" ) ); + TQToolTip::add(d->cimgLogoLabel, i18n("Visit CImg library website")); - d->useGreycstorationBox = new QCheckBox(i18n("Restore photograph"), firstPage); - QWhatsThis::add( d->useGreycstorationBox, i18n("<p>Enable this option to restore photograph content. " + d->useGreycstorationBox = new TQCheckBox(i18n("Restore photograph"), firstPage); + TQWhatsThis::add( d->useGreycstorationBox, i18n("<p>Enable this option to restore photograph content. " "This way is usefull to scale-up an image to an huge size. " "Warning: this process can take a while.")); - d->restorationTips = new QLabel(i18n("<b>Note: use Restoration Mode to only scale-up an image to huge size. " + d->restorationTips = new TQLabel(i18n("<b>Note: use Restoration Mode to only scale-up an image to huge size. " "Warning, this process can take a while.</b>"), firstPage); d->progressBar = new KProgress(100, firstPage); d->progressBar->setValue(0); - QWhatsThis::add(d->progressBar, i18n("<p>This shows the current progress when you use Restoration mode.")); + TQWhatsThis::add(d->progressBar, i18n("<p>This shows the current progress when you use Restoration mode.")); grid->addMultiCellWidget(d->preserveRatioBox, 0, 0, 0, 2); grid->addMultiCellWidget(label1, 1, 1, 0, 0); @@ -255,27 +255,27 @@ ImageResize::ImageResize(QWidget* parent) adjustSize(); disableResize(); - QTimer::singleShot(0, this, SLOT(readUserSettings())); + TQTimer::singleShot(0, this, TQT_SLOT(readUserSettings())); // ------------------------------------------------------------- - connect(d->cimgLogoLabel, SIGNAL(leftClickedURL(const QString&)), - this, SLOT(processCImgURL(const QString&))); + connect(d->cimgLogoLabel, TQT_SIGNAL(leftClickedURL(const TQString&)), + this, TQT_SLOT(processCImgURL(const TQString&))); - connect(d->wInput, SIGNAL(valueChanged(int)), - this, SLOT(slotValuesChanged())); + connect(d->wInput, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotValuesChanged())); - connect(d->hInput, SIGNAL(valueChanged(int)), - this, SLOT(slotValuesChanged())); + connect(d->hInput, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotValuesChanged())); - connect(d->wpInput, SIGNAL(valueChanged(double)), - this, SLOT(slotValuesChanged())); + connect(d->wpInput, TQT_SIGNAL(valueChanged(double)), + this, TQT_SLOT(slotValuesChanged())); - connect(d->hpInput, SIGNAL(valueChanged(double)), - this, SLOT(slotValuesChanged())); + connect(d->hpInput, TQT_SIGNAL(valueChanged(double)), + this, TQT_SLOT(slotValuesChanged())); - connect(d->useGreycstorationBox, SIGNAL(toggled(bool)), - this, SLOT(slotRestorationToggled(bool)) ); + connect(d->useGreycstorationBox, TQT_SIGNAL(toggled(bool)), + this, TQT_SLOT(slotRestorationToggled(bool)) ); // ------------------------------------------------------------- @@ -403,7 +403,7 @@ void ImageResize::slotValuesChanged() d->wpInput->blockSignals(true); d->hpInput->blockSignals(true); - QString s(sender()->name()); + TQString s(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name()); if (s == "d->wInput") { @@ -474,23 +474,23 @@ void ImageResize::slotCancel() if (d->currentRenderingMode != ImageResizePriv::NoneRendering) { d->greycstorationIface->stopComputation(); - d->parent->unsetCursor(); + d->tqparent->unsetCursor(); } done(Cancel); } -void ImageResize::processCImgURL(const QString& url) +void ImageResize::processCImgURL(const TQString& url) { KApplication::kApplication()->invokeBrowser(url); } -void ImageResize::closeEvent(QCloseEvent *e) +void ImageResize::closeEvent(TQCloseEvent *e) { if (d->currentRenderingMode != ImageResizePriv::NoneRendering) { d->greycstorationIface->stopComputation(); - d->parent->unsetCursor(); + d->tqparent->unsetCursor(); } e->accept(); @@ -516,7 +516,7 @@ void ImageResize::slotOk() enableButton(User2, false); enableButton(User3, false); - d->parent->setCursor( KCursor::waitCursor() ); + d->tqparent->setCursor( KCursor::waitCursor() ); writeUserSettings(); ImageIface iface(0, 0); uchar *data = iface.getOriginalImage(); @@ -540,7 +540,7 @@ void ImageResize::slotOk() GreycstorationIface::Resize, d->wInput->value(), d->hInput->value(), - 0, this); + 0, TQT_TQOBJECT(this)); } else { @@ -550,12 +550,12 @@ void ImageResize::slotOk() image.resize(d->wInput->value(), d->hInput->value()); iface.putOriginalImage(i18n("Resize"), image.bits(), image.width(), image.height()); - d->parent->unsetCursor(); + d->tqparent->unsetCursor(); accept(); } } -void ImageResize::customEvent(QCustomEvent *event) +void ImageResize::customEvent(TQCustomEvent *event) { if (!event) return; @@ -582,7 +582,7 @@ void ImageResize::customEvent(QCustomEvent *event) iface.putOriginalImage(i18n("Resize"), resizedImage.bits(), resizedImage.width(), resizedImage.height()); - d->parent->unsetCursor(); + d->tqparent->unsetCursor(); accept(); break; } @@ -604,20 +604,20 @@ void ImageResize::customEvent(QCustomEvent *event) void ImageResize::slotUser3() { KURL loadBlowupFile = KFileDialog::getOpenURL(KGlobalSettings::documentPath(), - QString( "*" ), this, - QString( i18n("Photograph Resizing Settings File to Load")) ); + TQString( "*" ), this, + TQString( i18n("Photograph Resizing Settings File to Load")) ); if( loadBlowupFile.isEmpty() ) return; - QFile file(loadBlowupFile.path()); + TQFile file(loadBlowupFile.path()); if ( file.open(IO_ReadOnly) ) { - if (!d->settingsWidget->loadSettings(file, QString("# Photograph Resizing Configuration File"))) + if (!d->settingsWidget->loadSettings(file, TQString("# Photograph Resizing Configuration File"))) { KMessageBox::error(this, i18n("\"%1\" is not a Photograph Resizing settings text file.") - .arg(loadBlowupFile.fileName())); + .tqarg(loadBlowupFile.fileName())); file.close(); return; } @@ -631,15 +631,15 @@ void ImageResize::slotUser3() void ImageResize::slotUser2() { KURL saveBlowupFile = KFileDialog::getSaveURL(KGlobalSettings::documentPath(), - QString( "*" ), this, - QString( i18n("Photograph Resizing Settings File to Save")) ); + TQString( "*" ), this, + TQString( i18n("Photograph Resizing Settings File to Save")) ); if( saveBlowupFile.isEmpty() ) return; - QFile file(saveBlowupFile.path()); + TQFile file(saveBlowupFile.path()); if ( file.open(IO_WriteOnly) ) - d->settingsWidget->saveSettings(file, QString("# Photograph Resizing Configuration File")); + d->settingsWidget->saveSettings(file, TQString("# Photograph Resizing Configuration File")); else KMessageBox::error(this, i18n("Cannot save settings to the Photograph Resizing text file.")); |