Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
864a3c9d
Commit
864a3c9d
authored
Jul 20, 2011
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on home location improvements
parent
ea251119
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
homeitem.cpp
src/libs/opmapcontrol/src/mapwidget/homeitem.cpp
+19
-0
QGCMapTool.cc
src/ui/map/QGCMapTool.cc
+9
-1
QGCMapTool.h
src/ui/map/QGCMapTool.h
+4
-0
No files found.
src/libs/opmapcontrol/src/mapwidget/homeitem.cpp
View file @
864a3c9d
...
@@ -36,6 +36,10 @@ namespace mapcontrol
...
@@ -36,6 +36,10 @@ namespace mapcontrol
this
->
setPos
(
localposition
.
X
(),
localposition
.
Y
());
this
->
setPos
(
localposition
.
X
(),
localposition
.
Y
());
this
->
setZValue
(
4
);
this
->
setZValue
(
4
);
coord
=
internals
::
PointLatLng
(
50
,
50
);
coord
=
internals
::
PointLatLng
(
50
,
50
);
// this->setFlag(QGraphicsItem::ItemIsMovable,true);
// this->setFlag(QGraphicsItem::ItemIgnoresTransformations,true);
// this->setFlag(QGraphicsItem::ItemIsSelectable,true);
}
}
void
HomeItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
HomeItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
...
@@ -77,4 +81,19 @@ namespace mapcontrol
...
@@ -77,4 +81,19 @@ namespace mapcontrol
}
}
// void HomeItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
// {
// if(event->button()==Qt::LeftButton)
// {
// coord=map->FromLocalToLatLng(this->pos().x(),this->pos().y());
// QString coord_str = " " + QString::number(coord.Lat(), 'f', 6) + " " + QString::number(coord.Lng(), 'f', 6);
// qDebug() << "WP MOVE:" << coord_str << __FILE__ << __LINE__;
// isDragging=false;
// RefreshToolTip();
// emit WPValuesChanged(this);
// }
// QGraphicsItem::mouseReleaseEvent(event);
// }
}
}
src/ui/map/QGCMapTool.cc
View file @
864a3c9d
...
@@ -14,7 +14,15 @@ QGCMapTool::QGCMapTool(QWidget *parent) :
...
@@ -14,7 +14,15 @@ QGCMapTool::QGCMapTool(QWidget *parent) :
ui
->
zoomSlider
->
setMaximum
(
ui
->
map
->
MaxZoom
());
ui
->
zoomSlider
->
setMaximum
(
ui
->
map
->
MaxZoom
());
ui
->
zoomSlider
->
setValue
(
ui
->
map
->
ZoomReal
());
ui
->
zoomSlider
->
setValue
(
ui
->
map
->
ZoomReal
());
connect
(
ui
->
zoomSlider
,
SIGNAL
(
valueChanged
(
int
)),
ui
->
map
,
SLOT
(
SetZoom
(
int
)));
connect
(
ui
->
zoomSlider
,
SIGNAL
(
valueChanged
(
int
)),
ui
->
map
,
SLOT
(
SetZoom
(
int
)));
connect
(
ui
->
map
,
SIGNAL
(
zoomChanged
(
int
)),
ui
->
zoomSlider
,
SLOT
(
setValue
(
int
)));
connect
(
ui
->
map
,
SIGNAL
(
zoomChanged
(
int
)),
this
,
SLOT
(
setZoom
(
int
)));
}
void
QGCMapTool
::
setZoom
(
int
zoom
)
{
if
(
ui
->
zoomSlider
->
value
()
!=
zoom
)
{
ui
->
zoomSlider
->
setValue
(
zoom
);
}
}
}
QGCMapTool
::~
QGCMapTool
()
QGCMapTool
::~
QGCMapTool
()
...
...
src/ui/map/QGCMapTool.h
View file @
864a3c9d
...
@@ -15,6 +15,10 @@ public:
...
@@ -15,6 +15,10 @@ public:
explicit
QGCMapTool
(
QWidget
*
parent
=
0
);
explicit
QGCMapTool
(
QWidget
*
parent
=
0
);
~
QGCMapTool
();
~
QGCMapTool
();
public
slots
:
/** @brief Update slider zoom from map change */
void
setZoom
(
int
zoom
);
private:
private:
Ui
::
QGCMapTool
*
ui
;
Ui
::
QGCMapTool
*
ui
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment