summaryrefslogtreecommitdiffstats
path: root/krita/ui/kis_previewwidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/ui/kis_previewwidget.cc')
-rw-r--r--krita/ui/kis_previewwidget.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/krita/ui/kis_previewwidget.cc b/krita/ui/kis_previewwidget.cc
index 363302f7..a8e2a78e 100644
--- a/krita/ui/kis_previewwidget.cc
+++ b/krita/ui/kis_previewwidget.cc
@@ -21,18 +21,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qpainter.h>
-#include <qpoint.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qapplication.h>
-#include <qcolor.h>
-#include <qgroupbox.h>
-#include <qcursor.h>
-#include <qtimer.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqpainter.h>
+#include <tqpoint.h>
+#include <tqpushbutton.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqapplication.h>
+#include <tqcolor.h>
+#include <tqgroupbox.h>
+#include <tqcursor.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kiconloader.h>
@@ -65,8 +65,8 @@ static const int ZOOM_PAUSE = 100;
static const int FILTER_PAUSE = 500;
static const double ZOOM_FACTOR = 1.1;
-KisPreviewWidget::KisPreviewWidget( QWidget* parent, const char* name )
- : PreviewWidgetBase( parent, name )
+KisPreviewWidget::KisPreviewWidget( TQWidget* tqparent, const char* name )
+ : PreviewWidgetBase( tqparent, name )
, m_autoupdate(true)
, m_previewIsDisplayed(true)
, m_scaledOriginal()
@@ -80,42 +80,42 @@ KisPreviewWidget::KisPreviewWidget( QWidget* parent, const char* name )
, m_zoom(-1.0)
, m_profile(NULL)
, m_progress( 0 )
- , m_zoomTimer(new QTimer(this))
- , m_filterTimer(new QTimer(this))
+ , m_zoomTimer(new TQTimer(this))
+ , m_filterTimer(new TQTimer(this))
, m_firstFilter(true)
, m_firstZoom(true)
{
btnZoomIn->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag+", KIcon::MainToolbar, 16 ));
- connect(btnZoomIn, SIGNAL(clicked()), this, SLOT(zoomIn()));
+ connect(btnZoomIn, TQT_SIGNAL(clicked()), this, TQT_SLOT(zoomIn()));
btnZoomOut->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag-", KIcon::MainToolbar, 16 ));
- connect(btnZoomOut, SIGNAL(clicked()), this, SLOT(zoomOut()));
+ connect(btnZoomOut, TQT_SIGNAL(clicked()), this, TQT_SLOT(zoomOut()));
btnUpdate->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "reload", KIcon::MainToolbar, 16 ));
- connect(btnUpdate, SIGNAL(clicked()), this, SLOT(forceUpdate()));
+ connect(btnUpdate, TQT_SIGNAL(clicked()), this, TQT_SLOT(forceUpdate()));
- connect(radioBtnPreview, SIGNAL(toggled(bool)), this, SLOT(setPreviewDisplayed(bool)));
+ connect(radioBtnPreview, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setPreviewDisplayed(bool)));
- connect(checkBoxAutoUpdate, SIGNAL(toggled(bool)), this, SLOT(slotSetAutoUpdate(bool)));
+ connect(checkBoxAutoUpdate, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotSetAutoUpdate(bool)));
btnZoomOneToOne->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag1", KIcon::MainToolbar, 16 ));
- connect(btnZoomOneToOne, SIGNAL(clicked()), this, SLOT(zoomOneToOne()));
+ connect(btnZoomOneToOne, TQT_SIGNAL(clicked()), this, TQT_SLOT(zoomOneToOne()));
m_progress = new KisLabelProgress(frmProgress);
m_progress->setMaximumHeight(fontMetrics().height() );
- QVBoxLayout *vbox = new QVBoxLayout( frmProgress );
+ TQVBoxLayout *vbox = new TQVBoxLayout( frmProgress );
vbox->addWidget(m_progress);
m_progress->hide();
- connect(m_zoomTimer, SIGNAL(timeout()), this, SLOT(updateZoom()));
- connect(m_filterTimer, SIGNAL(timeout()), this, SLOT(runFilterHelper()));
+ connect(m_zoomTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateZoom()));
+ connect(m_filterTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(runFilterHelper()));
/* kToolBar1->insertLineSeparator();
kToolBar1->insertButton("reload",2, true, i18n("Update"));
- connect(kToolBar1->getButton(2),SIGNAL(clicked()),this,SLOT(forceUpdate()));
+ connect(kToolBar1->getButton(2),TQT_SIGNAL(clicked()),this,TQT_SLOT(forceUpdate()));
kToolBar1->insertButton("",3, true, i18n("Auto Update"));
- connect(kToolBar1->getButton(3),SIGNAL(clicked()),this,SLOT(toggleAutoUpdate()));
+ connect(kToolBar1->getButton(3),TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleAutoUpdate()));
kToolBar1->insertButton("",4, true, i18n("Switch"));
- connect(kToolBar1->getButton(4),SIGNAL(clicked()),this,SLOT(toggleImageDisplayed()));*/
+ connect(kToolBar1->getButton(4),TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleImageDisplayed()));*/
// these currently don't yet work, reenable when they do work :) (TZ-12-2005)
// TODO reenable these
// kToolBar1->insertButton("",5, true, i18n("Popup Original and Preview"));
@@ -143,10 +143,10 @@ void KisPreviewWidget::slotSetDevice(KisPaintDeviceSP dev)
m_filterZoom = 1.0;
KisConfig cfg;
- QString monitorProfileName = cfg.monitorProfile();
+ TQString monitorProfileName = cfg.monitorProfile();
m_profile = KisMetaRegistry::instance()->csRegistry()->getProfileByName(monitorProfileName);
- QRect r = dev->exactBounds();
+ TQRect r = dev->exactBounds();
m_groupBox->setTitle(i18n("Preview: ") + dev->name());
m_previewIsDisplayed = true;
@@ -157,44 +157,44 @@ void KisPreviewWidget::slotSetDevice(KisPaintDeviceSP dev)
void KisPreviewWidget::updateZoom()
{
- QApplication::setOverrideCursor(KisCursor::waitCursor());
+ TQApplication::setOverrideCursor(KisCursor::waitCursor());
if(m_previewIsDisplayed)
{
if(m_dirtyPreview)
{
- QSize r = m_previewDevice->extent().size();
+ TQSize r = m_previewDevice->extent().size();
int w = r.width(), h = r.height();
int sw = int(ceil(m_zoom * w / m_filterZoom));
int sh = int(ceil(m_zoom * h / m_filterZoom));
m_dirtyPreview = false;
- m_scaledPreview = m_previewDevice->convertToQImage(m_profile, 0, 0, w, h);
- m_scaledPreview = m_scaledPreview.scale(sw,sh, QImage::ScaleMax); // Use scale instead of smoothScale for speed up
+ m_scaledPreview = m_previewDevice->convertToTQImage(m_profile, 0, 0, w, h);
+ m_scaledPreview = m_scaledPreview.scale(sw,sh, TQ_ScaleMax); // Use scale instead of smoothScale for speed up
}
m_preview->setImage(m_scaledPreview);
} else
{
if(m_dirtyOriginal)
{
- QSize r = m_origDevice->extent().size();
+ TQSize r = m_origDevice->extent().size();
int w = r.width(), h = r.height();
int sw = int(ceil(m_zoom * w));
int sh = int(ceil(m_zoom * h));
m_dirtyOriginal = false;
- m_scaledOriginal = m_origDevice->convertToQImage(m_profile, 0, 0, w, h);
- m_scaledOriginal = m_scaledOriginal.scale(sw,sh, QImage::ScaleMax); // Use scale instead of smoothScale for speed up
+ m_scaledOriginal = m_origDevice->convertToTQImage(m_profile, 0, 0, w, h);
+ m_scaledOriginal = m_scaledOriginal.scale(sw,sh, TQ_ScaleMax); // Use scale instead of smoothScale for speed up
}
m_preview->setImage(m_scaledOriginal);
}
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
void KisPreviewWidget::slotSetAutoUpdate(bool set) {
m_autoupdate = set;
}
-void KisPreviewWidget::wheelEvent(QWheelEvent * e)
+void KisPreviewWidget::wheelEvent(TQWheelEvent * e)
{
if (e->delta() > 0) {
zoomIn();
@@ -264,7 +264,7 @@ void KisPreviewWidget::zoomOneToOne() {
}
static inline void cropDevice(KisPaintDevice * device, const double & zoom) {
- QRect r = device->exactBounds();
+ TQRect r = device->exactBounds();
r.setX(int(zoom * r.x()) );
r.setY(int(zoom * r.y()) );
r.setWidth(int(zoom * r.width()) );
@@ -333,9 +333,9 @@ void KisPreviewWidget::runFilterHelper() {
if (m_origDevice->image())
{
m_scaledImage = new KisImage(*m_origDevice->image());
- if(!m_origDevice->parentLayer()) return;
- QString layerName = m_origDevice->parentLayer()->name();
- KisPaintLayerSP pl = ::qt_cast<KisPaintLayer*>(m_scaledImage->findLayer(layerName));
+ if(!m_origDevice->tqparentLayer()) return;
+ TQString layerName = m_origDevice->tqparentLayer()->name();
+ KisPaintLayerSP pl = ::tqqt_cast<KisPaintLayer*>(m_scaledImage->findLayer(layerName));
if(!pl) return;
scaledDevice = pl->paintDevice();
@@ -356,7 +356,7 @@ void KisPreviewWidget::runFilterHelper() {
0.0, 0.0, 0.0, 0, 0, NULL, &strategy);
tw.run();
scaledDevice->setSelection(select);
- select->setParentLayer(scaledDevice->parentLayer());
+ select->setParentLayer(scaledDevice->tqparentLayer());
}
// Crop by the zoom value instead of cropping by rectangle. It gives better results