Commit fc363618 authored by Adrian Page's avatar Adrian Page

Fix deprecated and warnings.

svn path=/trunk/koffice/; revision=535590
parent cc5b6862
......@@ -23,7 +23,7 @@
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qcheckbox.h>
//Added by qt3to4:
#include <QPixmap>
#include <QShowEvent>
#include <kglobal.h>
......@@ -47,7 +47,7 @@ KisCustomBrush::KisCustomBrush(QWidget *parent, const char* name, const QString&
{
Q_ASSERT(m_view);
m_mediator = 0;
setCaption(caption);
setWindowTitle(caption);
m_brush = 0;
......@@ -96,7 +96,7 @@ void KisCustomBrush::slotAddPredefined() {
KTempFile file(dir, extension);
file.close(); // If we don't, and brush->save first, it might get truncated!
// Save it to that file
// Save it to that file
m_brush->setFilename(file.name());
// Add it to the brush server, so that it automatically gets to the mediators, and
......
......@@ -46,7 +46,7 @@ KisCustomPalette::KisCustomPalette(QWidget *parent, const char* name, const QStr
m_mediator = 0;
m_server = 0;
m_editMode = false;
setCaption(caption);
setWindowTitle(caption);
m_palette = new KisPalette();
m_ownPalette = true;
......@@ -128,7 +128,7 @@ void KisCustomPalette::slotAddPredefined() {
KTempFile file(dir, extension);
file.close(); // If we don't, and palette->save first, it might get truncated!
// Save it to that file
// Save it to that file
m_palette->setFilename(file.name());
} else {
// The filename is already set
......
......@@ -29,7 +29,7 @@ KisInputDevice KisInputDevice::Eraser;
KisInputDevice KisInputDevice::Puck;
KisInputDevice KisInputDevice::Unknown(UNKNOWN_INPUT_DEVICE_ID);
Q3ValueVector<KisInputDevice> KisInputDevice::InputDevices;
QList<KisInputDevice> KisInputDevice::InputDevices;
KisInputDevice::KisInputDevice()
{
......@@ -62,7 +62,7 @@ void KisInputDevice::allocateDefaultDevicesIfNeeded()
}
}
Q3ValueVector<KisInputDevice> KisInputDevice::inputDevices()
QList<KisInputDevice> KisInputDevice::inputDevices()
{
allocateDefaultDevicesIfNeeded();
......@@ -93,7 +93,7 @@ KisInputDevice KisInputDevice::puck()
return Puck;
}
KisInputDevice KisInputDevice::unknown()
KisInputDevice KisInputDevice::unknown()
{
allocateDefaultDevicesIfNeeded();
return Unknown;
......
......@@ -19,14 +19,14 @@
#ifndef KIS_INPUT_DEVICE_H_
#define KIS_INPUT_DEVICE_H_
#include <q3valuevector.h>
#include <QList>
class KisInputDevice {
public:
KisInputDevice();
static KisInputDevice allocateInputDevice();
static Q3ValueVector<KisInputDevice> inputDevices();
static QList<KisInputDevice> inputDevices();
friend inline bool operator==(const KisInputDevice&, const KisInputDevice&);
friend inline bool operator!=(const KisInputDevice&, const KisInputDevice&);
......@@ -34,11 +34,11 @@ public:
friend inline bool operator<(const KisInputDevice &, const KisInputDevice &);
friend inline bool operator>(const KisInputDevice &, const KisInputDevice &);
static KisInputDevice mouse(); // Standard mouse
static KisInputDevice stylus(); // Wacom stylus via QTabletEvent
static KisInputDevice eraser(); // Wacom eraser via QTabletEvent
static KisInputDevice puck(); // Wacom puck via QTabletEvent
static KisInputDevice unknown();
static KisInputDevice mouse(); // Standard mouse
static KisInputDevice stylus(); // Wacom stylus via QTabletEvent
static KisInputDevice eraser(); // Wacom eraser via QTabletEvent
static KisInputDevice puck(); // Wacom puck via QTabletEvent
static KisInputDevice unknown();
private:
KisInputDevice(qint32 id) : m_id(id) {}
......@@ -52,7 +52,7 @@ private:
qint32 m_id;
static qint32 NextInputDeviceID;
static Q3ValueVector<KisInputDevice> InputDevices;
static QList<KisInputDevice> InputDevices;
static KisInputDevice Mouse;
static KisInputDevice Stylus;
......@@ -62,12 +62,12 @@ private:
};
inline bool operator==(const KisInputDevice &a, const KisInputDevice &b)
{
return a.id() == b.id();
{
return a.id() == b.id();
}
inline bool operator!=(const KisInputDevice &a, const KisInputDevice &b)
{
{
return a.id() != b.id();
}
......
......@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <q3vbox.h>
#include <kinstance.h>
#include <klocale.h>
#include <kstandarddirs.h>
......@@ -25,8 +25,9 @@
#include "kis_global.h"
#include "kis_icon_item.h"
KisItemChooser::KisItemChooser(QWidget *parent, const char *name) : super(parent, name)
KisItemChooser::KisItemChooser(QWidget *parent, const char *name) : super(parent)
{
setObjectName(name);
/* m_frame = new QVBox(this);
m_frame->setFrameStyle(QFrame::Panel | QFrame::Sunken);*/
m_chooser = new KoIconChooser(QSize(30,30), this, "icon_chooser", true);
......@@ -66,10 +67,8 @@ void KisItemChooser::addItem(KoIconItem *item)
void KisItemChooser::addItems(const vKoIconItem& items)
{
Q3PtrListIterator<KoIconItem> itr(items);
for (itr.toFirst(); itr.current(); ++itr)
m_chooser->addItem(itr.current());
foreach (KoIconItem *item, items)
m_chooser->addItem(item);
}
QWidget *KisItemChooser::chooserWidget() const
......
......@@ -18,7 +18,7 @@
#ifndef KIS_ITEM_CHOOSER_H_
#define KIS_ITEM_CHOOSER_H_
#include <q3ptrlist.h>
#include <QList>
#include <qwidget.h>
#include <kvbox.h>
......@@ -27,7 +27,7 @@ class KHBox;
class KoIconChooser;
class KoIconItem;
typedef Q3PtrList<KoIconItem> vKoIconItem;
typedef QList<KoIconItem *> vKoIconItem;
class KisItemChooser : public QWidget {
typedef QWidget super;
......
......@@ -21,8 +21,7 @@
#include <qtoolbutton.h>
#include <qcursor.h>
#include <qeventloop.h>
//Added by qt3to4:
#include <Q3HBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QKeyEvent>
#include <QEvent>
......@@ -41,7 +40,7 @@ class EscapeButton : public QToolButton {
public:
EscapeButton(QWidget * parent, const char * name) : QToolButton(parent, name) {};
EscapeButton(QWidget * parent, const char * name) : QToolButton(parent) { setObjectName(name); }
void keyReleaseEvent(QKeyEvent *e)
{
......@@ -50,22 +49,24 @@ public:
}
};
KisLabelProgress::KisLabelProgress(QWidget *parent, const char *name, Qt::WFlags f) : super(parent, name, f)
KisLabelProgress::KisLabelProgress(QWidget *parent, const char *name) : super(parent)
{
setObjectName(name);
m_subject = 0;
m_modal = false;
Q3HBoxLayout *box = new Q3HBoxLayout(this);
box->setAutoAdd(true);
QHBoxLayout *box = new QHBoxLayout(this);
QIcon cancelIconSet = SmallIconSet("stop");
m_cancelButton = new EscapeButton(this, "cancel_button");
m_cancelButton->setIconSet(cancelIconSet);
box->addWidget(m_cancelButton);
m_cancelButton->setIcon(cancelIconSet);
m_cancelButton->setToolTip( i18n("Cancel"));
connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(cancelPressed()));
m_bar = new QProgressBar(this);
box->addWidget(m_bar);
}
KisLabelProgress::~KisLabelProgress()
......
......@@ -32,7 +32,7 @@ class KisLabelProgress : public QLabel, public KisProgressDisplayInterface {
typedef QLabel super;
public:
KisLabelProgress(QWidget *parent, const char *name = 0, Qt::WFlags f = 0);
KisLabelProgress(QWidget *parent, const char *name = 0);
virtual ~KisLabelProgress();
public:
......
......@@ -22,11 +22,11 @@
class KisLabelZoom : public QLabel {
Q_OBJECT
KisLabelZoom( QWidget *parent, const char *name = 0, Qt::WFlags f = 0 ) :
QLabel( parent, name, f ) {}
KisLabelZoom( QWidget *parent, const char *name = 0) :
QLabel( parent ) { setObjectName(name); }
virtual ~KisLabelZoom() {}
};
#endif // KIS_LABEL_ZOOM_H_
......
......@@ -19,12 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <q3button.h>
#include <qtoolbutton.h>
#include <qbrush.h>
#include <qfont.h>
#include <qfontmetrics.h>
#include <q3hbox.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpoint.h>
......@@ -35,10 +33,9 @@
#include <qwidget.h>
#include <qcombobox.h>
#include <qcheckbox.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <QVBoxLayout>
#include <QPixmap>
#include <Q3ValueList>
#include <QList>
#include <kdebug.h>
#include <kglobal.h>
......@@ -48,6 +45,7 @@
#include <kiconloader.h>
#include <kicontheme.h>
#include <klocale.h>
#include <khbox.h>
#include <KoPartSelectAction.h>
......@@ -66,13 +64,14 @@
#include "kis_layerbox.h"
KisLayerBox::KisLayerBox(KisCanvasSubject *subject, QWidget *parent, const char *name)
: super(parent, name), m_image(0)
: super(parent), m_image(0)
{
Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
vbox->setAutoAdd(true);
setObjectName(name);
QVBoxLayout *vbox = new QVBoxLayout(this);
m_lst = new WdgLayerBox(this);
setMinimumSize(m_lst->minimumSizeHint());
vbox->addWidget(m_lst);
m_lst->bnAdd->setToolTip( i18n("Create new layer"));
......@@ -122,16 +121,16 @@ KisLayerBox::KisLayerBox(KisCanvasSubject *subject, QWidget *parent, const char
SLOT(slotRequestLayerProperties(LayerItem*)));
m_newLayerMenu = new KMenu(this);
m_lst->bnAdd->setPopup(m_newLayerMenu);
m_lst->bnAdd->setPopupDelay(1);
m_newLayerMenu->insertItem( SmallIconSet( "filenew" ), i18n( "&New Layer..." ), PAINT_LAYER );
m_newLayerMenu->insertItem( SmallIconSet( "folder" ), i18n( "New &Group Layer..." ), GROUP_LAYER );
m_newLayerMenu->insertItem( SmallIconSet( "tool_filter" ), i18n( "New &Adjustment Layer..." ), ADJUSTMENT_LAYER );
m_partLayerAction = new KoPartSelectAction( i18n( "New &Object Layer" ), "gear" /*, this - KDE4*/);
m_partLayerAction->plug( m_newLayerMenu );
connect(m_partLayerAction, SIGNAL(activated()), this, SLOT(slotAddMenuActivated()));
connect(m_newLayerMenu, SIGNAL(activated(int)), this, SLOT(slotAddMenuActivated(int)));
m_lst->bnAdd->setMenu(m_newLayerMenu);
m_lst->bnAdd->setPopupMode(QToolButton::InstantPopup);
m_newLayerMenu->addAction(SmallIconSet( "filenew" ), i18n( "&New Layer..." ), this, SLOT(slotNewLayer()));
m_newLayerMenu->addAction(SmallIconSet( "folder" ), i18n( "New &Group Layer..." ), this, SLOT(slotNewGroupLayer()));
m_newLayerMenu->addAction(SmallIconSet( "tool_filter" ), i18n( "New &Adjustment Layer..." ), this, SLOT(slotNewAdjustmentLayer()));
m_partLayerAction = new KoPartSelectAction( i18n( "New &Object Layer" ), "gear" /*, this - KDE4*/);
m_newLayerMenu->addAction(m_partLayerAction);
connect(m_partLayerAction, SIGNAL(triggered()), this, SLOT(slotNewPartLayer()));
connect(m_lst->bnDelete, SIGNAL(clicked()), SLOT(slotRmClicked()));
connect(m_lst->bnRaise, SIGNAL(clicked()), SLOT(slotRaiseClicked()));
......@@ -226,7 +225,7 @@ void KisLayerBox::slotLayerAdded(KisLayerSP layer)
void KisLayerBox::slotLayerRemoved(KisLayerSP layer, KisGroupLayerSP wasParent, KisLayerSP)
{
list()->removeLayer(layer->id());
m_modified.remove(layer->id());
m_modified.removeAll(layer->id());
markModified(wasParent.data());
updateUI();
}
......@@ -462,14 +461,9 @@ void KisLayerBox::clear()
updateUI();
}
void KisLayerBox::slotAddMenuActivated(int type)
void KisLayerBox::getNewLayerLocation(KisGroupLayerSP &parent, KisLayerSP &above)
{
if(type == -1)
return;
KisGroupLayerSP root = m_image->rootLayer();
KisGroupLayerSP parent;
KisLayerSP above;
if (KisLayerSP active = m_image->activeLayer())
{
parent = root;
......@@ -482,27 +476,51 @@ void KisLayerBox::slotAddMenuActivated(int type)
parent = root;
above = m_image->rootLayer()->firstChild();
}
}
switch (type)
{
case PAINT_LAYER:
emit sigRequestLayer(parent, above);
break;
case GROUP_LAYER:
emit sigRequestGroupLayer(parent, above);
break;
case ADJUSTMENT_LAYER:
emit sigRequestAdjustmentLayer(parent, above);
break;
case OBJECT_LAYER:
default: //goddamned Qt doesn't emit activated for default-assigned IDs, so this does nothing
emit sigRequestPartLayer(parent, above, m_partLayerAction->documentEntry());
}
void KisLayerBox::slotNewLayer()
{
KisGroupLayerSP parent;
KisLayerSP above;
getNewLayerLocation(parent, above);
emit sigRequestLayer(parent, above);
}
void KisLayerBox::slotNewGroupLayer()
{
KisGroupLayerSP parent;
KisLayerSP above;
getNewLayerLocation(parent, above);
emit sigRequestGroupLayer(parent, above);
}
void KisLayerBox::slotNewAdjustmentLayer()
{
KisGroupLayerSP parent;
KisLayerSP above;
getNewLayerLocation(parent, above);
emit sigRequestAdjustmentLayer(parent, above);
}
void KisLayerBox::slotNewPartLayer()
{
KisGroupLayerSP parent;
KisLayerSP above;
getNewLayerLocation(parent, above);
emit sigRequestPartLayer(parent, above, m_partLayerAction->documentEntry());
}
void KisLayerBox::slotRmClicked()
{
Q3ValueList<int> l = list()->selectedLayerIDs();
QList<int> l = list()->selectedLayerIDs();
if (l.count() < 2 && list()->activeLayer() && !l.contains(list()->activeLayer()->id()))
{
l.clear();
......@@ -511,14 +529,14 @@ void KisLayerBox::slotRmClicked()
for (int i = 0, n = l.count(); i < n; ++i)
{
m_modified.remove(l[i]);
m_modified.removeAll(l[i]);
m_image->removeLayer(m_image->findLayer(l[i]));
}
}
void KisLayerBox::slotRaiseClicked()
{
Q3ValueList<int> l = list()->selectedLayerIDs();
QList<int> l = list()->selectedLayerIDs();
if (l.count() < 2 && list()->activeLayer() && !l.contains(list()->activeLayer()->id()))
{
l.clear();
......@@ -545,7 +563,7 @@ void KisLayerBox::slotRaiseClicked()
void KisLayerBox::slotLowerClicked()
{
Q3ValueList<LayerItem*> l = list()->selectedLayers();
QList<LayerItem*> l = list()->selectedLayers();
if (l.count() < 2 && list()->activeLayer() && !l.contains(list()->activeLayer()))
{
l.clear();
......@@ -609,7 +627,7 @@ void KisLayerBox::markModified(KisLayer* layer)
if( !layer )
return;
Q3ValueList<int> v;
QList<int> v;
while (layer && layer != m_image->rootLayer().data())
{
v.append(layer->id());
......
......@@ -22,18 +22,17 @@
#ifndef KIS_LAYERBOX_H
#define KIS_LAYERBOX_H
#include <q3frame.h>
//Added by qt3to4:
#include <QFrame>
#include <QPixmap>
#include <Q3ValueList>
#include <kdebug.h>
#include <QList>
#include <qtimer.h>
#include <kdebug.h>
#include "kis_types.h"
#include "kis_colorspace.h"
class WdgLayerBox;
class Q3Button;
class QPainter;
class QWidget;
class KIconLoader;
......@@ -44,8 +43,8 @@ class KisLayerList;
class LayerItem;
class KisCanvasSubject;
class KisLayerBox : public Q3Frame {
typedef Q3Frame super;
class KisLayerBox : public QFrame {
typedef QFrame super;
Q_OBJECT
public:
......@@ -98,12 +97,16 @@ private slots:
void slotRequestLayerProperties(LayerItem* layer);
void slotAboutToShow();
void slotAddMenuActivated(int type = OBJECT_LAYER);
void slotRmClicked();
void slotRaiseClicked();
void slotLowerClicked();
void slotPropertiesClicked();
void slotNewLayer();
void slotNewGroupLayer();
void slotNewAdjustmentLayer();
void slotNewPartLayer();
void updateThumbnails();
private:
......@@ -111,11 +114,12 @@ private:
QPixmap loadPixmap(const QString& filename, const KIconLoader& il, int size);
KisLayerList* list() const;
void markModified(KisLayer *layer);
void getNewLayerLocation(KisGroupLayerSP &parent, KisLayerSP &above);
KMenu *m_newLayerMenu;
KoPartSelectAction *m_partLayerAction;
KisImageSP m_image;
Q3ValueList<int> m_modified;
QList<int> m_modified;
WdgLayerBox *m_lst;
void printKritaLayers() const;
......
......@@ -80,7 +80,7 @@ void KisLayerList::constructMenu( LayerItem *layer )
void KisLayerList::menuActivated( int id, LayerItem *layer )
{
const Q3ValueList<LayerItem*> selected = selectedLayers();
const QList<LayerItem*> selected = selectedLayers();
LayerItem *parent = ( layer && layer->isFolder() ) ? layer : 0;
LayerItem *after = 0;
if( layer && !parent )
......@@ -104,7 +104,7 @@ void KisLayerList::menuActivated( int id, LayerItem *layer )
break;
case MenuItems::RemoveLayer:
{
Q3ValueList<int> ids;
QList<int> ids;
for( int i = 0, n = selected.count(); i < n; ++i )
{
ids.append( selected[i]->id() );
......
......@@ -21,8 +21,7 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qcheckbox.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <QVBoxLayout>
#include <klocale.h>
......@@ -34,24 +33,26 @@ KisBoolWidgetParam::KisBoolWidgetParam( bool ninitvalue, QString nlabel, QStrin
}
KisMultiBoolFilterWidget::KisMultiBoolFilterWidget(QWidget * parent, const char * name, const char * caption, vKisBoolWidgetParam iwparam) :
KisMultiBoolFilterWidget::KisMultiBoolFilterWidget(QWidget * parent, const char * name, const char * caption, vKisBoolWidgetParam iwparam) :
KisFilterConfigWidget( parent, name )
{
qint32 m_nbboolWidgets = iwparam.size();
this->setCaption(caption);
this->setWindowTitle(caption);
Q3VBoxLayout *widgetLayout = new Q3VBoxLayout(this, m_nbboolWidgets + 1);
QVBoxLayout *widgetLayout = new QVBoxLayout(this);
widgetLayout->setMargin(m_nbboolWidgets + 1);
m_boolWidgets = new QCheckBox*[ m_nbboolWidgets ];
for( qint32 i = 0; i < m_nbboolWidgets; ++i)
{
m_boolWidgets[i] = new QCheckBox( this, iwparam[i].name.ascii());
m_boolWidgets[i]->setChecked( iwparam[i].initvalue );
m_boolWidgets[i]->setText( iwparam[i].label );
m_boolWidgets[i] = new QCheckBox(this);
m_boolWidgets[i]->setObjectName(iwparam[i].name);
m_boolWidgets[i]->setChecked(iwparam[i].initvalue);
m_boolWidgets[i]->setText(iwparam[i].label);
connect(m_boolWidgets[i], SIGNAL(toggled( bool ) ), SIGNAL(sigPleaseUpdatePreview()));
widgetLayout->add( m_boolWidgets[i]);
widgetLayout->addWidget(m_boolWidgets[i]);
}
// QSpacerItem * sp = new QSpacerItem(1, 1);
widgetLayout->addStretch();
......@@ -60,9 +61,9 @@ KisMultiBoolFilterWidget::KisMultiBoolFilterWidget(QWidget * parent, const char
void KisMultiBoolFilterWidget::setConfiguration(KisFilterConfiguration * config)
{
for (int i = 0; i < m_nbboolWidgets; ++i) {
double val = config->getBool(m_boolWidgets[i]->name());
double val = config->getBool(m_boolWidgets[i]->objectName());
m_boolWidgets[i]->setChecked(val);
}
}
......
......@@ -21,25 +21,26 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
//Added by qt3to4:
#include <Q3GridLayout>
#include <QGridLayout>
#include <knuminput.h>
#include <kis_filter_config_widget.h>
#include <klocale.h>
KisDelayedActionDoubleInput::KisDelayedActionDoubleInput(QWidget * parent, const char * name)
KisDelayedActionDoubleInput::KisDelayedActionDoubleInput(QWidget * parent, QString name)
: KDoubleNumInput(parent)
{
setObjectName(name);
m_timer = new QTimer(this, name);
m_timer = new QTimer(this);
m_timer->setObjectName(name);
m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), SLOT(slotValueChanged()));
connect(this, SIGNAL(valueChanged( double )), SLOT(slotTimeToUpdate()));
}
void KisDelayedActionDoubleInput::slotTimeToUpdate()
{
m_timer->start(50, true);
m_timer->start(50);
}
void KisDelayedActionDoubleInput::slotValueChanged()
......@@ -67,16 +68,16 @@ KisMultiDoubleFilterWidget::KisMultiDoubleFilterWidget(QWidget * parent, const c
{
qint32 m_nbdoubleWidgets = dwparam.size();
this->setCaption(caption);
this->setWindowTitle(caption);
Q3GridLayout *widgetLayout = new Q3GridLayout(this, m_nbdoubleWidgets + 1, 3);
widgetLayout->setColStretch ( 1, 1 );
QGridLayout *widgetLayout = new QGridLayout(this);
widgetLayout->setColumnStretch(1, 1);
m_doubleWidgets = new KisDelayedActionDoubleInput*[ m_nbdoubleWidgets ];
for( qint32 i = 0; i < m_nbdoubleWidgets; ++i)
{
m_doubleWidgets[i] = new KisDelayedActionDoubleInput(this, dwparam[i].name.ascii());
m_doubleWidgets[i] = new KisDelayedActionDoubleInput(this, dwparam[i].name);
m_doubleWidgets[i]->setRange( dwparam[i].min, dwparam[i].max );
m_doubleWidgets[i]->setValue( dwparam[i].initvalue );
m_doubleWidgets[i]->cancelDelayedSignal();
......@@ -95,9 +96,9 @@ KisMultiDoubleFilterWidget::KisMultiDoubleFilterWidget(QWidget * parent, const c
void KisMultiDoubleFilterWidget::setConfiguration(KisFilterConfiguration * config)
{
for (int i = 0; i < m_nbdoubleWidgets ; ++i) {
double val = config->getDouble(m_doubleWidgets[i]->name());
double val = config->getDouble(m_doubleWidgets[i]->objectName());
m_doubleWidgets[i]->setValue(val);
m_doubleWidgets[i]->cancelDelayedSignal();
}
......
......@@ -26,26 +26,23 @@
class KisDelayedActionDoubleInput : public KDoubleNumInput
{
Q_OBJECT
public:
KisDelayedActionDoubleInput(QWidget * parent, const char * name);
void cancelDelayedSignal();
public:
KisDelayedActionDoubleInput(QWidget * parent, QString name);
void cancelDelayedSignal();
private slots:
void slotValueChanged();
void slotTimeToUpdate();
private slots:
void slotValueChanged();
void slotTimeToUpdate();
signals:
void valueChangedDelayed(double value);
private:
signals:
void valueChangedDelayed(double value);
private:
QTimer * m_timer;
QTimer * m_timer;
};
......
......@@ -21,29 +21,30 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
//Added by qt3to4:
#include <Q3GridLayout>
#include <QGridLayout>
#include <knuminput.h>
#include <klocale.h>
KisDelayedActionIntegerInput::KisDelayedActionIntegerInput(QWidget * parent, const char * name)
KisDelayedActionIntegerInput::KisDelayedActionIntegerInput(QWidget * parent, QString name)
: KIntNumInput(parent)
{
setObjectName(name);
m_timer = new QTimer(this, name);
m_timer = new QTimer(this);
m_timer->setObjectName(name);
m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), SLOT(slotValueChanged()));