diff options
Diffstat (limited to 'digikam/libs/widgets/imageplugins/imagepannelwidget.cpp')
-rw-r--r-- | digikam/libs/widgets/imageplugins/imagepannelwidget.cpp | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/digikam/libs/widgets/imageplugins/imagepannelwidget.cpp b/digikam/libs/widgets/imageplugins/imagepannelwidget.cpp index f45e61a..c29681f 100644 --- a/digikam/libs/widgets/imageplugins/imagepannelwidget.cpp +++ b/digikam/libs/widgets/imageplugins/imagepannelwidget.cpp @@ -21,19 +21,19 @@ * * ============================================================ */ -// Qt includes. - -#include <qframe.h> -#include <qvgroupbox.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qtimer.h> -#include <qhbuttongroup.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qpixmap.h> +// TQt includes. + +#include <tqframe.h> +#include <tqvgroupbox.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqtimer.h> +#include <tqhbuttongroup.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqpixmap.h> // KDE includes. @@ -80,18 +80,18 @@ public: zoomBar = 0; } - QGridLayout *mainLayout; + TQGridLayout *mainLayout; - QHButtonGroup *separateView; + TQHButtonGroup *separateView; - QString settingsSection; + TQString settingsSection; - QWidget *settings; - QWidget *previewWidget; + TQWidget *settings; + TQWidget *previewWidget; - QVBoxLayout *settingsLayout; + TQVBoxLayout *settingsLayout; - QSplitter *splitter; + TQSplitter *splitter; KProgress *progressBar; @@ -103,71 +103,71 @@ public: StatusZoomBar *zoomBar; }; -ImagePannelWidget::ImagePannelWidget(uint w, uint h, const QString& settingsSection, - QWidget *parent, int separateViewMode) - : QHBox(parent, 0, Qt::WDestructiveClose) +ImagePannelWidget::ImagePannelWidget(uint w, uint h, const TQString& settingsSection, + TQWidget *tqparent, int separateViewMode) + : TQHBox(tqparent, 0, TQt::WDestructiveClose) { d = new ImagePannelWidgetPriv; d->settingsSection = settingsSection; - d->splitter = new QSplitter(this); - d->previewWidget = new QWidget(d->splitter); - d->mainLayout = new QGridLayout( d->previewWidget, 2, 3, 0, KDialog::spacingHint()); + d->splitter = new TQSplitter(this); + d->previewWidget = new TQWidget(d->splitter); + d->mainLayout = new TQGridLayout( d->previewWidget, 2, 3, 0, KDialog::spacingHint()); - d->splitter->setFrameStyle( QFrame::NoFrame ); - d->splitter->setFrameShadow( QFrame::Plain ); - d->splitter->setFrameShape( QFrame::NoFrame ); + d->splitter->setFrameStyle( TQFrame::NoFrame ); + d->splitter->setFrameShadow( TQFrame::Plain ); + d->splitter->setFrameShape( TQFrame::NoFrame ); d->splitter->setOpaqueResize(false); // ------------------------------------------------------------- - QFrame *preview = new QFrame(d->previewWidget); - QVBoxLayout* l1 = new QVBoxLayout(preview, 5, 0); + TQFrame *preview = new TQFrame(d->previewWidget); + TQVBoxLayout* l1 = new TQVBoxLayout(preview, 5, 0); d->imageRegionWidget = new ImageRegionWidget(w, h, preview, false); - d->imageRegionWidget->setFrameStyle(QFrame::NoFrame); - preview->setFrameStyle(QFrame::Panel|QFrame::Sunken); - QWhatsThis::add( d->imageRegionWidget, i18n("<p>Here you can see the original clip image " + d->imageRegionWidget->setFrameStyle(TQFrame::NoFrame); + preview->setFrameStyle(TQFrame::Panel|TQFrame::Sunken); + TQWhatsThis::add( d->imageRegionWidget, i18n("<p>Here you can see the original clip image " "which will be used for the preview computation." "<p>Click and drag the mouse cursor in the " "image to change the clip focus.")); l1->addWidget(d->imageRegionWidget, 0); - QSizePolicy rightSzPolicy(QSizePolicy::Preferred, QSizePolicy::Expanding, 2, 1); - d->previewWidget->setSizePolicy(rightSzPolicy); + TQSizePolicy rightSzPolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding, 2, 1); + d->previewWidget->tqsetSizePolicy(rightSzPolicy); // ------------------------------------------------------------- d->zoomBar = new StatusZoomBar(d->previewWidget); - QWhatsThis::add( d->zoomBar, i18n("<p>Here set the zoom factor of the preview area.") ); + TQWhatsThis::add( d->zoomBar, i18n("<p>Here set the zoom factor of the preview area.") ); // ------------------------------------------------------------- - QString directory; - d->separateView = new QHButtonGroup(d->previewWidget); + TQString directory; + d->separateView = new TQHButtonGroup(d->previewWidget); d->separateView->setExclusive(true); d->separateView->setInsideMargin( 0 ); - d->separateView->setFrameShape(QFrame::NoFrame); + d->separateView->setFrameShape(TQFrame::NoFrame); if (separateViewMode == SeparateViewDuplicate || separateViewMode == SeparateViewAll) { - QPushButton *duplicateHorButton = new QPushButton( d->separateView ); + TQPushButton *duplicateHorButton = new TQPushButton( d->separateView ); d->separateView->insert(duplicateHorButton, ImageRegionWidget::SeparateViewDuplicateHorz); KGlobal::dirs()->addResourceType("duplicatebothhorz", KGlobal::dirs()->kde_default("data") + "digikam/data"); directory = KGlobal::dirs()->findResourceDir("duplicatebothhorz", "duplicatebothhorz.png"); - duplicateHorButton->setPixmap( QPixmap( directory + "duplicatebothhorz.png" ) ); + duplicateHorButton->setPixmap( TQPixmap( directory + "duplicatebothhorz.png" ) ); duplicateHorButton->setToggleButton(true); - QWhatsThis::add( duplicateHorButton, i18n("<p>If you enable this option, you will separate the preview area " + TQWhatsThis::add( duplicateHorButton, i18n("<p>If you enable this option, you will separate the preview area " "horizontally, displaying the original and target image " "at the same time. The target is duplicated from the original " "below the red dashed line." ) ); - QPushButton *duplicateVerButton = new QPushButton( d->separateView ); + TQPushButton *duplicateVerButton = new TQPushButton( d->separateView ); d->separateView->insert(duplicateVerButton, ImageRegionWidget::SeparateViewDuplicateVert); KGlobal::dirs()->addResourceType("duplicatebothvert", KGlobal::dirs()->kde_default("data") + "digikam/data"); directory = KGlobal::dirs()->findResourceDir("duplicatebothvert", "duplicatebothvert.png"); - duplicateVerButton->setPixmap( QPixmap( directory + "duplicatebothvert.png" ) ); + duplicateVerButton->setPixmap( TQPixmap( directory + "duplicatebothvert.png" ) ); duplicateVerButton->setToggleButton(true); - QWhatsThis::add( duplicateVerButton, i18n("<p>If you enable this option, you will separate the preview area " + TQWhatsThis::add( duplicateVerButton, i18n("<p>If you enable this option, you will separate the preview area " "vertically, displaying the original and target image " "at the same time. The target is duplicated from the original to " "the right of the red dashed line." ) ); @@ -176,42 +176,42 @@ ImagePannelWidget::ImagePannelWidget(uint w, uint h, const QString& settingsSect if (separateViewMode == SeparateViewNormal || separateViewMode == SeparateViewAll) { - QPushButton *separateHorButton = new QPushButton( d->separateView ); + TQPushButton *separateHorButton = new TQPushButton( d->separateView ); d->separateView->insert(separateHorButton, ImageRegionWidget::SeparateViewHorizontal); KGlobal::dirs()->addResourceType("bothhorz", KGlobal::dirs()->kde_default("data") + "digikam/data"); directory = KGlobal::dirs()->findResourceDir("bothhorz", "bothhorz.png"); - separateHorButton->setPixmap( QPixmap( directory + "bothhorz.png" ) ); + separateHorButton->setPixmap( TQPixmap( directory + "bothhorz.png" ) ); separateHorButton->setToggleButton(true); - QWhatsThis::add( separateHorButton, i18n( "<p>If you enable this option, you will separate the preview area " + TQWhatsThis::add( separateHorButton, i18n( "<p>If you enable this option, you will separate the preview area " "horizontally, displaying the original and target image " "at the same time. The original is above the " "red dashed line, the target below it." ) ); - QPushButton *separateVerButton = new QPushButton( d->separateView ); + TQPushButton *separateVerButton = new TQPushButton( d->separateView ); d->separateView->insert(separateVerButton, ImageRegionWidget::SeparateViewVertical); KGlobal::dirs()->addResourceType("bothvert", KGlobal::dirs()->kde_default("data") + "digikam/data"); directory = KGlobal::dirs()->findResourceDir("bothvert", "bothvert.png"); - separateVerButton->setPixmap( QPixmap( directory + "bothvert.png" ) ); + separateVerButton->setPixmap( TQPixmap( directory + "bothvert.png" ) ); separateVerButton->setToggleButton(true); - QWhatsThis::add( separateVerButton, i18n( "<p>If you enable this option, you will separate the preview area " + TQWhatsThis::add( separateVerButton, i18n( "<p>If you enable this option, you will separate the preview area " "vertically, displaying the original and target image " "at the same time. The original is to the left of the " "red dashed line, the target to the right of it." ) ); } - QPushButton *noSeparateButton = new QPushButton( d->separateView ); + TQPushButton *noSeparateButton = new TQPushButton( d->separateView ); d->separateView->insert(noSeparateButton, ImageRegionWidget::SeparateViewNone); KGlobal::dirs()->addResourceType("target", KGlobal::dirs()->kde_default("data") + "digikam/data"); directory = KGlobal::dirs()->findResourceDir("target", "target.png"); - noSeparateButton->setPixmap( QPixmap( directory + "target.png" ) ); + noSeparateButton->setPixmap( TQPixmap( directory + "target.png" ) ); noSeparateButton->setToggleButton(true); - QWhatsThis::add( noSeparateButton, i18n( "<p>If you enable this option, the preview area will not " + TQWhatsThis::add( noSeparateButton, i18n( "<p>If you enable this option, the preview area will not " "be separated." ) ); // ------------------------------------------------------------- d->progressBar = new KProgress(100, d->previewWidget); - QWhatsThis::add(d->progressBar ,i18n("<p>This is the percentage of the task which has been completed up to this point.")); + TQWhatsThis::add(d->progressBar ,i18n("<p>This is the percentage of the task which has been completed up to this point.")); d->progressBar->setProgress(0); d->progressBar->setMaximumHeight( fontMetrics().height() ); @@ -227,24 +227,24 @@ ImagePannelWidget::ImagePannelWidget(uint w, uint h, const QString& settingsSect // ------------------------------------------------------------- - QString sbName(d->settingsSection + QString(" Image Plugin Sidebar")); + TQString sbName(d->settingsSection + TQString(" Image Plugin Sidebar")); d->settingsSideBar = new Sidebar(this, sbName.ascii(), Sidebar::Right); d->settingsSideBar->setSplitter(d->splitter); - d->settings = new QWidget(d->settingsSideBar); - d->settingsLayout = new QVBoxLayout(d->settings); + d->settings = new TQWidget(d->settingsSideBar); + d->settingsLayout = new TQVBoxLayout(d->settings); - QFrame *frame3 = new QFrame(d->settings); - frame3->setFrameStyle(QFrame::Panel|QFrame::Sunken); - QVBoxLayout* l3 = new QVBoxLayout(frame3, 5, 0); + TQFrame *frame3 = new TQFrame(d->settings); + frame3->setFrameStyle(TQFrame::Panel|TQFrame::Sunken); + TQVBoxLayout* l3 = new TQVBoxLayout(frame3, 5, 0); d->imagePanIconWidget = new ImagePanIconWidget(360, 240, frame3); - QWhatsThis::add( d->imagePanIconWidget, i18n("<p>Here you can see the original image panel " + TQWhatsThis::add( d->imagePanIconWidget, i18n("<p>Here you can see the original image panel " "which can help you to select the clip preview." "<p>Click and drag the mouse cursor in the " "red rectangle to change the clip focus.")); - l3->addWidget(d->imagePanIconWidget, 0, Qt::AlignCenter); + l3->addWidget(d->imagePanIconWidget, 0, TQt::AlignCenter); - d->settingsLayout->addWidget(frame3, 0, Qt::AlignHCenter); + d->settingsLayout->addWidget(frame3, 0, TQt::AlignHCenter); d->settingsLayout->addSpacing(KDialog::spacingHint()); d->settingsSideBar->appendTab(d->settings, SmallIcon("configure"), i18n("Settings")); @@ -253,33 +253,33 @@ ImagePannelWidget::ImagePannelWidget(uint w, uint h, const QString& settingsSect // ------------------------------------------------------------- setProgressVisible(false); - QTimer::singleShot(0, this, SLOT(slotInitGui())); + TQTimer::singleShot(0, this, TQT_SLOT(slotInitGui())); // ------------------------------------------------------------- - connect(d->imageRegionWidget, SIGNAL(signalContentsMovedEvent(bool)), - this, SLOT(slotOriginalImageRegionChanged(bool))); + connect(d->imageRegionWidget, TQT_SIGNAL(signalContentsMovedEvent(bool)), + this, TQT_SLOT(slotOriginalImageRegionChanged(bool))); - connect(d->imagePanIconWidget, SIGNAL(signalSelectionMoved(const QRect&, bool)), - this, SLOT(slotSetImageRegionPosition(const QRect&, bool))); + connect(d->imagePanIconWidget, TQT_SIGNAL(signalSelectionMoved(const TQRect&, bool)), + this, TQT_SLOT(slotSetImageRegionPosition(const TQRect&, bool))); - connect(d->imagePanIconWidget, SIGNAL(signalSelectionTakeFocus()), - this, SLOT(slotPanIconTakeFocus())); + connect(d->imagePanIconWidget, TQT_SIGNAL(signalSelectionTakeFocus()), + this, TQT_SLOT(slotPanIconTakeFocus())); - connect(d->separateView, SIGNAL(released(int)), - d->imageRegionWidget, SLOT(slotSeparateViewToggled(int))); + connect(d->separateView, TQT_SIGNAL(released(int)), + d->imageRegionWidget, TQT_SLOT(slotSeparateViewToggled(int))); - connect(d->separateView, SIGNAL(released(int)), - d->imagePanIconWidget, SLOT(slotSeparateViewToggled(int))); + connect(d->separateView, TQT_SIGNAL(released(int)), + d->imagePanIconWidget, TQT_SLOT(slotSeparateViewToggled(int))); - connect(d->zoomBar, SIGNAL(signalZoomMinusClicked()), - d->imageRegionWidget, SLOT(slotDecreaseZoom())); + connect(d->zoomBar, TQT_SIGNAL(signalZoomMinusClicked()), + d->imageRegionWidget, TQT_SLOT(slotDecreaseZoom())); - connect(d->zoomBar, SIGNAL(signalZoomPlusClicked()), - d->imageRegionWidget, SLOT(slotIncreaseZoom())); + connect(d->zoomBar, TQT_SIGNAL(signalZoomPlusClicked()), + d->imageRegionWidget, TQT_SLOT(slotIncreaseZoom())); - connect(d->zoomBar, SIGNAL(signalZoomSliderReleased(int)), - this, SLOT(slotZoomSliderChanged(int))); + connect(d->zoomBar, TQT_SIGNAL(signalZoomSliderReleased(int)), + this, TQT_SLOT(slotZoomSliderChanged(int))); } ImagePannelWidget::~ImagePannelWidget() @@ -294,8 +294,8 @@ void ImagePannelWidget::readSettings() KConfig *config = kapp->config(); config->setGroup(d->settingsSection); int mode = config->readNumEntry("Separate View", ImageRegionWidget::SeparateViewDuplicateVert); - mode = QMAX(ImageRegionWidget::SeparateViewHorizontal, mode); - mode = QMIN(ImageRegionWidget::SeparateViewDuplicateHorz, mode); + mode = TQMAX(ImageRegionWidget::SeparateViewHorizontal, mode); + mode = TQMIN(ImageRegionWidget::SeparateViewDuplicateHorz, mode); d->imageRegionWidget->blockSignals(true); d->imagePanIconWidget->blockSignals(true); @@ -319,7 +319,7 @@ void ImagePannelWidget::writeSettings() void ImagePannelWidget::slotOriginalImageRegionChanged(bool target) { slotZoomFactorChanged(d->imageRegionWidget->zoomFactor()); - QRect rect = getOriginalImageRegion(); + TQRect rect = getOriginalImageRegion(); d->imagePanIconWidget->setRegionSelection(rect); updateSelectionInfo(rect); @@ -341,7 +341,7 @@ void ImagePannelWidget::slotZoomFactorChanged(double zoom) int size = (int)((zoom - b) /a); d->zoomBar->setZoomSliderValue(size); - d->zoomBar->setZoomTrackerText(i18n("zoom: %1%").arg((int)(zoom*100.0))); + d->zoomBar->setZoomTrackerText(i18n("zoom: %1%").tqarg((int)(zoom*100.0))); d->zoomBar->setEnableZoomPlus(true); d->zoomBar->setEnableZoomMinus(true); @@ -373,7 +373,7 @@ KProgress *ImagePannelWidget::progressBar() return d->progressBar; } -void ImagePannelWidget::resizeEvent(QResizeEvent *) +void ImagePannelWidget::resizeEvent(TQResizeEvent *) { emit signalResized(); } @@ -385,7 +385,7 @@ void ImagePannelWidget::slotInitGui() slotOriginalImageRegionChanged(true); } -void ImagePannelWidget::setPanIconHighLightPoints(const QPointArray& pt) +void ImagePannelWidget::setPanIconHighLightPoints(const TQPointArray& pt) { d->imageRegionWidget->setHighLightPoints(pt); d->imagePanIconWidget->setHighLightPoints(pt); @@ -396,9 +396,9 @@ void ImagePannelWidget::slotPanIconTakeFocus() d->imageRegionWidget->restorePixmapRegion(); } -void ImagePannelWidget::setUserAreaWidget(QWidget *w) +void ImagePannelWidget::setUserAreaWidget(TQWidget *w) { - w->reparent( d->settings, QPoint(0, 0) ); + w->reparent( d->settings, TQPoint(0, 0) ); d->settingsLayout->addSpacing(KDialog::spacingHint()); d->settingsLayout->addWidget(w); d->settingsLayout->addStretch(); @@ -423,9 +423,9 @@ void ImagePannelWidget::setProgressVisible(bool b) else d->progressBar->hide(); } -void ImagePannelWidget::setProgressWhatsThis(const QString& desc) +void ImagePannelWidget::setProgressWhatsThis(const TQString& desc) { - QWhatsThis::add( d->progressBar, desc); + TQWhatsThis::add( d->progressBar, desc); } void ImagePannelWidget::setPreviewImageWaitCursor(bool enable) @@ -436,12 +436,12 @@ void ImagePannelWidget::setPreviewImageWaitCursor(bool enable) d->imageRegionWidget->unsetCursor(); } -QRect ImagePannelWidget::getOriginalImageRegion() +TQRect ImagePannelWidget::getOriginalImageRegion() { return ( d->imageRegionWidget->getImageRegion() ); } -QRect ImagePannelWidget::getOriginalImageRegionToRender() +TQRect ImagePannelWidget::getOriginalImageRegionToRender() { return ( d->imageRegionWidget->getImageRegionToRender() ); } @@ -461,17 +461,17 @@ void ImagePannelWidget::setCenterImageRegionPosition() d->imageRegionWidget->setCenterContentsPosition(); } -void ImagePannelWidget::slotSetImageRegionPosition(const QRect& rect, bool targetDone) +void ImagePannelWidget::slotSetImageRegionPosition(const TQRect& rect, bool targetDone) { d->imageRegionWidget->setContentsPosition(rect.x(), rect.y(), targetDone); } -void ImagePannelWidget::updateSelectionInfo(const QRect& rect) +void ImagePannelWidget::updateSelectionInfo(const TQRect& rect) { - QToolTip::add( d->imagePanIconWidget, + TQToolTip::add( d->imagePanIconWidget, i18n("<nobr>(%1,%2)(%3x%4)</nobr>") - .arg(rect.left()).arg(rect.top()) - .arg(rect.width()).arg(rect.height())); + .tqarg(rect.left()).tqarg(rect.top()) + .tqarg(rect.width()).tqarg(rect.height())); } } // NameSpace Digikam |