• 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
  • examples
  • qml
  • explore
explore.qml
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 2010 Dennis Nienhüser <earthwings@gentoo.org>
9 //
10 
11 import Qt 4.7
12 import org.kde.edu.marble 0.11
13 
14 Rectangle {
15  id: screen
16  width: 600; height: 450
17 
18  SystemPalette { id: activePalette }
19 
20  Flipable {
21  id: flipable
22  width: screen.width
23  height: screen.height
24  scale: 1
25  z: 0
26  transformOrigin: "Center"
27  rotation: 0
28 
29  property int angle: 0
30  property bool flipped: false
31 
32  MapThemeManager {
33  id: themes
34  }
35 
36  MarbleSettings {
37  id: settings
38  }
39 
40  front:
41 
42  MarbleWidget {
43  id: map
44  width: flipable.width
45  height: flipable.height
46 
47  mapThemeId: settings.mapTheme
48  activeFloatItems: [ "compass", "scalebar", "progress" ]
49 
50  FloatButton {
51  id: configure
52  image: "configure.svg"
53  x: flipable.width - width - 10
54  y: flipable.height - height - 10;
55 
56  onClicked: flipable.flipped = !flipable.flipped
57  }
58 
59  FloatButton {
60  id: zoom_in
61  anchors.bottom: configure.top
62  image: "zoom-in.svg"
63  x: flipable.width - width - 10
64 
65  onClicked: map.zoomIn()
66  }
67 
68  FloatButton {
69  id: zoom_out
70  anchors.bottom: zoom_in.top
71 
72  image: "zoom-out.svg"
73  x: flipable.width - width - 10
74 
75  onClicked: map.zoomOut()
76  }
77 
78  Component.onCompleted: {
79  map.center.longitude = settings.quitLongitude
80  map.center.latitude = settings.quitLatitude
81  map.radius = settings.quitRadius
82  }
83  }
84 
85  back:
86 
87  Rectangle {
88  x: 0; y:0
89  width: screen.width;
90  height: screen.height;
91  color: "black"
92 
93  Component {
94  id: delegate
95  Item {
96  id: wrapper
97  width: 128+10; height: 128+25
98  Column {
99  x: 5; y: 10
100  Image {
101  id: mapimaged
102  width: 128; height: 128;
103  source: "image://maptheme/" + model.modelData.id
104  }
105  Text {
106  width: parent.width
107  anchors.left: model.modelData.name.right
108  text: model.modelData.name;
109  font.pointSize: 8
110  horizontalAlignment: "AlignHCenter"
111  color: "white"
112  }
113  }
114  }
115  }
116  // Define a highlight component. Just one of these will be instantiated
117  // by each ListView and placed behind the current item.
118  Component {
119  id: highlight
120  Rectangle {
121  color: "lightsteelblue"
122  radius: 5
123  }
124  }
125  // The actual list
126  GridView {
127  id: mapListView
128  width: parent.width; height: parent.height - flipback.height - 30
129  cellWidth: 130; cellHeight: 150
130  model: themes.mapThemes()
131  delegate: delegate
132  highlight: highlight
133  focus: true
134  clip: true
135  //orientation: "Horizontal"
136 
137  MouseArea {
138  id: maplistarea
139  anchors.fill: parent
140 
141  onClicked: {
142  var x = maplistarea.mouseX + mapListView.contentX
143  var y = maplistarea.mouseY + mapListView.contentY
144  mapListView.currentIndex = mapListView.indexAt( x, y )
145  }
146  }
147 
148  Rectangle {
149  opacity: 0.5;
150  anchors.top: mapListView.bottom;
151  height: 6
152  x: mapListView.visibleArea.xPosition * mapListView.width
153  width: mapListView.visibleArea.widthRatio * mapListView.width
154  color: "black"
155  }
156  }
157 
158  FloatButton {
159  id: flipback
160  image: "flipback.svg"
161  x: 10
162  y: flipable.height - height - 10;
163 
164  onClicked: {
165  // First go back, then apply changes
166  flipable.flipped = !flipable.flipped
167 
168  map.mapThemeId = themes.mapThemes()[mapListView.currentIndex].id
169  }
170  }
171  }
172 
173  transform: Rotation {
174  origin.x: flipable.width/2
175  origin.y: flipable.height/2
176  axis.x: 1; axis.y:0; axis.z: 0 // rotate around y-axis
177  angle: flipable.angle
178  }
179 
180  states: State {
181  name: "back"
182  PropertyChanges { target: flipable; angle: 180 }
183  when: flipable.flipped
184  }
185 
186  transitions: Transition {
187  NumberAnimation { properties: "angle"; duration: 400 }
188  }
189  }
190 }
angle
double angle(double vec1[3], double vec2[3])
Definition: sgp4ext.cpp:164
MapThemeManager
Provides access to all map themes installed locally.
Definition: DeclarativeMapThemeManager.h:40
FloatButton
Definition: explore/FloatButton.qml:11
Rectangle
MarbleSettings
Definition: settings.h:13
Item
MarbleWidget
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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