3 #include "TileLevelRangeWidget.h"
5 #include "ui_TileLevelRangeWidget.h"
10 class Q_DECL_HIDDEN TileLevelRangeWidget::Private
13 explicit Private(
QWidget *
const parent );
14 Ui::TileLevelRangeWidget m_ui;
17 TileLevelRangeWidget::Private::Private(
QWidget *
const parent )
19 m_ui.setupUi( parent );
24 d( new Private( this ))
26 connect( d->m_ui.topSpinBox, SIGNAL(valueChanged(
int)), SIGNAL(topLevelChanged(
int)));
27 connect( d->m_ui.bottomSpinBox, SIGNAL(valueChanged(
int)),
28 SIGNAL(bottomLevelChanged(
int)));
30 connect( d->m_ui.topSpinBox, SIGNAL(valueChanged(
int)), SLOT(setMinimumBottomLevel(
int)));
31 connect( d->m_ui.bottomSpinBox, SIGNAL(valueChanged(
int)), SLOT(setMaximumTopLevel(
int)));
34 TileLevelRangeWidget::~TileLevelRangeWidget()
39 QSize TileLevelRangeWidget::sizeHint()
const
44 void TileLevelRangeWidget::setAllowedLevelRange(
int const minimumLevel,
int const maximumLevel )
46 d->m_ui.topSpinBox->setRange( minimumLevel, qMin( d->m_ui.bottomSpinBox->value(),
48 d->m_ui.bottomSpinBox->setRange( qMax( d->m_ui.topSpinBox->value(), minimumLevel ),
52 void TileLevelRangeWidget::setDefaultLevel(
int const level )
54 d->m_ui.topSpinBox->setValue( level );
55 d->m_ui.bottomSpinBox->setValue( level );
58 int TileLevelRangeWidget::bottomLevel()
const
60 return d->m_ui.bottomSpinBox->value();
63 int TileLevelRangeWidget::topLevel()
const
65 return d->m_ui.topSpinBox->value();
68 void TileLevelRangeWidget::setMaximumTopLevel(
int const level )
70 d->m_ui.topSpinBox->setMaximum( level );
73 void TileLevelRangeWidget::setMinimumBottomLevel(
int const level )
75 d->m_ui.bottomSpinBox->setMinimum( level );
80 #include "moc_TileLevelRangeWidget.cpp"