author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/knuminput.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/knuminput.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/knuminput.cpp | 61 |
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 @@ #include <qstyle.h> +//Added by qt3to4: +#include <QResizeEvent> +#include <QEvent> @@ -108,7 +111,7 @@ void KNumInput::setLabel(const QString & label, int a) else m_label = new QLabel(label, this, "KNumInput::QLabel"); - m_label->setAlignment((a & (~(AlignTop|AlignBottom|AlignVCenter))) - | AlignVCenter); + m_label->setAlignment((a & (~(Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + | Qt::AlignVCenter); // if no vertical alignment set, use Top alignment - if(!(a & (AlignTop|AlignBottom|AlignVCenter))) - a |= AlignTop; + if(!(a & (Qt::AlignTop|Qt::AlignBottom|Qt::AlignVCenter))) + a |= Qt::AlignTop; m_alignment = a; @@ -133,3 +136,3 @@ void KNumInput::layout(bool deep) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_colw1 = m_sizeLabel.width() + 4; @@ -204,3 +207,3 @@ KIntSpinBox::KIntSpinBox(QWidget *parent, const char *name) { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = 10; @@ -217,3 +220,3 @@ KIntSpinBox::KIntSpinBox(int lower, int upper, int step, int value, int base, { - editor()->setAlignment(AlignRight); + setAlignment(Qt::AlignRight); val_base = base; @@ -245,5 +248,5 @@ void KIntSpinBox::setEditFocus(bool mark) { - editor()->setFocus(); + setFocus(); if(mark) - editor()->selectAll(); + selectAll(); } @@ -327,3 +330,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) - step = m_spin->lineStep(); // maybe QRangeControl didn't like out lineStep? + step = m_spin->singleStep(); // maybe QRangeControl didn't like out lineStep? @@ -334,3 +337,3 @@ void KIntNumInput::setRange(int lower, int upper, int step, bool slider) m_slider = new QSlider(lower, upper, step, m_spin->value(), - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); @@ -360,3 +363,3 @@ void KIntNumInput::setMinValue(int min) { - setRange(min, m_spin->maxValue(), m_spin->lineStep(), m_slider); + setRange(min, m_spin->maxValue(), m_spin->singleStep(), m_slider); } @@ -370,3 +373,3 @@ void KIntNumInput::setMaxValue(int max) { - setRange(m_spin->minValue(), max, m_spin->lineStep(), m_slider); + setRange(m_spin->minValue(), max, m_spin->singleStep(), m_slider); } @@ -417,3 +420,3 @@ QSize KIntNumInput::minimumSizeHint() const // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); @@ -426,3 +429,3 @@ QSize KIntNumInput::minimumSizeHint() const - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -446,3 +449,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); @@ -451,3 +454,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeSpin.height()); @@ -462,3 +465,3 @@ void KIntNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); @@ -648,3 +651,3 @@ QSize KDoubleNumInput::minimumSizeHint() const // if in extra row, then count it here - if(m_label && (m_alignment & (AlignBottom|AlignTop))) + if(m_label && (m_alignment & (Qt::AlignBottom|Qt::AlignTop))) h += 4 + m_sizeLabel.height(); @@ -657,3 +660,3 @@ QSize KDoubleNumInput::minimumSizeHint() const - if(m_alignment & (AlignTop|AlignBottom)) + if(m_alignment & (Qt::AlignTop|Qt::AlignBottom)) w = QMAX(w, m_sizeLabel.width() + 4); @@ -668,3 +671,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignTop)) { + if(m_label && (m_alignment & Qt::AlignTop)) { m_label->setGeometry(0, 0, e->size().width(), m_sizeLabel.height()); @@ -673,3 +676,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignVCenter)) + if(m_label && (m_alignment & Qt::AlignVCenter)) m_label->setGeometry(0, 0, w, m_sizeEdit.height()); @@ -685,3 +688,3 @@ void KDoubleNumInput::resizeEvent(QResizeEvent* e) - if(m_label && (m_alignment & AlignBottom)) + if(m_label && (m_alignment & Qt::AlignBottom)) m_label->setGeometry(0, h, m_sizeLabel.width(), m_sizeLabel.height()); @@ -732,3 +735,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, int slvalue = spin->value(); - int slstep = spin->lineStep(); + int slstep = spin->singleStep(); if (m_slider) { @@ -739,3 +742,3 @@ void KDoubleNumInput::setRange(double lower, double upper, double step, m_slider = new QSlider(slmin, slmax, slstep, slvalue, - QSlider::Horizontal, this); + Qt::Horizontal, this); m_slider->setTickmarks(QSlider::Below); @@ -914,3 +917,3 @@ KDoubleSpinBox::KDoubleSpinBox( QWidget * parent, const char * name ) { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); @@ -924,3 +927,3 @@ KDoubleSpinBox::KDoubleSpinBox( double lower, double upper, double step, { - editor()->setAlignment( Qt::AlignRight ); + setAlignment( Qt::AlignRight ); d = new Private(); @@ -1029,3 +1032,3 @@ void KDoubleSpinBox::setMaxValue( double value ) { double KDoubleSpinBox::lineStep() const { - return d->mapToDouble( base::lineStep() ); + return d->mapToDouble( base::singleStep() ); } @@ -1074,3 +1077,3 @@ void KDoubleSpinBox::updateValidator() { this, "d->mValidator" ); - base::setValidator( d->mValidator ); + lineEdit()->setValidator( d->mValidator ); } else |