diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/ui/kis_birdeye_box.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/ui/kis_birdeye_box.cc')
-rw-r--r-- | krita/ui/kis_birdeye_box.cc | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/krita/ui/kis_birdeye_box.cc b/krita/ui/kis_birdeye_box.cc index 54335f9c..1484563f 100644 --- a/krita/ui/kis_birdeye_box.cc +++ b/krita/ui/kis_birdeye_box.cc @@ -17,15 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "qlayout.h" -#include "qlabel.h" -#include "qpixmap.h" -#include "qpainter.h" -#include "qimage.h" +#include "tqlayout.h" +#include "tqlabel.h" +#include "tqpixmap.h" +#include "tqpainter.h" +#include "tqimage.h" #include "config.h" #include LCMS_HEADER #include "klocale.h" -#include "qtooltip.h" +#include "tqtooltip.h" #include "kis_view.h" #include "kis_doc.h" @@ -66,11 +66,11 @@ namespace { return m_canvasSubject->zoomFactor(); } - virtual QRect size() + virtual TQRect size() { - if (!m_canvasSubject->currentImg()) return QRect(0,0,0,0); + if (!m_canvasSubject->currentImg()) return TQRect(0,0,0,0); - return QRect(0, 0, m_canvasSubject->currentImg()->width(), m_canvasSubject->currentImg()->height()); + return TQRect(0, 0, m_canvasSubject->currentImg()->width(), m_canvasSubject->currentImg()->height()); } virtual void setViewCenterPoint(double x, double y) @@ -119,37 +119,37 @@ namespace { public: - virtual QSize pixelSize() + virtual TQSize pixelSize() { - if (!m_image) return QSize(0, 0); - return QSize(m_image->width(), m_image->height()); + if (!m_image) return TQSize(0, 0); + return TQSize(m_image->width(), m_image->height()); } - virtual QImage image(QRect r, QSize thumbnailSize) + virtual TQImage image(TQRect r, TQSize thumbnailSize) { if (!m_image || r.isEmpty() || thumbnailSize.width() == 0 || thumbnailSize.height() == 0) { - return QImage(); + return TQImage(); } KisPaintDevice thumbnailRect(m_image->colorSpace(), "thumbnailRect"); KisPaintDeviceSP mergedImage = m_image->projection(); - Q_INT32 imageWidth = m_image->width(); - Q_INT32 imageHeight = m_image->height(); - Q_UINT32 pixelSize = m_image->colorSpace()->pixelSize(); + TQ_INT32 imageWidth = m_image->width(); + TQ_INT32 imageHeight = m_image->height(); + TQ_UINT32 pixelSize = m_image->colorSpace()->pixelSize(); - for (Q_INT32 y = 0; y < r.height(); ++y) { + for (TQ_INT32 y = 0; y < r.height(); ++y) { KisHLineIteratorPixel it = thumbnailRect.createHLineIterator(0, y, r.width(), true); - Q_INT32 thumbnailY = r.y() + y; - Q_INT32 thumbnailX = r.x(); - Q_INT32 imageY = (thumbnailY * imageHeight) / thumbnailSize.height(); + TQ_INT32 thumbnailY = r.y() + y; + TQ_INT32 thumbnailX = r.x(); + TQ_INT32 imageY = (thumbnailY * imageHeight) / thumbnailSize.height(); KisHLineIteratorPixel srcIt = mergedImage -> createHLineIterator(0, imageY, imageWidth, false); while (!it.isDone()) { - Q_INT32 imageX = (thumbnailX * imageWidth) / thumbnailSize.width(); - Q_INT32 dx = imageX - srcIt.x(); + TQ_INT32 imageX = (thumbnailX * imageWidth) / thumbnailSize.width(); + TQ_INT32 dx = imageX - srcIt.x(); srcIt += dx; //KisColor pixelColor = mergedImage->colorAt(imageX, imageY); @@ -160,7 +160,7 @@ namespace { } } - return thumbnailRect.convertToQImage(m_canvasSubject->monitorProfile(), 0, 0, r.width(), r.height(), + return thumbnailRect.convertToTQImage(m_canvasSubject->monitorProfile(), 0, 0, r.width(), r.height(), m_canvasSubject->HDRExposure()); } @@ -177,12 +177,12 @@ namespace { } -KisBirdEyeBox::KisBirdEyeBox(KisView * view, QWidget* parent, const char* name) - : QWidget(parent, name) +KisBirdEyeBox::KisBirdEyeBox(KisView * view, TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) , m_view(view) , m_subject(view->canvasSubject()) { - QVBoxLayout * l = new QVBoxLayout(this); + TQVBoxLayout * l = new TQVBoxLayout(this); m_image = m_subject->currentImg(); @@ -192,38 +192,38 @@ KisBirdEyeBox::KisBirdEyeBox(KisView * view, QWidget* parent, const char* name) m_birdEyePanel = new KoBirdEyePanel(m_zoomAdapter, ktp, kpc, this); - connect(view, SIGNAL(cursorPosition( Q_INT32, Q_INT32 )), m_birdEyePanel, SLOT(cursorPosChanged( Q_INT32, Q_INT32 ))); - connect(view, SIGNAL(viewTransformationsChanged()), m_birdEyePanel, SLOT(slotViewTransformationChanged())); + connect(view, TQT_SIGNAL(cursorPosition( TQ_INT32, TQ_INT32 )), m_birdEyePanel, TQT_SLOT(cursorPosChanged( TQ_INT32, TQ_INT32 ))); + connect(view, TQT_SIGNAL(viewTransformationsChanged()), m_birdEyePanel, TQT_SLOT(slotViewTransformationChanged())); l->addWidget(m_birdEyePanel); - QHBoxLayout * hl = new QHBoxLayout(l); + TQHBoxLayout * hl = new TQHBoxLayout(l); - m_exposureLabel = new QLabel(i18n("Exposure:"), this); + m_exposureLabel = new TQLabel(i18n("Exposure:"), this); hl->addWidget(m_exposureLabel); m_exposureDoubleWidget = new KisDoubleWidget(-10, 10, this); - m_exposureDoubleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + m_exposureDoubleWidget->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Fixed); hl->addWidget(m_exposureDoubleWidget); - QToolTip::add(m_exposureDoubleWidget, i18n("Select the exposure (stops) for HDR images")); - l->addItem(new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding)); + TQToolTip::add(m_exposureDoubleWidget, i18n("Select the exposure (stops) for HDR images")); + l->addItem(new TQSpacerItem(0, 1, TQSizePolicy::Minimum, TQSizePolicy::MinimumExpanding)); m_exposureDoubleWidget->setPrecision(1); m_exposureDoubleWidget->setValue(0); m_exposureDoubleWidget->setLineStep(0.1); m_exposureDoubleWidget->setPageStep(1); - connect(m_exposureDoubleWidget, SIGNAL(valueChanged(double)), SLOT(exposureValueChanged(double))); - connect(m_exposureDoubleWidget, SIGNAL(sliderPressed()), SLOT(exposureSliderPressed())); - connect(m_exposureDoubleWidget, SIGNAL(sliderReleased()), SLOT(exposureSliderReleased())); + connect(m_exposureDoubleWidget, TQT_SIGNAL(valueChanged(double)), TQT_SLOT(exposureValueChanged(double))); + connect(m_exposureDoubleWidget, TQT_SIGNAL(sliderPressed()), TQT_SLOT(exposureSliderPressed())); + connect(m_exposureDoubleWidget, TQT_SIGNAL(sliderReleased()), TQT_SLOT(exposureSliderReleased())); m_draggingExposureSlider = false; Q_ASSERT(m_subject->document() != 0); - connect(m_subject->document(), SIGNAL(sigCommandExecuted()), SLOT(slotDocCommandExecuted())); + connect(m_subject->document(), TQT_SIGNAL(sigCommandExecuted()), TQT_SLOT(slotDocCommandExecuted())); if (m_image) { - connect(m_image, SIGNAL(sigImageUpdated(QRect)), SLOT(slotImageUpdated(QRect))); + connect(m_image, TQT_SIGNAL(sigImageUpdated(TQRect)), TQT_SLOT(slotImageUpdated(TQRect))); } } @@ -245,9 +245,9 @@ void KisBirdEyeBox::setImage(KisImageSP image) m_birdEyePanel->setThumbnailProvider(ktp); if (m_image) { - connect(m_image, SIGNAL(sigImageUpdated(QRect)), SLOT(slotImageUpdated(QRect))); - connect(m_image, SIGNAL(sigSizeChanged(Q_INT32, Q_INT32)), SLOT(slotImageSizeChanged(Q_INT32, Q_INT32))); - connect(m_image, SIGNAL(sigColorSpaceChanged(KisColorSpace *)), SLOT(slotImageColorSpaceChanged(KisColorSpace *))); + connect(m_image, TQT_SIGNAL(sigImageUpdated(TQRect)), TQT_SLOT(slotImageUpdated(TQRect))); + connect(m_image, TQT_SIGNAL(sigSizeChanged(TQ_INT32, TQ_INT32)), TQT_SLOT(slotImageSizeChanged(TQ_INT32, TQ_INT32))); + connect(m_image, TQT_SIGNAL(sigColorSpaceChanged(KisColorSpace *)), TQT_SLOT(slotImageColorSpaceChanged(KisColorSpace *))); m_birdEyePanel->slotUpdate(m_image->bounds()); slotImageColorSpaceChanged(m_image->colorSpace()); } @@ -259,16 +259,16 @@ void KisBirdEyeBox::slotDocCommandExecuted() if (!m_dirtyRect.isEmpty()) { m_birdEyePanel->slotUpdate(m_dirtyRect); } - m_dirtyRect = QRect(); + m_dirtyRect = TQRect(); } } -void KisBirdEyeBox::slotImageUpdated(QRect r) +void KisBirdEyeBox::slotImageUpdated(TQRect r) { m_dirtyRect |= r; } -void KisBirdEyeBox::slotImageSizeChanged(Q_INT32 /*w*/, Q_INT32 /*h*/) +void KisBirdEyeBox::slotImageSizeChanged(TQ_INT32 /*w*/, TQ_INT32 /*h*/) { if (m_image) { m_birdEyePanel->slotUpdate(m_image->bounds()); |