• 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
MarbleNavigator.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2005-2007 Torsten Rahn <tackat@kde.org>
9 // Copyright 2007 Inge Wallin <ingwa@kde.org>
10 //
11 
12 
13 #include "MarbleNavigator.h"
14 
15 #include <QtAlgorithms>
16 #include <QTimer>
17 #include <QStringListModel>
18 
19 #include "MarbleDebug.h"
20 
21 #include "ui_MarbleNavigator.h"
22 
23 namespace Marble
24 {
25 
26 class MarbleNavigatorPrivate
27 {
28  public:
29  int m_minimumzoom;
30 
31  Ui::MarbleNavigator uiWidget;
32 };
33 
34 
35 MarbleNavigator::MarbleNavigator( QWidget *parent )
36  : QWidget( parent ),
37  d( new MarbleNavigatorPrivate )
38 
39 {
40  d->uiWidget.setupUi( this );
41 
42  d->m_minimumzoom = 950;
43 
44  setFocusPolicy( Qt::NoFocus );
45 
46  connect( d->uiWidget.goHomeButton, SIGNAL(clicked()),
47  this, SIGNAL(goHome()) );
48  connect( d->uiWidget.zoomSlider, SIGNAL(valueChanged(int)),
49  this, SIGNAL(zoomChanged(int)) );
50  connect( d->uiWidget.zoomInButton, SIGNAL(clicked()),
51  this, SIGNAL(zoomIn()) );
52  connect( d->uiWidget.zoomOutButton, SIGNAL(clicked()),
53  this, SIGNAL(zoomOut()) );
54 
55  connect( d->uiWidget.moveLeftButton, SIGNAL(clicked()),
56  this, SIGNAL(moveLeft()) );
57  connect( d->uiWidget.moveRightButton, SIGNAL(clicked()),
58  this, SIGNAL(moveRight()) );
59  connect( d->uiWidget.moveUpButton, SIGNAL(clicked()),
60  this, SIGNAL(moveUp()) );
61  connect( d->uiWidget.moveDownButton, SIGNAL(clicked()),
62  this, SIGNAL (moveDown()) );
63 }
64 
65 MarbleNavigator::~MarbleNavigator()
66 {
67  delete d;
68 }
69 
70 
71 int MarbleNavigator::minimumZoom() const
72 {
73  return d->m_minimumzoom;
74 }
75 
76 
77 void MarbleNavigator::changeZoom( int zoom )
78 {
79  // No infinite loops here
80  // if (zoomSlider->value() != zoom)
81  d->uiWidget.zoomSlider->setValue( zoom );
82  d->uiWidget.zoomSlider->setMinimum( d->m_minimumzoom );
83 }
84 
85 
86 void MarbleNavigator::resizeEvent ( QResizeEvent * )
87 {
88 // m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
89 // QSizePolicy::Fixed );
90  if ( height() < 100 ) {
91  if ( !d->uiWidget.zoomSlider->isHidden() ) {
92  d->uiWidget.zoomSlider->hide();
93  d->uiWidget.m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
94  QSizePolicy::Expanding );
95  }
96  } else {
97  if ( d->uiWidget.zoomSlider->isHidden() ) {
98  d->uiWidget.zoomSlider->show();
99  d->uiWidget.m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
100  QSizePolicy::Fixed );
101  }
102  }
103 }
104 
105 }
106 
107 #include "MarbleNavigator.moc"
Marble::MarbleNavigator::changeZoom
void changeZoom(int zoom)
Sets the value of the slider.
Definition: MarbleNavigator.cpp:77
Marble::MarbleNavigator::minimumZoom
int minimumZoom() const
Return the minimum zoom level set in the widget.
Definition: MarbleNavigator.cpp:71
Marble::MarbleNavigator::MarbleNavigator
MarbleNavigator(QWidget *parent=0)
Construct a new MarbleNavigator.
Definition: MarbleNavigator.cpp:35
QWidget
Marble::MarbleNavigator::moveUp
void moveUp()
Signal emitted when the Move Up button has been pressed.
MarbleDebug.h
Marble::MarbleNavigator::zoomChanged
void zoomChanged(int zoom)
Signal emitted when the zoom slider has been moved.
Marble::MarbleNavigator::moveLeft
void moveLeft()
Signal emitted when the Move Left button has been pressed.
Marble::MarbleNavigator::moveRight
void moveRight()
Signal emitted when the Move Right button has been pressed.
Marble::MarbleNavigator::zoomIn
void zoomIn()
Signal emitted when the Zoom In button has been pressed.
Marble::MarbleNavigator::zoomOut
void zoomOut()
Signal emitted when the Zoom Out button has been pressed.
MarbleNavigator.h
This file contains the header for MarbleNavigator.
Marble::MarbleNavigator::~MarbleNavigator
~MarbleNavigator()
Definition: MarbleNavigator.cpp:65
Marble::MarbleNavigator::resizeEvent
void resizeEvent(QResizeEvent *)
Reimplementation of the resizeEvent() of the widget.
Definition: MarbleNavigator.cpp:86
Marble::MarbleNavigator::goHome
void goHome()
Signal emitted when the Home button has been pressed.
Marble::MarbleNavigator::moveDown
void moveDown()
Signal emitted when the Move Down button has been pressed.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:51 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