• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
TileLevelRangeWidget.cpp
Go to the documentation of this file.
1 // This library is free software; you can redistribute it and/or
2 // modify it under the terms of the GNU Lesser General Public
3 // License as published by the Free Software Foundation; either
4 // version 2.1 of the License, or (at your option) any later version.
5 //
6 // This library is distributed in the hope that it will be useful,
7 // but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 // Lesser General Public License for more details.
10 //
11 // You should have received a copy of the GNU Lesser General Public
12 // License along with this library. If not, see <http://www.gnu.org/licenses/>.
13 
14 #include "TileLevelRangeWidget.h"
15 
16 #include "ui_TileLevelRangeWidget.h"
17 
18 namespace Marble
19 {
20 
21 class TileLevelRangeWidget::Private
22 {
23 public:
24  explicit Private( QWidget * const parent );
25  Ui::TileLevelRangeWidget m_ui;
26 };
27 
28 TileLevelRangeWidget::Private::Private( QWidget * const parent )
29 {
30  m_ui.setupUi( parent );
31 }
32 
33 TileLevelRangeWidget::TileLevelRangeWidget( QWidget * const parent, Qt::WindowFlags const f )
34  : QWidget( parent, f ),
35  d( new Private( this ))
36 {
37  connect( d->m_ui.topSpinBox, SIGNAL(valueChanged(int)), SIGNAL(topLevelChanged(int)));
38  connect( d->m_ui.bottomSpinBox, SIGNAL(valueChanged(int)),
39  SIGNAL(bottomLevelChanged(int)));
40 
41  connect( d->m_ui.topSpinBox, SIGNAL(valueChanged(int)), SLOT(setMinimumBottomLevel(int)));
42  connect( d->m_ui.bottomSpinBox, SIGNAL(valueChanged(int)), SLOT(setMaximumTopLevel(int)));
43 }
44 
45 TileLevelRangeWidget::~TileLevelRangeWidget()
46 {
47  delete d;
48 }
49 
50 QSize TileLevelRangeWidget::sizeHint() const
51 {
52  return size();
53 }
54 
55 void TileLevelRangeWidget::setAllowedLevelRange( int const minimumLevel, int const maximumLevel )
56 {
57  d->m_ui.topSpinBox->setRange( minimumLevel, qMin( d->m_ui.bottomSpinBox->value(),
58  maximumLevel ));
59  d->m_ui.bottomSpinBox->setRange( qMax( d->m_ui.topSpinBox->value(), minimumLevel ),
60  maximumLevel );
61 }
62 
63 void TileLevelRangeWidget::setDefaultLevel( int const level )
64 {
65  d->m_ui.topSpinBox->setValue( level );
66  d->m_ui.bottomSpinBox->setValue( level );
67 }
68 
69 int TileLevelRangeWidget::bottomLevel() const
70 {
71  return d->m_ui.bottomSpinBox->value();
72 }
73 
74 int TileLevelRangeWidget::topLevel() const
75 {
76  return d->m_ui.topSpinBox->value();
77 }
78 
79 void TileLevelRangeWidget::setMaximumTopLevel( int const level )
80 {
81  d->m_ui.topSpinBox->setMaximum( level );
82 }
83 
84 void TileLevelRangeWidget::setMinimumBottomLevel( int const level )
85 {
86  d->m_ui.bottomSpinBox->setMinimum( level );
87 }
88 
89 }
90 
91 #include "TileLevelRangeWidget.moc"
QWidget
Marble::TileLevelRangeWidget::TileLevelRangeWidget
TileLevelRangeWidget(QWidget *const parent=0, Qt::WindowFlags const f=0)
Definition: TileLevelRangeWidget.cpp:33
Marble::TileLevelRangeWidget::topLevel
int topLevel() const
Definition: TileLevelRangeWidget.cpp:74
Marble::TileLevelRangeWidget::topLevelChanged
void topLevelChanged(int)
TileLevelRangeWidget.h
Marble::TileLevelRangeWidget::sizeHint
virtual QSize sizeHint() const
Definition: TileLevelRangeWidget.cpp:50
Marble::TileLevelRangeWidget::~TileLevelRangeWidget
~TileLevelRangeWidget()
Definition: TileLevelRangeWidget.cpp:45
Marble::TileLevelRangeWidget::bottomLevelChanged
void bottomLevelChanged(int)
Marble::TileLevelRangeWidget::setDefaultLevel
void setDefaultLevel(int const )
Definition: TileLevelRangeWidget.cpp:63
Marble::TileLevelRangeWidget::setAllowedLevelRange
void setAllowedLevelRange(int const minimumLevel, int const maximumLevel)
Definition: TileLevelRangeWidget.cpp:55
Marble::TileLevelRangeWidget::bottomLevel
int bottomLevel() const
Definition: TileLevelRangeWidget.cpp:69
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal