summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/knuminput.cpp
Unidiff
Diffstat (limited to 'microkde/kdeui/knuminput.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdeui/knuminput.cpp61
1 files changed, 32 insertions, 29 deletions
diff --git a/microkde/kdeui/knuminput.cpp b/microkde/kdeui/knuminput.cpp
index 335d6f4..da01a20 100644
--- a/microkde/kdeui/knuminput.cpp
+++ b/microkde/kdeui/knuminput.cpp
@@ -44,2 +44,5 @@
44#include <qstyle.h> 44#include <qstyle.h>
45//Added by qt3to4:
46#include <QResizeEvent>
47#include <QEvent>
45 48
@@ -108,7 +111,7 @@ void KNumInput::setLabel(const QString & label, int a)
108 else m_label = new QLabel(label, this, "KNumInput::QLabel"); 111 else m_label = new QLabel(label, this, "KNumInput::QLabel");
109 m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) 112 m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter)))
110 | AlignVCenter); 113 | Qt::AlignVCenter);
111 // if no vertical alignment set, use Top alignment 114 // if no vertical alignment set, use Top alignment
112 if(!(a & (AlignTop|AlignBottom|AlignVCenter))) 115 if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter)))
113 a |= AlignTop; 116 a |= Qt::AlignTop;
114 m_alignment = a; 117 m_alignment = a;
@@ -133,3 +136,3 @@ void KNumInput::layout(bool deep)
133 136
134 if(m_label && (m_alignment & AlignVCenter)) 137 if(m_label && (m_alignment & Qt::AlignVCenter))
135 m_colw1 = m_sizeLabel.width() + 4; 138 m_colw1 = m_sizeLabel.width() + 4;
@@ -204,3 +207,3 @@ KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name)
204{ 207{
205 editor()->setAlignment(AlignRight); 208 setAlignment(Qt::AlignRight);
206 val_base = 10; 209 val_base = 10;
@@ -217,3 +220,3 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base,
217{ 220{
218 editor()->setAlignment(AlignRight); 221 setAlignment(Qt::AlignRight);
219 val_base = base; 222 val_base = base;
@@ -245,5 +248,5 @@ void KIntSpinBox::setEditFocus(bool mark)
245{ 248{
246 editor()->setFocus(); 249 setFocus();
247 if(mark) 250 if(mark)
248 editor()->selectAll(); 251 selectAll();
249} 252}
@@ -327,3 +330,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider)
327 330
328 step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? 331 step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep?
329 332
@@ -334,3 +337,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider)
334 m_slider = new QSlider(lower, upper, step, m_spin->value(), 337 m_slider = new QSlider(lower, upper, step, m_spin->value(),
335 QSlider::Horizontal, this); 338 Qt::Horizontal, this);
336 m_slider->setTickmarks(QSlider::Below); 339 m_slider->setTickmarks(QSlider::Below);
@@ -360,3 +363,3 @@ void KIntNumInput::setMinValue(int min)
360{ 363{
361 setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); 364 setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider);
362} 365}
@@ -370,3 +373,3 @@ void KIntNumInput::setMaxValue(int max)
370{ 373{
371 setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); 374 setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider);
372} 375}
@@ -417,3 +420,3 @@ QSize KIntNumInput::minimumSizeHint() const
417 // if in extra row, then count it here 420 // if in extra row, then count it here
418 if(m_label && (m_alignment & (AlignBottom|AlignTop))) 421 if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop)))
419 h += 4 + m_sizeLabel.height(); 422 h += 4 + m_sizeLabel.height();
@@ -426,3 +429,3 @@ QSize KIntNumInput::minimumSizeHint() const
426 429
427 if(m_alignment & (AlignTop|AlignBottom)) 430 if(m_alignment & (Qt::AlignTop|Qt::AlignBottom))
428 w = QMAX(w, m_sizeLabel.width() + 4); 431 w = QMAX(w, m_sizeLabel.width() + 4);
@@ -446,3 +449,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e)
446 449
447 if(m_label && (m_alignment & AlignTop)) { 450 if(m_label && (m_alignment & Qt::AlignTop)) {
448 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); 451 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height());
@@ -451,3 +454,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e)
451 454
452 if(m_label && (m_alignment & AlignVCenter)) 455 if(m_label && (m_alignment & Qt::AlignVCenter))
453 m_label->setGeometry(0, 0, w, m_sizeSpin.height()); 456 m_label->setGeometry(0, 0, w, m_sizeSpin.height());
@@ -462,3 +465,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e)
462 465
463 if(m_label && (m_alignment & AlignBottom)) 466 if(m_label && (m_alignment & Qt::AlignBottom))
464 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); 467 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height());
@@ -648,3 +651,3 @@ QSize KDoubleNumInput::minimumSizeHint() const
648 // if in extra row, then count it here 651 // if in extra row, then count it here
649 if(m_label && (m_alignment & (AlignBottom|AlignTop))) 652 if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop)))
650 h += 4 + m_sizeLabel.height(); 653 h += 4 + m_sizeLabel.height();
@@ -657,3 +660,3 @@ QSize KDoubleNumInput::minimumSizeHint() const
657 660
658 if(m_alignment & (AlignTop|AlignBottom)) 661 if(m_alignment & (Qt::AlignTop|Qt::AlignBottom))
659 w = QMAX(w, m_sizeLabel.width() + 4); 662 w = QMAX(w, m_sizeLabel.width() + 4);
@@ -668,3 +671,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e)
668 671
669 if(m_label && (m_alignment & AlignTop)) { 672 if(m_label && (m_alignment & Qt::AlignTop)) {
670 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); 673 m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height());
@@ -673,3 +676,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e)
673 676
674 if(m_label && (m_alignment & AlignVCenter)) 677 if(m_label && (m_alignment & Qt::AlignVCenter))
675 m_label->setGeometry(0, 0, w, m_sizeEdit.height()); 678 m_label->setGeometry(0, 0, w, m_sizeEdit.height());
@@ -685,3 +688,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e)
685 688
686 if(m_label && (m_alignment & AlignBottom)) 689 if(m_label && (m_alignment & Qt::AlignBottom))
687 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); 690 m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height());
@@ -732,3 +735,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step,
732 int slvalue = spin->value(); 735 int slvalue = spin->value();
733 int slstep = spin->lineStep(); 736 int slstep = spin->singleStep();
734 if (m_slider) { 737 if (m_slider) {
@@ -739,3 +742,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step,
739 m_slider = new QSlider(slmin, slmax, slstep, slvalue, 742 m_slider = new QSlider(slmin, slmax, slstep, slvalue,
740 QSlider::Horizontal, this); 743 Qt::Horizontal, this);
741 m_slider->setTickmarks(QSlider::Below); 744 m_slider->setTickmarks(QSlider::Below);
@@ -914,3 +917,3 @@ KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name )
914{ 917{
915 editor()->setAlignment( Qt::AlignRight ); 918 setAlignment( Qt::AlignRight );
916 d = new Private(); 919 d = new Private();
@@ -924,3 +927,3 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step,
924{ 927{
925 editor()->setAlignment( Qt::AlignRight ); 928 setAlignment( Qt::AlignRight );
926 d = new Private(); 929 d = new Private();
@@ -1029,3 +1032,3 @@ void KDoubleSpinBox::setMaxValue( double value ) {
1029double KDoubleSpinBox::lineStep() const { 1032double KDoubleSpinBox::lineStep() const {
1030 return d->mapToDouble( base::lineStep() ); 1033 return d->mapToDouble( base::singleStep() );
1031} 1034}
@@ -1074,3 +1077,3 @@ void KDoubleSpinBox::updateValidator() {
1074 this, "d->mValidator" ); 1077 this, "d->mValidator" );
1075 base::setValidator( d->mValidator ); 1078 lineEdit()->setValidator( d->mValidator );
1076 } else 1079 } else