Commit 53fe3411 authored by Adrian Page's avatar Adrian Page

Fix deprecated, warnings, and less Q3.

svn path=/trunk/koffice/; revision=535227
parent c75288b6
......@@ -1091,7 +1091,7 @@ bool KisImage::addLayer(KisLayerSP layer, KisGroupLayerSP parent, KisLayerSP abo
if (!player.isNull()) {
// XXX: This should also be done whenever a layer grows!
Q3ValueVector<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() ->
QList<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() ->
csRegistry()->paintDeviceActionsFor(player->paintDevice()->colorSpace());
for (int i = 0; i < actions.count(); i++) {
actions.at(i)->act(player.data()->paintDevice(), width(), height());
......
......@@ -17,13 +17,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kdebug.h"
#include <kdebug.h>
#include <kparts/plugin.h>
#include <kservice.h>
#include <ktrader.h>
#include <kparts/componentfactory.h>
#include <kmessagebox.h>
#include <klocale.h>
#include "kis_debug_areas.h"
#include "kis_colorspace.h"
#include "kis_profile.h"
......@@ -107,15 +108,14 @@ KisProfile * KisColorSpaceFactoryRegistry::getProfileByName(const QString & nam
return m_profileMap[name];
}
Q3ValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisID id)
QList<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisID id)
{
return profilesFor(get(id));
}
Q3ValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisColorSpaceFactory * csf)
QList<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisColorSpaceFactory * csf)
{
Q3ValueVector<KisProfile *> profiles;
QList<KisProfile *> profiles;
QMap<QString, KisProfile * >::Iterator it;
for (it = m_profileMap.begin(); it != m_profileMap.end(); ++it) {
......@@ -139,7 +139,7 @@ void KisColorSpaceFactoryRegistry::addPaintDeviceAction(KisColorSpace* cs,
m_paintDevActionMap[cs->id()].append(action);
}
Q3ValueVector<KisPaintDeviceAction *>
QList<KisPaintDeviceAction *>
KisColorSpaceFactoryRegistry::paintDeviceActionsFor(KisColorSpace* cs) {
return m_paintDevActionMap[cs->id()];
}
......
......@@ -22,6 +22,7 @@
#include <QObject>
#include <QMap>
#include <QList>
#include <QString>
#include "kis_generic_registry.h"
......@@ -67,11 +68,11 @@ public:
KisProfile * getProfileByName(const QString & name);
/**
* Return the vector of profiles for this colorspacefactory
* Return the list of profiles for this colorspacefactory
*/
Q3ValueVector<KisProfile *> profilesFor(KisColorSpaceFactory * cs);
QList<KisProfile *> profilesFor(KisColorSpaceFactory * cs);
Q3ValueVector<KisProfile *> profilesFor(KisID id);
QList<KisProfile *> profilesFor(KisID id);
/**
* Return the colorspace + profile as named, or NULL if impossible combination.
......@@ -104,7 +105,7 @@ public:
/**
* Get a list of KisConstructPaintDeviceAction for a colorspace
*/
Q3ValueVector<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs);
QList<KisPaintDeviceAction *> paintDeviceActionsFor(KisColorSpace* cs);
private:
KisColorSpaceFactoryRegistry();
......@@ -115,8 +116,8 @@ private:
QMap<QString, KisProfile * > m_profileMap;
QMap<QString, KisColorSpace * > m_csMap;
typedef Q3ValueVector<KisPaintDeviceAction *> PaintActionVector;
QMap<KisID, PaintActionVector> m_paintDevActionMap;
typedef QList<KisPaintDeviceAction *> PaintActionList;
QMap<KisID, PaintActionList> m_paintDevActionMap;
KisColorSpace *m_alphaCs;
};
......
......@@ -79,10 +79,10 @@ void DlgColorSpaceConversion::fillCmbDestProfile(const KisID & s)
{
m_page->cmbDestProfile->clear();
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor(s);
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
m_page->cmbDestProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor(s);
foreach (KisProfile *profile, profileList) {
m_page->cmbDestProfile->addSqueezedItem(profile->productName());
}
}
......
......@@ -86,10 +86,10 @@ void KisCustomImageWidget::fillCmbProfiles(const KisID & s)
KisColorSpaceFactory * csf = KisMetaRegistry::instance()->csRegistry()->get(s);
if (csf == 0) return;
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
cmbProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
cmbProfile->addSqueezedItem(profile->productName());
}
cmbProfile->setCurrent(csf->defaultProfile());
}
......
......@@ -17,11 +17,10 @@
*/
#include <klocale.h>
#include <q3groupbox.h>
#include <QGroupBox>
#include <qlabel.h>
#include <qlayout.h>
//Added by qt3to4:
#include <Q3GridLayout>
#include <QGridLayout>
#include <klineedit.h>
#include <klocale.h>
......@@ -47,12 +46,14 @@ KisDlgAdjustmentLayer::KisDlgAdjustmentLayer(KisImage * img,
const QString & caption,
QWidget *parent,
const char *name)
: KDialogBase(parent, name, true, "", Ok | Cancel)
: KDialog(parent, caption, Ok | Cancel)
, m_image(img)
, m_currentFilter(0)
, m_customName(false)
, m_freezeName(false)
{
setObjectName(name);
Q_ASSERT(img);
KisLayerSP activeLayer = img->activeLayer();
......@@ -75,12 +76,13 @@ KisDlgAdjustmentLayer::KisDlgAdjustmentLayer(KisImage * img,
}
}
setCaption(caption);
QWidget * page = new QWidget(this, "page widget");
Q3GridLayout * grid = new Q3GridLayout(page, 3, 2, 0, 6);
QGridLayout * grid = new QGridLayout(page);
grid->setSpacing(6);
setMainWidget(page);
QLabel * lblName = new QLabel(i18n("Layer name:"), page, "lblName");
QLabel * lblName = new QLabel(i18n("Layer name:"), page);
lblName->setObjectName("lblName");
grid->addWidget(lblName, 0, 0);
m_layerName = new KLineEdit(page);
......@@ -90,7 +92,7 @@ KisDlgAdjustmentLayer::KisDlgAdjustmentLayer(KisImage * img,
m_filtersList = new KisFiltersListView(m_dev, page, "dlgadjustment.filtersList");
connect(m_filtersList , SIGNAL(selectionChanged(Q3IconViewItem*)), this, SLOT(selectionHasChanged(Q3IconViewItem* )));
grid->addMultiCellWidget(m_filtersList, 1, 2, 0, 0);
grid->addWidget(m_filtersList, 1, 0, 2, 1);
m_preview = new KisPreviewWidget(page, "dlgadjustment.preview");
m_preview->slotSetDevice( m_dev );
......@@ -98,8 +100,10 @@ KisDlgAdjustmentLayer::KisDlgAdjustmentLayer(KisImage * img,
connect( m_preview, SIGNAL(updated()), this, SLOT(refreshPreview()));
grid->addWidget(m_preview, 1, 1);
m_configWidgetHolder = new Q3GroupBox(i18n("Configuration"), page, "currentConfigWidget");
m_configWidgetHolder->setColumnLayout(0, Qt::Horizontal);
m_configWidgetHolder = new QGroupBox(i18n("Configuration"), page);
m_configWidgetHolder->setObjectName("currentConfigWidget");
QVBoxLayout *configWidgetHolderLayout = new QVBoxLayout();
m_configWidgetHolder->setLayout(configWidgetHolderLayout);
grid->addWidget(m_configWidgetHolder, 2, 1);
m_labelNoConfigWidget = new QLabel(i18n("No configuration options are available for this filter"),
......
......@@ -18,25 +18,23 @@
#ifndef KISDLGAdjustMENTLAYER_H
#define KISDLGAdjustMENTLAYER_H
#include <kdialogbase.h>
//Added by qt3to4:
#include <kdialog.h>
#include <QLabel>
#include <Q3HBoxLayout>
class KisFilter;
class Q3IconViewItem;
class QLabel;
class Q3HBoxLayout;
class QHBoxLayout;
class KisPreviewWidget;
class KisFiltersListView;
class KisFilterConfiguration;
class KisImage;
class Q3GroupBox;
class QGroupBox;
/**
* Create a new adjustment layer.
*/
class KisDlgAdjustmentLayer : public KDialogBase
class KisDlgAdjustmentLayer : public KDialog
{
Q_OBJECT
......@@ -64,7 +62,7 @@ public:
QString layerName() const;
protected slots:
void slotNameChanged( const QString & );
void slotConfigChanged();
void refreshPreview();
......@@ -75,7 +73,7 @@ private:
KisPaintDeviceSP m_dev;
KisFiltersListView * m_filtersList;
KisPreviewWidget * m_preview;
Q3GroupBox * m_configWidgetHolder;
QGroupBox * m_configWidgetHolder;
QWidget * m_currentConfigWidget;
KisFilter* m_currentFilter;
KLineEdit * m_layerName;
......
......@@ -95,10 +95,10 @@ void KisDlgApplyProfile::fillCmbProfiles(const KisID & s)
KisColorSpaceFactory * csf = KisMetaRegistry::instance()->csRegistry()->get(s);
if (csf == 0) return;
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
m_page->cmbProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
m_page->cmbProfile->addSqueezedItem(profile->productName());
}
m_page->cmbProfile->setCurrent(csf->defaultProfile());
}
......
......@@ -139,7 +139,7 @@ KisColorSpace * KisDlgImageProperties::colorSpace()
KisProfile * KisDlgImageProperties::profile()
{
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( m_image->colorSpace()->id() );
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( m_image->colorSpace()->id() );
qint32 index = m_page->cmbProfile->currentIndex();
if (index < profileList.count()) {
......@@ -152,13 +152,12 @@ KisProfile * KisDlgImageProperties::profile()
// XXX: Copy & paste from kis_dlg_create_img -- refactor to separate class
void KisDlgImageProperties::fillCmbProfiles(const KisID & s)
{
KisColorSpaceFactory * csf = KisMetaRegistry::instance()->csRegistry()->get(s);
m_page->cmbProfile->clear();
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
m_page->cmbProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
m_page->cmbProfile->addSqueezedItem(profile->productName());
}
}
......
......@@ -99,10 +99,10 @@ void NewLayerDialog::fillCmbProfiles(const KisID & s)
KisColorSpaceFactory * csf = KisMetaRegistry::instance()->csRegistry()->get(s);
if (csf == 0) return;
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
m_page->cmbProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
m_page->cmbProfile->addSqueezedItem(profile->productName());
}
m_page->cmbProfile->setCurrent(csf->defaultProfile());
}
......
......@@ -194,11 +194,11 @@ void ColorSettingsTab::refillMonitorProfiles(const KisID & s)
if ( !csf )
return;
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
if ((*it)->deviceClass() == icSigDisplayClass)
m_page->cmbMonitorProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
if (profile->deviceClass() == icSigDisplayClass)
m_page->cmbMonitorProfile->addSqueezedItem(profile->productName());
}
m_page->cmbMonitorProfile->setCurrent(csf->defaultProfile());
......@@ -213,11 +213,11 @@ void ColorSettingsTab::refillPrintProfiles(const KisID & s)
if ( !csf )
return;
Q3ValueVector<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
Q3ValueVector<KisProfile *> ::iterator it;
for ( it = profileList.begin(); it != profileList.end(); ++it ) {
if ((*it)->deviceClass() == icSigOutputClass)
m_page->cmbPrintProfile->addSqueezedItem((*it)->productName());
QList<KisProfile *> profileList = KisMetaRegistry::instance()->csRegistry()->profilesFor( csf );
foreach (KisProfile *profile, profileList) {
if (profile->deviceClass() == icSigOutputClass)
m_page->cmbPrintProfile->addSqueezedItem(profile->productName());
}
m_page->cmbPrintProfile->setCurrent(csf->defaultProfile());
......
......@@ -901,9 +901,9 @@ bool KisDoc::newImage(const QString& name, qint32 width, qint32 height, KisColor
painter.fillRect(0, 0, width, height, bgColor, opacity);
painter.end();
Q3ValueVector<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() ->
QList<KisPaintDeviceAction *> actions = KisMetaRegistry::instance() ->
csRegistry()->paintDeviceActionsFor(cs);
for (uint i = 0; i < actions.count(); i++)
for (int i = 0; i < actions.count(); i++)
actions.at(i)->act(layer->paintDevice(), img->width(), img->height());
img->setBackgroundColor(bgColor);
......
......@@ -314,8 +314,7 @@ void KisOpenGLImageContext::createImageTextureTiles()
//XXX: will be float/half with shaders
#define RGBA_BYTES_PER_PIXEL 4
QByteArray emptyTilePixelData(m_imageTextureTileWidth * m_imageTextureTileHeight * RGBA_BYTES_PER_PIXEL);
emptyTilePixelData.fill(0);
QByteArray emptyTilePixelData(m_imageTextureTileWidth * m_imageTextureTileHeight * RGBA_BYTES_PER_PIXEL, 0);
for (int tileIndex = 0; tileIndex < numImageTextureTiles; ++tileIndex) {
......@@ -328,7 +327,7 @@ void KisOpenGLImageContext::createImageTextureTiles()
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, m_imageTextureTileWidth, m_imageTextureTileHeight, 0,
GL_BGRA, GL_UNSIGNED_BYTE, &emptyTilePixelData[0]);
GL_BGRA, GL_UNSIGNED_BYTE, emptyTilePixelData.data());
}
}
......
......@@ -16,47 +16,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdrawutil.h>
#include <qevent.h>
#include <qfile.h>
#include <qimage.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qvalidator.h>
#include <qpainter.h>
#include <qpushbutton.h>
#include <qspinbox.h>
#include <qtimer.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <kapplication.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kiconloader.h>
#include <klistbox.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kseparator.h>
#include <kpalette.h>
#include <kimageeffect.h>
#include <kcolordialog.h>
#include <k3colordrag.h>
#include <config.h>
#include <QComboBox>
#include <QVBoxLayout>
#include <kdebug.h>
#include <kis_meta_registry.h>
#include <kis_color.h>
#include <kis_factory.h>
#include <kis_colorspace_factory_registry.h>
#include "kis_palette_widget.h"
#include "kis_resource.h"
#include "kis_palette.h"
......@@ -69,9 +33,9 @@ KisPaletteWidget::KisPaletteWidget( QWidget *parent, int minWidth, int cols)
m_currentPalette = 0;
Q3VBoxLayout *layout = new Q3VBoxLayout( this );
QVBoxLayout *layout = new QVBoxLayout( this );
combo = new QComboBox( false, this );
combo = new QComboBox( this );
combo->setFocusPolicy( Qt::ClickFocus );
layout->addWidget(combo);
......@@ -124,20 +88,13 @@ void KisPaletteWidget::setPalette( const QString &_paletteName )
if (combo->currentText() != paletteName)
{
bool found = false;
for(int i = 0; i < combo->count(); i++)
{
if (combo->text(i) == paletteName)
{
combo->setCurrentItem(i);
found = true;
break;
}
}
if (!found)
{
combo->insertItem(paletteName);
combo->setCurrentItem(combo->count()-1);
int i = combo->findText(paletteName);
if (i >= 0) {
combo->setCurrentIndex(i);
} else {
combo->addItem(paletteName);
combo->setCurrentIndex(combo->count() - 1);
}
}
......@@ -148,14 +105,16 @@ void KisPaletteWidget::slotAddPalette(KisResource * palette)
{
KisPalette * p = dynamic_cast<KisPalette*>(palette);
m_namedPaletteMap.insert(palette->name(), p);
if (p) {
m_namedPaletteMap.insert(palette->name(), p);
combo->insertItem(palette->name());
combo->addItem(palette->name());
if (!init) {
combo->setCurrentItem(0);
setPalette(combo ->currentText());
init = true;
if (!init) {
combo->setCurrentIndex(0);
setPalette(combo ->currentText());
init = true;
}
}
}
......
......@@ -65,7 +65,7 @@ KisPartLayerImpl::KisPartLayerImpl(KisImageSP img, KisChildDoc * doc)
: super(img.data(), i18n("Embedded Document"), OPACITY_OPAQUE), m_doc(doc)
{
m_cache = new KisPaintDevice(
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID("RGBA",""),""), name().latin1() );
KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID("RGBA",""),""), name().toLatin1() );
m_activated = false;
}
......@@ -112,7 +112,7 @@ void KisPartLayerImpl::setX(qint32 x) {
// KisPaintDevice::move moves to absolute coordinates, not relative. Work around that here,
// since the part is not necesarily started at (0,0)
rect.moveBy(x - this->x(), 0);
rect.translate(x - this->x(), 0);
m_doc->setGeometry(rect);
}
......@@ -121,7 +121,7 @@ void KisPartLayerImpl::setY(qint32 y) {
// KisPaintDevice::move moves to absolute coordinates, not relative. Work around that here,
// since the part is not necesarily started at (0,0)
rect.moveBy(0, y - this->y());
rect.translate(0, y - this->y());
m_doc->setGeometry(rect);
}
......@@ -157,17 +157,17 @@ KisPaintDeviceSP KisPartLayerImpl::prepareProjection(KisPaintDeviceSP projection
// We know the embedded part's size through the ChildDoc
// We move it to (0,0), since that is what we will start painting from in paintEverything.
QRect embedRect(intersection);
embedRect.moveBy(- exactBounds().x(), - exactBounds().y());
embedRect.translate(- exactBounds().x(), - exactBounds().y());
QRect paintRect(exactBounds());
paintRect.moveBy(- exactBounds().x(), - exactBounds().y());
paintRect.translate(- exactBounds().x(), - exactBounds().y());
QPixmap pm1(projection->convertToQImage(0 /*srgb XXX*/,
QPixmap pm1 = QPixmap::fromImage(projection->convertToQImage(0 /*srgb XXX*/,
intersection.x(), intersection.y(),
intersection.width(), intersection.height()));
QPixmap pm2(extent().width(), extent().height());
copyBlt(&pm2, embedRect.x(), embedRect.y(), &pm1,
0, 0, embedRect.width(), embedRect.height());
QPainter painter(&pm2);
painter.drawPixmap(embedRect.x(), embedRect.y(), pm1, 0, 0, embedRect.width(), embedRect.height());
painter.setClipRect(embedRect);
// KWord's KWPartFrameSet::drawFrameContents has some interesting remarks concerning
......@@ -177,9 +177,11 @@ KisPaintDeviceSP KisPartLayerImpl::prepareProjection(KisPaintDeviceSP projection
// Paint transparent, no zoom:
m_doc->document()->paintEverything(painter, paintRect, true);
copyBlt(&pm1, 0, 0, &pm2,
embedRect.x(), embedRect.y(), embedRect.width(), embedRect.height());
QImage qimg = pm1.convertToImage();
painter.end();
painter.begin(&pm1);
painter.drawPixmap(0, 0, pm2, embedRect.x(), embedRect.y(), embedRect.width(), embedRect.height());
QImage qimg = pm1.toImage();
//assume the part is sRGB for now, and that "" is sRGB
// And we need to paint offsetted
......@@ -197,7 +199,7 @@ QImage KisPartLayerImpl::createThumbnail(qint32 w, qint32 h) {
painter.scale(w / bounds.width(), h / bounds.height());
m_doc->document()->paintEverything(painter, bounds);
QImage qimg = pm.convertToImage();
QImage qimg = pm.toImage();
return qimg;
}
......
......@@ -60,17 +60,17 @@ KisPreviewWidget::KisPreviewWidget( QWidget* parent, const char* name )
m_autoupdate = true;
m_previewIsDisplayed = true;
btnZoomIn->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag+", K3Icon::MainToolbar, 16 ));
btnZoomIn->setIcon(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag+", K3Icon::MainToolbar, 16 ));
connect(btnZoomIn, SIGNAL(clicked()), this, SLOT(zoomIn()));
btnZoomOut->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag-", K3Icon::MainToolbar, 16 ));
btnZoomOut->setIcon(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag-", K3Icon::MainToolbar, 16 ));
connect(btnZoomOut, SIGNAL(clicked()), this, SLOT(zoomOut()));
btnUpdate->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "reload", K3Icon::MainToolbar, 16 ));
btnUpdate->setIcon(KGlobal::instance()->iconLoader()->loadIconSet( "reload", K3Icon::MainToolbar, 16 ));
connect(btnUpdate, SIGNAL(clicked()), this, SLOT(forceUpdate()));
connect(radioBtnPreview, SIGNAL(toggled(bool)), this, SLOT(setPreviewDisplayed(bool)));
connect(checkBoxAutoUpdate, SIGNAL(toggled(bool)), this, SLOT(slotSetAutoUpdate(bool)));
btnZoomOneToOne->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag1", K3Icon::MainToolbar, 16 ));
btnZoomOneToOne->setIcon(KGlobal::instance()->iconLoader()->loadIconSet( "viewmag1", K3Icon::MainToolbar, 16 ));
connect(btnZoomOneToOne, SIGNAL(clicked()), this, SLOT(zoomOneToOne()));
......@@ -94,7 +94,7 @@ void KisPreviewWidget::forceUpdate()
if (!m_origDevice) return;
if(m_previewIsDisplayed)
{
m_groupBox->setTitle(m_origDevice->name());
m_groupBox->setTitle(m_origDevice->objectName());
emit updated();
}
}
......@@ -113,7 +113,7 @@ void KisPreviewWidget::slotSetDevice(KisPaintDeviceSP dev)
QRect r = dev->exactBounds();
m_groupBox->setTitle(i18n("Preview: ") + dev->name());
m_groupBox->setTitle(i18n("Preview: ") + dev->objectName());
m_previewIsDisplayed = true;
m_zoom = (double)m_preview->width() / (double)r.width();
......@@ -135,7 +135,7 @@ void KisPreviewWidget::slotUpdate()
int w, h;
w = (int) ceil(r.width() * m_zoom );
h = (int) ceil(r.height() * m_zoom );
m_scaledPreview = m_scaledPreview.smoothScale (w,h, Qt::KeepAspectRatioByExpanding);
m_scaledPreview = m_scaledPreview.scaled(w, h, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
}
if(m_previewIsDisplayed)
{
......@@ -165,10 +165,10 @@ void KisPreviewWidget::setPreviewDisplayed(bool v)
m_previewIsDisplayed = v;
if(m_previewIsDisplayed)
{
m_groupBox->setTitle(i18n("Preview: ") + m_origDevice->name());
m_groupBox->setTitle(i18n("Preview: ") + m_origDevice->objectName());
m_preview->setImage(m_scaledPreview);
} else {
m_groupBox->setTitle(i18n("Original: ") + m_origDevice->name());
m_groupBox->setTitle(i18n("Original: ") + m_origDevice->objectName());
m_preview->setImage(m_scaledOriginal);
}
}
......@@ -197,12 +197,12 @@ bool KisPreviewWidget::zoomChanged()