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

marble/src

MarbleNavigator.cpp

Go to the documentation of this file.
00001 //
00002 // This file is part of the Marble Desktop Globe.
00003 //
00004 // This program is free software licensed under the GNU LGPL. You can
00005 // find a copy of this license in LICENSE.txt in the top directory of
00006 // the source code.
00007 //
00008 // Copyright 2005-2007 Torsten Rahn <tackat@kde.org>"
00009 // Copyright 2007      Inge Wallin   <ingwa@kde.org>"
00010 //
00011 
00012 
00013 #include "MarbleNavigator.h"
00014 
00015 #include <QtCore/QtAlgorithms>
00016 #include <QtCore/QDebug>
00017 #include <QtCore/QTimer>
00018 #include <QtGui/QStringListModel>
00019 
00020 #include "ui_MarbleNavigator.h"
00021 
00022 
00023 class MarbleNavigatorPrivate
00024 {
00025  public:
00026     int  m_minimumzoom;
00027 
00028     Ui::MarbleNavigator  uiWidget;
00029 };
00030 
00031 
00032 MarbleNavigator::MarbleNavigator( QWidget *parent )
00033     : QWidget( parent ),
00034       d( new MarbleNavigatorPrivate )
00035 
00036 {
00037     d->uiWidget.setupUi( this );
00038  
00039     d->m_minimumzoom = 950;
00040 
00041     setFocusPolicy( Qt::NoFocus );
00042 
00043     connect( d->uiWidget.goHomeButton,  SIGNAL( clicked() ), 
00044              this,                      SIGNAL( goHome() ) ); 
00045     connect( d->uiWidget.zoomSlider,    SIGNAL( valueChanged( int ) ),
00046              this,                      SIGNAL( zoomChanged( int ) ) ); 
00047     connect( d->uiWidget.zoomInButton,  SIGNAL( clicked() ),
00048              this,                      SIGNAL( zoomIn() ) ); 
00049     connect( d->uiWidget.zoomOutButton, SIGNAL( clicked() ),
00050              this,                      SIGNAL( zoomOut() ) ); 
00051 
00052     connect( d->uiWidget.moveLeftButton,  SIGNAL( clicked() ),
00053              this,                        SIGNAL( moveLeft() ) ); 
00054     connect( d->uiWidget.moveRightButton, SIGNAL( clicked() ),
00055              this,                        SIGNAL( moveRight() ) ); 
00056     connect( d->uiWidget.moveUpButton,    SIGNAL( clicked() ),
00057              this,                        SIGNAL( moveUp() ) ); 
00058     connect( d->uiWidget.moveDownButton,  SIGNAL( clicked() ),
00059              this,                        SIGNAL (moveDown() ) ); 
00060 }
00061 
00062 MarbleNavigator::~MarbleNavigator()
00063 {
00064     delete d;
00065 }
00066 
00067 
00068 int MarbleNavigator::minimumZoom() const
00069 {
00070     return d->m_minimumzoom;
00071 }
00072 
00073 
00074 void MarbleNavigator::changeZoom( int zoom )
00075 {
00076     // No infinite loops here
00077     // if (zoomSlider->value() != zoom)
00078     d->uiWidget.zoomSlider->setValue( zoom );
00079     d->uiWidget.zoomSlider->setMinimum( d->m_minimumzoom );
00080 }
00081 
00082 
00083 void MarbleNavigator::resizeEvent ( QResizeEvent * )
00084 {
00085 //            m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
00086 //                                           QSizePolicy::Fixed );
00087     if ( height() < 100 ) {
00088         if ( !d->uiWidget.zoomSlider->isHidden() ) {
00089             d->uiWidget.zoomSlider->hide();
00090             d->uiWidget.m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
00091                                                        QSizePolicy::Expanding );
00092         }
00093     } else {
00094         if ( d->uiWidget.zoomSlider->isHidden() ) {
00095             d->uiWidget.zoomSlider->show();
00096             d->uiWidget.m_pSpacerFrame->setSizePolicy( QSizePolicy::Preferred,
00097                                                        QSizePolicy::Fixed );
00098         }
00099     }
00100 } 
00101 
00102 
00103 #include "MarbleNavigator.moc"

marble/src

Skip menu "marble/src"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal