mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-06 07:32:51 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
b212ccf594 | |||
a80de92691 | |||
17ab241a6d | |||
816e1d1768 | |||
50c768e12d | |||
72dda5fdd6 | |||
ee3a6adf2b | |||
56f15da550 | |||
61c82a0836 |
@ -64,7 +64,7 @@ Section "GPXSee (required)" SEC_APP
|
|||||||
; Write the uninstall keys for Windows
|
; Write the uninstall keys for Windows
|
||||||
WriteRegStr HKLM "${REGENTRY}" "DisplayName" "GPXSee"
|
WriteRegStr HKLM "${REGENTRY}" "DisplayName" "GPXSee"
|
||||||
WriteRegStr HKLM "${REGENTRY}" "Publisher" "Martin Tuma"
|
WriteRegStr HKLM "${REGENTRY}" "Publisher" "Martin Tuma"
|
||||||
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "2.8"
|
WriteRegStr HKLM "${REGENTRY}" "DisplayVersion" "2.9"
|
||||||
WriteRegStr HKLM "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
WriteRegStr HKLM "${REGENTRY}" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
||||||
WriteRegDWORD HKLM "${REGENTRY}" "NoModify" 1
|
WriteRegDWORD HKLM "${REGENTRY}" "NoModify" 1
|
||||||
WriteRegDWORD HKLM "${REGENTRY}" "NoRepair" 1
|
WriteRegDWORD HKLM "${REGENTRY}" "NoRepair" 1
|
||||||
|
@ -147,7 +147,7 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF AxisItem::margin()
|
QSizeF AxisItem::margin() const
|
||||||
{
|
{
|
||||||
QFont font;
|
QFont font;
|
||||||
font.setPixelSize(FONT_SIZE);
|
font.setPixelSize(FONT_SIZE);
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
void setSize(qreal size);
|
void setSize(qreal size);
|
||||||
void setLabel(const QString& label);
|
void setLabel(const QString& label);
|
||||||
|
|
||||||
QSizeF margin();
|
QSizeF margin() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateBoundingRect();
|
void updateBoundingRect();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#define APP_NAME "GPXSee"
|
#define APP_NAME "GPXSee"
|
||||||
#define APP_HOMEPAGE "http://tumic.wz.cz/gpxsee"
|
#define APP_HOMEPAGE "http://tumic.wz.cz/gpxsee"
|
||||||
#define APP_VERSION "2.8"
|
#define APP_VERSION "2.9"
|
||||||
|
|
||||||
#define FONT_FAMILY "Arial"
|
#define FONT_FAMILY "Arial"
|
||||||
#define FONT_SIZE 12
|
#define FONT_SIZE 12
|
||||||
|
@ -16,6 +16,7 @@ ElevationGraph::ElevationGraph(QWidget *parent) : GraphView(parent)
|
|||||||
GraphView::setXUnits(tr("km"));
|
GraphView::setXUnits(tr("km"));
|
||||||
GraphView::setYUnits(tr("m"));
|
GraphView::setYUnits(tr("m"));
|
||||||
GraphView::setXScale(M2KM);
|
GraphView::setXScale(M2KM);
|
||||||
|
GraphView::setMinRange(50.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElevationGraph::addInfo()
|
void ElevationGraph::addInfo()
|
||||||
|
@ -41,12 +41,12 @@ void FileBrowser::setFilter(const QStringList &filter)
|
|||||||
reloadDirectory(_files.last().canonicalPath());
|
reloadDirectory(_files.last().canonicalPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileBrowser::isLast()
|
bool FileBrowser::isLast() const
|
||||||
{
|
{
|
||||||
return (_files.size() > 0 && _index == _files.size() - 1);
|
return (_files.size() > 0 && _index == _files.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FileBrowser::isFirst()
|
bool FileBrowser::isFirst() const
|
||||||
{
|
{
|
||||||
return (_files.size() > 0 && _index == 0);
|
return (_files.size() > 0 && _index == 0);
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ public:
|
|||||||
QString last();
|
QString last();
|
||||||
QString first();
|
QString first();
|
||||||
|
|
||||||
bool isLast();
|
bool isLast() const;
|
||||||
bool isFirst();
|
bool isFirst() const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void reloadDirectory(const QString &path);
|
void reloadDirectory(const QString &path);
|
||||||
|
@ -53,6 +53,7 @@ GraphView::GraphView(QWidget *parent)
|
|||||||
_yScale = 1;
|
_yScale = 1;
|
||||||
|
|
||||||
_precision = 0;
|
_precision = 0;
|
||||||
|
_minRange = 0.01;
|
||||||
}
|
}
|
||||||
|
|
||||||
GraphView::~GraphView()
|
GraphView::~GraphView()
|
||||||
@ -139,8 +140,9 @@ void GraphView::loadData(const QVector<QPointF> &data)
|
|||||||
updateBounds(data.at(0));
|
updateBounds(data.at(0));
|
||||||
path.moveTo(data.at(0).x(), -data.at(0).y());
|
path.moveTo(data.at(0).x(), -data.at(0).y());
|
||||||
for (int i = 1; i < data.size(); i++) {
|
for (int i = 1; i < data.size(); i++) {
|
||||||
path.lineTo(data.at(i).x(), -data.at(i).y());
|
const QPointF &p = data.at(i);
|
||||||
updateBounds(data.at(i));
|
path.lineTo(p.x(), -p.y());
|
||||||
|
updateBounds(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
pi = new QGraphicsPathItem(path);
|
pi = new QGraphicsPathItem(path);
|
||||||
@ -166,8 +168,9 @@ void GraphView::resize(const QSizeF &size)
|
|||||||
{
|
{
|
||||||
QRectF r;
|
QRectF r;
|
||||||
QSizeF mx, my;
|
QSizeF mx, my;
|
||||||
|
QPointF rx, ry;
|
||||||
QTransform transform;
|
QTransform transform;
|
||||||
qreal xs, ys;
|
qreal xs, ys, diff;
|
||||||
|
|
||||||
|
|
||||||
if (_xAxis->scene() == _scene)
|
if (_xAxis->scene() == _scene)
|
||||||
@ -182,11 +185,21 @@ void GraphView::resize(const QSizeF &size)
|
|||||||
for (int i = 0; i < _graphs.size(); i++)
|
for (int i = 0; i < _graphs.size(); i++)
|
||||||
_graphs.at(i)->resetTransform();
|
_graphs.at(i)->resetTransform();
|
||||||
|
|
||||||
_xAxis->setRange(QPointF(_xMin * _xScale, _xMax * _xScale));
|
rx = QPointF(_xMin * _xScale, _xMax * _xScale);
|
||||||
_yAxis->setRange(QPointF(_yMin * _yScale, _yMax * _yScale));
|
ry = QPointF(_yMin * _yScale, _yMax * _yScale);
|
||||||
|
if ((diff = ry.y() - ry.x()) < _minRange)
|
||||||
|
ry = QPointF(ry.x() - (_minRange/2 - diff/2),
|
||||||
|
ry.y() + (_minRange/2 - diff/2));
|
||||||
|
_xAxis->setRange(rx);
|
||||||
|
_yAxis->setRange(ry);
|
||||||
mx = _xAxis->margin();
|
mx = _xAxis->margin();
|
||||||
my = _yAxis->margin();
|
my = _yAxis->margin();
|
||||||
|
|
||||||
r = _scene->itemsBoundingRect();
|
r = _scene->itemsBoundingRect();
|
||||||
|
if (r.height() < _minRange)
|
||||||
|
r.adjust(0, -(_minRange/2 - r.height()/2), 0,
|
||||||
|
_minRange/2 - r.height()/2);
|
||||||
|
|
||||||
xs = (size.width() - (my.width() + mx.width())) / r.width();
|
xs = (size.width() - (my.width() + mx.width())) / r.width();
|
||||||
ys = (size.height() - (mx.height() + my.height())
|
ys = (size.height() - (mx.height() + my.height())
|
||||||
- _info->boundingRect().height()) / r.height();
|
- _info->boundingRect().height()) / r.height();
|
||||||
@ -196,6 +209,10 @@ void GraphView::resize(const QSizeF &size)
|
|||||||
_graphs.at(i)->setTransform(transform);
|
_graphs.at(i)->setTransform(transform);
|
||||||
|
|
||||||
r = _scene->itemsBoundingRect();
|
r = _scene->itemsBoundingRect();
|
||||||
|
if (r.height() < _minRange * ys)
|
||||||
|
r.adjust(0, -(_minRange/2 * ys - r.height()/2), 0,
|
||||||
|
(_minRange/2) * ys - r.height()/2);
|
||||||
|
|
||||||
_xAxis->setSize(r.width());
|
_xAxis->setSize(r.width());
|
||||||
_yAxis->setSize(r.height());
|
_yAxis->setSize(r.height());
|
||||||
_xAxis->setPos(r.bottomLeft());
|
_xAxis->setPos(r.bottomLeft());
|
||||||
@ -280,9 +297,12 @@ void GraphView::emitSliderPositionChanged(const QPointF &pos)
|
|||||||
emit sliderPositionChanged(val);
|
emit sliderPositionChanged(val);
|
||||||
|
|
||||||
const QPainterPath &path = _graphs.at(0)->path();
|
const QPainterPath &path = _graphs.at(0)->path();
|
||||||
|
QRectF br = path.boundingRect();
|
||||||
|
if (br.height() < _minRange)
|
||||||
|
br.adjust(0, -(_minRange/2 - br.height()/2), 0,
|
||||||
|
_minRange/2 - br.height()/2);
|
||||||
QPointF p = path.pointAtPercent(val);
|
QPointF p = path.pointAtPercent(val);
|
||||||
qreal r = (p.y() - path.boundingRect().bottom())
|
qreal r = (p.y() - br.bottom()) / br.height();
|
||||||
/ path.boundingRect().height();
|
|
||||||
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
|
_sliderInfo->setPos(QPointF(0, _slider->boundingRect().height() * r));
|
||||||
_sliderInfo->setText(QString::number(-p.y() * _yScale, 'f', _precision));
|
_sliderInfo->setText(QString::number(-p.y() * _yScale, 'f', _precision));
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ public:
|
|||||||
void setYUnits(const QString &units);
|
void setYUnits(const QString &units);
|
||||||
void setXScale(qreal scale);
|
void setXScale(qreal scale);
|
||||||
void setYScale(qreal scale);
|
void setYScale(qreal scale);
|
||||||
void setPrecision(int p) {_precision = p;}
|
void setPrecision(int precision) {_precision = precision;}
|
||||||
|
void setMinRange(qreal range) {_minRange = range;}
|
||||||
|
|
||||||
void redraw();
|
void redraw();
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ protected:
|
|||||||
QString _xUnits, _yUnits;
|
QString _xUnits, _yUnits;
|
||||||
QString _xLabel, _yLabel;
|
QString _xLabel, _yLabel;
|
||||||
int _precision;
|
int _precision;
|
||||||
|
qreal _minRange;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void emitSliderPositionChanged(const QPointF &pos);
|
void emitSliderPositionChanged(const QPointF &pos);
|
||||||
|
@ -713,7 +713,9 @@ void GUI::poiFileChecked(int index)
|
|||||||
{
|
{
|
||||||
_poi.enableFile(_poi.files().at(index),
|
_poi.enableFile(_poi.files().at(index),
|
||||||
_poiFilesActions.at(index)->isChecked());
|
_poiFilesActions.at(index)->isChecked());
|
||||||
|
|
||||||
_track->clearPOI();
|
_track->clearPOI();
|
||||||
|
if (_showPOIAction->isChecked())
|
||||||
_track->loadPOI(_poi);
|
_track->loadPOI(_poi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ public:
|
|||||||
Tile(const QPoint &xy, int zoom)
|
Tile(const QPoint &xy, int zoom)
|
||||||
{_xy = xy; _zoom = zoom;}
|
{_xy = xy; _zoom = zoom;}
|
||||||
|
|
||||||
int zoom() {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
QPoint& xy() {return _xy;}
|
QPoint& xy() {return _xy;}
|
||||||
QPixmap& pixmap() {return _pixmap;}
|
QPixmap& pixmap() {return _pixmap;}
|
||||||
|
|
||||||
|
30
src/poi.cpp
30
src/poi.cpp
@ -46,15 +46,14 @@ bool POI::loadGPXFile(const QString &fileName)
|
|||||||
|
|
||||||
if (gpx.loadFile(fileName)) {
|
if (gpx.loadFile(fileName)) {
|
||||||
for (int i = 0; i < gpx.waypoints().size(); i++)
|
for (int i = 0; i < gpx.waypoints().size(); i++)
|
||||||
_data.append(Waypoint(
|
_data.append(gpx.waypoints().at(i));
|
||||||
ll2mercator(gpx.waypoints().at(i).coordinates()),
|
|
||||||
gpx.waypoints().at(i).description()));
|
|
||||||
index.end = _data.size() - 1;
|
index.end = _data.size() - 1;
|
||||||
|
|
||||||
for (int i = index.start; i <= index.end; i++) {
|
for (int i = index.start; i <= index.end; i++) {
|
||||||
|
const QPointF &p = _data.at(i).coordinates();
|
||||||
qreal c[2];
|
qreal c[2];
|
||||||
c[0] = _data.at(i).coordinates().x();
|
c[0] = p.x();
|
||||||
c[1] = _data.at(i).coordinates().y();
|
c[1] = p.y();
|
||||||
_tree.Insert(c, c, i);
|
_tree.Insert(c, c, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,16 +107,17 @@ bool POI::loadCSVFile(const QString &fileName)
|
|||||||
}
|
}
|
||||||
QByteArray ba = list[2].trimmed();
|
QByteArray ba = list[2].trimmed();
|
||||||
|
|
||||||
_data.append(Waypoint(ll2mercator(QPointF(lon, lat)),
|
_data.append(Waypoint(QPointF(lon, lat),
|
||||||
QString::fromUtf8(ba.data(), ba.size())));
|
QString::fromUtf8(ba.data(), ba.size())));
|
||||||
ln++;
|
ln++;
|
||||||
}
|
}
|
||||||
index.end = _data.size() - 1;
|
index.end = _data.size() - 1;
|
||||||
|
|
||||||
for (int i = index.start; i <= index.end; i++) {
|
for (int i = index.start; i <= index.end; i++) {
|
||||||
|
const QPointF &p = _data.at(i).coordinates();
|
||||||
qreal c[2];
|
qreal c[2];
|
||||||
c[0] = _data.at(i).coordinates().x();
|
c[0] = p.x();
|
||||||
c[1] = _data.at(i).coordinates().y();
|
c[1] = p.y();
|
||||||
_tree.Insert(c, c, i);
|
_tree.Insert(c, c, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,10 +142,11 @@ QVector<Waypoint> POI::points(const QVector<QPointF> &path, qreal radius) const
|
|||||||
qreal min[2], max[2];
|
qreal min[2], max[2];
|
||||||
|
|
||||||
for (int i = 0; i < path.count(); i++) {
|
for (int i = 0; i < path.count(); i++) {
|
||||||
min[0] = path.at(i).x() - radius;
|
const QPointF &p = path.at(i);
|
||||||
min[1] = path.at(i).y() - radius;
|
min[0] = p.x() - radius;
|
||||||
max[0] = path.at(i).x() + radius;
|
min[1] = p.y() - radius;
|
||||||
max[1] = path.at(i).y() + radius;
|
max[0] = p.x() + radius;
|
||||||
|
max[1] = p.y() + radius;
|
||||||
_tree.Search(min, max, cb, &set);
|
_tree.Search(min, max, cb, &set);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,9 +174,10 @@ void POI::enableFile(const QString &fileName, bool enable)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (int j = idx.start; j <= idx.end; j++) {
|
for (int j = idx.start; j <= idx.end; j++) {
|
||||||
|
const QPointF &p = _data.at(j).coordinates();
|
||||||
qreal c[2];
|
qreal c[2];
|
||||||
c[0] = _data.at(j).coordinates().x();
|
c[0] = p.x();
|
||||||
c[1] = _data.at(j).coordinates().y();
|
c[1] = p.y();
|
||||||
_tree.Insert(c, c, j);
|
_tree.Insert(c, c, j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ class POI
|
|||||||
public:
|
public:
|
||||||
POI() : _errorLine(0) {}
|
POI() : _errorLine(0) {}
|
||||||
bool loadFile(const QString &fileName);
|
bool loadFile(const QString &fileName);
|
||||||
QString errorString() const {return _error;}
|
const QString &errorString() const {return _error;}
|
||||||
int errorLine() const {return _errorLine;}
|
int errorLine() const {return _errorLine;}
|
||||||
|
|
||||||
QVector<Waypoint> points(const QVector<QPointF> &path,
|
QVector<Waypoint> points(const QVector<QPointF> &path,
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
SliderInfoItem::SliderInfoItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
SliderInfoItem::SliderInfoItem(QGraphicsItem *parent) : QGraphicsItem(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SliderInfoItem::updateBoundingRect()
|
void SliderInfoItem::updateBoundingRect()
|
||||||
|
@ -14,7 +14,7 @@ public:
|
|||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget);
|
QWidget *widget);
|
||||||
|
|
||||||
QRectF area() {return _area;}
|
const QRectF &area() const {return _area;}
|
||||||
void setArea(const QRectF &area) {_area = area;}
|
void setArea(const QRectF &area) {_area = area;}
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
#include <cmath>
|
||||||
#include "ll.h"
|
#include "ll.h"
|
||||||
#include "track.h"
|
#include "track.h"
|
||||||
|
|
||||||
|
|
||||||
#define WINDOW_EF 3
|
#define WINDOW_EF 3
|
||||||
#define WINDOW_SE 11
|
#define WINDOW_SE 11
|
||||||
#define WINDOW_SF 11
|
#define WINDOW_SF 11
|
||||||
@ -84,9 +86,13 @@ void Track::elevationGraph(QVector<QPointF> &graph) const
|
|||||||
if (!_data.size())
|
if (!_data.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (isnan(_data.at(0).elevation))
|
||||||
|
return;
|
||||||
raw.append(QPointF(0, _data.at(0).elevation));
|
raw.append(QPointF(0, _data.at(0).elevation));
|
||||||
for (int i = 1; i < _data.size(); i++) {
|
for (int i = 1; i < _data.size(); i++) {
|
||||||
dist += llDistance(_data.at(i).coordinates, _data.at(i-1).coordinates);
|
dist += llDistance(_data.at(i).coordinates, _data.at(i-1).coordinates);
|
||||||
|
if (isnan(_data.at(i).elevation))
|
||||||
|
return;
|
||||||
raw.append(QPointF(dist, _data.at(i).elevation
|
raw.append(QPointF(dist, _data.at(i).elevation
|
||||||
- _data.at(i).geoidheight));
|
- _data.at(i).geoidheight));
|
||||||
}
|
}
|
||||||
@ -108,7 +114,7 @@ void Track::speedGraph(QVector<QPointF> &graph) const
|
|||||||
dt = _data.at(i-1).timestamp.msecsTo(_data.at(i).timestamp) / 1000.0;
|
dt = _data.at(i-1).timestamp.msecsTo(_data.at(i).timestamp) / 1000.0;
|
||||||
dist += ds;
|
dist += ds;
|
||||||
|
|
||||||
if (_data.at(i).speed < 0) {
|
if (isnan(_data.at(i).speed)) {
|
||||||
if (dt == 0)
|
if (dt == 0)
|
||||||
continue;
|
continue;
|
||||||
v = ds / dt;
|
v = ds / dt;
|
||||||
@ -124,7 +130,7 @@ void Track::speedGraph(QVector<QPointF> &graph) const
|
|||||||
void Track::track(QVector<QPointF> &track) const
|
void Track::track(QVector<QPointF> &track) const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _data.size(); i++)
|
for (int i = 0; i < _data.size(); i++)
|
||||||
track.append(ll2mercator(_data.at(i).coordinates));
|
track.append(_data.at(i).coordinates);
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal Track::distance() const
|
qreal Track::distance() const
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
struct Trackpoint
|
struct Trackpoint
|
||||||
{
|
{
|
||||||
@ -12,7 +13,7 @@ struct Trackpoint
|
|||||||
qreal geoidheight;
|
qreal geoidheight;
|
||||||
qreal speed;
|
qreal speed;
|
||||||
|
|
||||||
Trackpoint() {elevation = 0; geoidheight = 0; speed = -1;}
|
Trackpoint() {elevation = NAN; geoidheight = 0; speed = NAN;}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TRACKPOINT_H
|
#endif // TRACKPOINT_H
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#include <cmath>
|
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
@ -32,8 +31,8 @@ TrackView::TrackView(QWidget *parent)
|
|||||||
_mapScale = new ScaleItem();
|
_mapScale = new ScaleItem();
|
||||||
_mapScale->setZValue(2.0);
|
_mapScale->setZValue(2.0);
|
||||||
|
|
||||||
_zoom = -1;
|
_zoom = ZOOM_MAX;
|
||||||
_scale = -1.0;
|
_scale = mapScale(_zoom);
|
||||||
_map = 0;
|
_map = 0;
|
||||||
_maxLen = 0;
|
_maxLen = 0;
|
||||||
}
|
}
|
||||||
@ -55,17 +54,20 @@ void TrackView::addTrack(const QVector<QPointF> &track)
|
|||||||
|
|
||||||
_tracks.append(track);
|
_tracks.append(track);
|
||||||
|
|
||||||
path.moveTo(track.at(0).x(), -track.at(0).y());
|
const QPointF &p = track.at(0);
|
||||||
for (int i = 1; i < track.size(); i++)
|
path.moveTo(ll2mercator(QPointF(p.x(), -p.y())));
|
||||||
path.lineTo(track.at(i).x(), -track.at(i).y());
|
for (int i = 1; i < track.size(); i++) {
|
||||||
|
const QPointF &p = track.at(i);
|
||||||
|
path.lineTo(ll2mercator(QPointF(p.x(), -p.y())));
|
||||||
|
}
|
||||||
|
|
||||||
_maxLen = qMax(path.length(), _maxLen);
|
_maxLen = qMax(path.length(), _maxLen);
|
||||||
|
|
||||||
|
|
||||||
pi = new QGraphicsPathItem(path);
|
pi = new QGraphicsPathItem(path);
|
||||||
_trackPaths.append(pi);
|
_paths.append(pi);
|
||||||
_zoom = scale2zoom(trackScale());
|
_zoom = qMin(_zoom, scale2zoom(trackScale()));
|
||||||
_scale = mapScale();
|
_scale = mapScale(_zoom);
|
||||||
QBrush brush(_palette.color(), Qt::SolidPattern);
|
QBrush brush(_palette.color(), Qt::SolidPattern);
|
||||||
QPen pen(brush, TRACK_WIDTH * _scale);
|
QPen pen(brush, TRACK_WIDTH * _scale);
|
||||||
pi->setPen(pen);
|
pi->setPen(pen);
|
||||||
@ -78,9 +80,29 @@ void TrackView::addTrack(const QVector<QPointF> &track)
|
|||||||
mi->setScale(_scale);
|
mi->setScale(_scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TrackView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < waypoints.count(); i++) {
|
||||||
|
const Waypoint &w = waypoints.at(i);
|
||||||
|
WaypointItem *wi = new WaypointItem(
|
||||||
|
Waypoint(ll2mercator(QPointF(w.coordinates().x(),
|
||||||
|
-w.coordinates().y())), w.description()));
|
||||||
|
|
||||||
|
wi->setPos(wi->entry().coordinates() * 1.0/_scale);
|
||||||
|
wi->setZValue(1);
|
||||||
|
_scene->addItem(wi);
|
||||||
|
|
||||||
|
_locations.append(wi);
|
||||||
|
_waypoints.append(w.coordinates());
|
||||||
|
}
|
||||||
|
|
||||||
|
_zoom = qMin(_zoom, scale2zoom(waypointScale()));
|
||||||
|
_scale = mapScale(_zoom);
|
||||||
|
}
|
||||||
|
|
||||||
void TrackView::loadGPX(const GPX &gpx)
|
void TrackView::loadGPX(const GPX &gpx)
|
||||||
{
|
{
|
||||||
qreal scale = _scale;
|
int zoom = _zoom;
|
||||||
|
|
||||||
for (int i = 0; i < gpx.trackCount(); i++) {
|
for (int i = 0; i < gpx.trackCount(); i++) {
|
||||||
QVector<QPointF> track;
|
QVector<QPointF> track;
|
||||||
@ -88,12 +110,16 @@ void TrackView::loadGPX(const GPX &gpx)
|
|||||||
addTrack(track);
|
addTrack(track);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_trackPaths.empty())
|
addWaypoints(gpx.waypoints());
|
||||||
|
|
||||||
|
if (_paths.empty() && _locations.empty())
|
||||||
return;
|
return;
|
||||||
if (_trackPaths.size() > 1 && scale != _scale)
|
|
||||||
|
if ((_paths.size() > 1 && _zoom < zoom)
|
||||||
|
|| (_locations.size() && _zoom < zoom))
|
||||||
rescale(_scale);
|
rescale(_scale);
|
||||||
|
|
||||||
QRectF br = trackBoundingRect();
|
QRectF br = trackBoundingRect() | waypointBoundingRect();
|
||||||
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
||||||
_scene->setSceneRect(ba);
|
_scene->setSceneRect(ba);
|
||||||
centerOn(ba.center());
|
centerOn(ba.center());
|
||||||
@ -106,40 +132,75 @@ void TrackView::loadGPX(const GPX &gpx)
|
|||||||
|
|
||||||
QRectF TrackView::trackBoundingRect() const
|
QRectF TrackView::trackBoundingRect() const
|
||||||
{
|
{
|
||||||
qreal bottom, top, left, right;
|
if (_paths.empty())
|
||||||
|
|
||||||
if (_trackPaths.empty())
|
|
||||||
return QRectF();
|
return QRectF();
|
||||||
|
|
||||||
bottom = _trackPaths.at(0)->sceneBoundingRect().bottom();
|
QRectF br = _paths.at(0)->sceneBoundingRect();
|
||||||
top = _trackPaths.at(0)->sceneBoundingRect().top();
|
for (int i = 1; i < _paths.size(); i++)
|
||||||
left = _trackPaths.at(0)->sceneBoundingRect().left();
|
br |= _paths.at(i)->sceneBoundingRect();
|
||||||
right = _trackPaths.at(0)->sceneBoundingRect().right();
|
|
||||||
|
|
||||||
for (int i = 1; i < _trackPaths.size(); i++) {
|
return br;
|
||||||
bottom = qMax(bottom, _trackPaths.at(i)->sceneBoundingRect().bottom());
|
}
|
||||||
top = qMin(top, _trackPaths.at(i)->sceneBoundingRect().top());
|
|
||||||
right = qMax(right, _trackPaths.at(i)->sceneBoundingRect().right());
|
QRectF TrackView::waypointBoundingRect() const
|
||||||
left = qMin(left, _trackPaths.at(i)->sceneBoundingRect().left());
|
{
|
||||||
|
qreal bottom, top, left, right;
|
||||||
|
|
||||||
|
if (_locations.empty())
|
||||||
|
return QRectF();
|
||||||
|
|
||||||
|
const QPointF &p = _locations.at(0)->pos();
|
||||||
|
bottom = p.y();
|
||||||
|
top = p.y();
|
||||||
|
left = p.x();
|
||||||
|
right = p.x();
|
||||||
|
|
||||||
|
for (int i = 1; i < _locations.size(); i++) {
|
||||||
|
const QPointF &p = _locations.at(i)->pos();
|
||||||
|
bottom = qMax(bottom, p.y());
|
||||||
|
top = qMin(top, p.y());
|
||||||
|
right = qMax(right, p.x());
|
||||||
|
left = qMin(left, p.x());
|
||||||
}
|
}
|
||||||
|
|
||||||
return QRectF(QPointF(left, top), QPointF(right, bottom));
|
return QRectF(QPointF(left, top), QPointF(right, bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal TrackView::trackScale() const
|
qreal TrackView::trackScale() const
|
||||||
|
{
|
||||||
|
if (_paths.empty())
|
||||||
|
return mapScale(ZOOM_MAX);
|
||||||
|
|
||||||
|
QRectF br = _paths.at(0)->path().boundingRect();
|
||||||
|
|
||||||
|
for (int i = 1; i < _paths.size(); i++)
|
||||||
|
br |= _paths.at(i)->path().boundingRect();
|
||||||
|
|
||||||
|
QPointF sc(br.width() / (viewport()->width() - MARGIN/2),
|
||||||
|
br.height() / (viewport()->height() - MARGIN/2));
|
||||||
|
|
||||||
|
return qMax(sc.x(), sc.y());
|
||||||
|
}
|
||||||
|
|
||||||
|
qreal TrackView::waypointScale() const
|
||||||
{
|
{
|
||||||
qreal bottom, top, left, right;
|
qreal bottom, top, left, right;
|
||||||
|
|
||||||
bottom = _trackPaths.at(0)->path().boundingRect().bottom();
|
if (_locations.size() < 2)
|
||||||
top = _trackPaths.at(0)->path().boundingRect().top();
|
return mapScale(ZOOM_MAX);
|
||||||
left = _trackPaths.at(0)->path().boundingRect().left();
|
|
||||||
right = _trackPaths.at(0)->path().boundingRect().right();
|
|
||||||
|
|
||||||
for (int i = 1; i < _trackPaths.size(); i++) {
|
const QPointF &p = _locations.at(0)->entry().coordinates();
|
||||||
bottom = qMax(bottom, _trackPaths.at(i)->path().boundingRect().bottom());
|
bottom = p.y();
|
||||||
top = qMin(top, _trackPaths.at(i)->path().boundingRect().top());
|
top = p.y();
|
||||||
right = qMax(right, _trackPaths.at(i)->path().boundingRect().right());
|
left = p.x();
|
||||||
left = qMin(left, _trackPaths.at(i)->path().boundingRect().left());
|
right = p.x();
|
||||||
|
|
||||||
|
for (int i = 1; i < _locations.size(); i++) {
|
||||||
|
const QPointF &p = _locations.at(i)->entry().coordinates();
|
||||||
|
bottom = qMax(bottom, p.y());
|
||||||
|
top = qMin(top, p.y());
|
||||||
|
right = qMax(right, p.x());
|
||||||
|
left = qMin(left, p.x());
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF br(QPointF(left, top), QPointF(right, bottom));
|
QRectF br(QPointF(left, top), QPointF(right, bottom));
|
||||||
@ -149,26 +210,29 @@ qreal TrackView::trackScale() const
|
|||||||
return qMax(sc.x(), sc.y());
|
return qMax(sc.x(), sc.y());
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal TrackView::mapScale() const
|
qreal TrackView::mapScale(int zoom) const
|
||||||
{
|
{
|
||||||
return ((360.0/(qreal)(1<<_zoom))/(qreal)TILE_SIZE);
|
return ((360.0/(qreal)(1<<zoom))/(qreal)TILE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackView::rescale(qreal scale)
|
void TrackView::rescale(qreal scale)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _trackPaths.size(); i++) {
|
for (int i = 0; i < _paths.size(); i++) {
|
||||||
_markers.at(i)->setScale(scale);
|
_markers.at(i)->setScale(scale);
|
||||||
_trackPaths.at(i)->setScale(1.0/scale);
|
_paths.at(i)->setScale(1.0/scale);
|
||||||
|
|
||||||
QPen pen(_trackPaths.at(i)->pen());
|
QPen pen(_paths.at(i)->pen());
|
||||||
pen.setWidthF(TRACK_WIDTH * scale);
|
pen.setWidthF(TRACK_WIDTH * scale);
|
||||||
_trackPaths.at(i)->setPen(pen);
|
_paths.at(i)->setPen(pen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < _locations.size(); i++)
|
||||||
|
_locations.at(i)->setPos(_locations.at(i)->entry().coordinates()
|
||||||
|
* 1.0/scale);
|
||||||
|
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it, jt;
|
QHash<Waypoint, WaypointItem*>::const_iterator it, jt;
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||||
it.value()->setPos(QPointF(it.value()->entry().coordinates().x()
|
it.value()->setPos(it.value()->entry().coordinates() * 1.0/scale);
|
||||||
* 1.0/scale, -it.value()->entry().coordinates().y() * 1.0/scale));
|
|
||||||
it.value()->show();
|
it.value()->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,29 +247,36 @@ void TrackView::rescale(qreal scale)
|
|||||||
_scale = scale;
|
_scale = scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TrackView::addPOI(const QVector<Waypoint> &waypoints)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < waypoints.size(); i++) {
|
||||||
|
const Waypoint &w = waypoints.at(i);
|
||||||
|
|
||||||
|
if (_pois.contains(w))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
WaypointItem *pi = new WaypointItem(
|
||||||
|
Waypoint(ll2mercator(QPointF(w.coordinates().x(),
|
||||||
|
-w.coordinates().y())), w.description()));
|
||||||
|
|
||||||
|
pi->setPos(pi->entry().coordinates() * 1.0/_scale);
|
||||||
|
pi->setZValue(1);
|
||||||
|
_scene->addItem(pi);
|
||||||
|
|
||||||
|
_pois.insert(w, pi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TrackView::loadPOI(const POI &poi)
|
void TrackView::loadPOI(const POI &poi)
|
||||||
{
|
{
|
||||||
QHash<Waypoint, WaypointItem*>::const_iterator it,jt;
|
QHash<Waypoint, WaypointItem*>::const_iterator it,jt;
|
||||||
|
|
||||||
if (!_tracks.size())
|
if (!_tracks.size() && !_waypoints.size())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (int i = 0; i < _tracks.size(); i++) {
|
for (int i = 0; i < _tracks.size(); i++)
|
||||||
QVector<Waypoint> p = poi.points(_tracks.at(i));
|
addPOI(poi.points(_tracks.at(i)));
|
||||||
|
addPOI(poi.points(_waypoints));
|
||||||
for (int i = 0; i < p.size(); i++) {
|
|
||||||
if (_pois.contains(p.at(i)))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
WaypointItem *pi = new WaypointItem(p.at(i));
|
|
||||||
pi->setPos(p.at(i).coordinates().x() * 1.0/_scale,
|
|
||||||
-p.at(i).coordinates().y() * 1.0/_scale);
|
|
||||||
pi->setZValue(1);
|
|
||||||
_scene->addItem(pi);
|
|
||||||
|
|
||||||
_pois.insert(p.at(i), pi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
for (it = _pois.constBegin(); it != _pois.constEnd(); it++) {
|
||||||
for (jt = _pois.constBegin(); jt != _pois.constEnd(); jt++) {
|
for (jt = _pois.constBegin(); jt != _pois.constEnd(); jt++) {
|
||||||
@ -236,7 +307,7 @@ void TrackView::redraw()
|
|||||||
|
|
||||||
void TrackView::wheelEvent(QWheelEvent *event)
|
void TrackView::wheelEvent(QWheelEvent *event)
|
||||||
{
|
{
|
||||||
if (_tracks.isEmpty())
|
if (_paths.isEmpty() && _locations.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QPointF pos = mapToScene(event->pos());
|
QPointF pos = mapToScene(event->pos());
|
||||||
@ -245,8 +316,8 @@ void TrackView::wheelEvent(QWheelEvent *event)
|
|||||||
_zoom = (event->delta() > 0) ?
|
_zoom = (event->delta() > 0) ?
|
||||||
qMin(_zoom + 1, ZOOM_MAX) : qMax(_zoom - 1, ZOOM_MIN);
|
qMin(_zoom + 1, ZOOM_MAX) : qMax(_zoom - 1, ZOOM_MIN);
|
||||||
|
|
||||||
rescale(mapScale());
|
rescale(mapScale(_zoom));
|
||||||
QRectF br = trackBoundingRect();
|
QRectF br = trackBoundingRect() | waypointBoundingRect();
|
||||||
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
||||||
_scene->setSceneRect(ba);
|
_scene->setSceneRect(ba);
|
||||||
|
|
||||||
@ -263,10 +334,10 @@ void TrackView::wheelEvent(QWheelEvent *event)
|
|||||||
|
|
||||||
void TrackView::setTrackLineWidth(qreal width)
|
void TrackView::setTrackLineWidth(qreal width)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _trackPaths.size(); i++) {
|
for (int i = 0; i < _paths.size(); i++) {
|
||||||
QPen pen(_trackPaths.at(i)->pen());
|
QPen pen(_paths.at(i)->pen());
|
||||||
pen.setWidthF(width);
|
pen.setWidthF(width);
|
||||||
_trackPaths.at(i)->setPen(pen);
|
_paths.at(i)->setPen(pen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,24 +394,27 @@ void TrackView::clear()
|
|||||||
_scene->removeItem(_mapScale);
|
_scene->removeItem(_mapScale);
|
||||||
|
|
||||||
_pois.clear();
|
_pois.clear();
|
||||||
_tracks.clear();
|
_paths.clear();
|
||||||
_trackPaths.clear();
|
_locations.clear();
|
||||||
_markers.clear();
|
_markers.clear();
|
||||||
_scene->clear();
|
_scene->clear();
|
||||||
_palette.reset();
|
_palette.reset();
|
||||||
|
|
||||||
|
_tracks.clear();
|
||||||
|
_waypoints.clear();
|
||||||
|
|
||||||
_maxLen = 0;
|
_maxLen = 0;
|
||||||
_zoom = -1;
|
_zoom = ZOOM_MAX;
|
||||||
_scale = -1.0;
|
_scale = mapScale(_zoom);
|
||||||
|
|
||||||
_scene->setSceneRect(QRectF());
|
_scene->setSceneRect(QRectF());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrackView::movePositionMarker(qreal val)
|
void TrackView::movePositionMarker(qreal val)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _trackPaths.size(); i++) {
|
for (int i = 0; i < _paths.size(); i++) {
|
||||||
qreal f = _maxLen / _trackPaths.at(i)->path().length();
|
qreal f = _maxLen / _paths.at(i)->path().length();
|
||||||
QPointF pos = _trackPaths.at(i)->path().pointAtPercent(qMin(val * f,
|
QPointF pos = _paths.at(i)->path().pointAtPercent(qMin(val * f,
|
||||||
1.0));
|
1.0));
|
||||||
_markers.at(i)->setPos(pos);
|
_markers.at(i)->setPos(pos);
|
||||||
}
|
}
|
||||||
@ -348,7 +422,7 @@ void TrackView::movePositionMarker(qreal val)
|
|||||||
|
|
||||||
void TrackView::drawBackground(QPainter *painter, const QRectF &rect)
|
void TrackView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||||
{
|
{
|
||||||
if (_tracks.isEmpty() || !_map) {
|
if ((_paths.isEmpty() && _locations.isEmpty())|| !_map) {
|
||||||
painter->fillRect(rect, Qt::white);
|
painter->fillRect(rect, Qt::white);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -380,10 +454,10 @@ void TrackView::drawBackground(QPainter *painter, const QRectF &rect)
|
|||||||
|
|
||||||
void TrackView::resizeEvent(QResizeEvent *e)
|
void TrackView::resizeEvent(QResizeEvent *e)
|
||||||
{
|
{
|
||||||
if (_tracks.isEmpty())
|
if (_paths.isEmpty() && _locations.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QRectF br = trackBoundingRect();
|
QRectF br = trackBoundingRect() | waypointBoundingRect();
|
||||||
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
QRectF ba = br.adjusted(-TILE_SIZE, -TILE_SIZE, TILE_SIZE, TILE_SIZE);
|
||||||
|
|
||||||
if (ba.width() < e->size().width()) {
|
if (ba.width() < e->size().width()) {
|
||||||
|
@ -45,9 +45,14 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void addTrack(const QVector<QPointF> &track);
|
void addTrack(const QVector<QPointF> &track);
|
||||||
|
void addWaypoints(const QList<Waypoint> &waypoints);
|
||||||
|
void addPOI(const QVector<Waypoint> &waypoints);
|
||||||
|
|
||||||
QRectF trackBoundingRect() const;
|
QRectF trackBoundingRect() const;
|
||||||
|
QRectF waypointBoundingRect() const;
|
||||||
qreal trackScale() const;
|
qreal trackScale() const;
|
||||||
qreal mapScale() const;
|
qreal waypointScale() const;
|
||||||
|
qreal mapScale(int zoom) const;
|
||||||
void rescale(qreal scale);
|
void rescale(qreal scale);
|
||||||
|
|
||||||
void showMarkers(bool show);
|
void showMarkers(bool show);
|
||||||
@ -59,10 +64,13 @@ private:
|
|||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
|
|
||||||
QGraphicsScene *_scene;
|
QGraphicsScene *_scene;
|
||||||
QList<QVector<QPointF> > _tracks;
|
QList<QGraphicsPathItem*> _paths;
|
||||||
QList<QGraphicsPathItem*> _trackPaths;
|
|
||||||
QList<MarkerItem*> _markers;
|
QList<MarkerItem*> _markers;
|
||||||
|
QList<WaypointItem*> _locations;
|
||||||
QHash<Waypoint, WaypointItem*> _pois;
|
QHash<Waypoint, WaypointItem*> _pois;
|
||||||
|
QList<QVector<QPointF> > _tracks;
|
||||||
|
QVector<QPointF> _waypoints;
|
||||||
|
|
||||||
Map *_map;
|
Map *_map;
|
||||||
ScaleItem *_mapScale;
|
ScaleItem *_mapScale;
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ void WaypointItem::updateBoundingRect()
|
|||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
QRect ts = fm.tightBoundingRect(_entry.description());
|
QRect ts = fm.tightBoundingRect(_entry.description());
|
||||||
|
|
||||||
_boundingRect = QRectF(0, 0, ts.width() + POINT_SIZE,
|
_boundingRect = QRectF(-POINT_SIZE/2, -POINT_SIZE/2, ts.width()
|
||||||
ts.height() + fm.descent() + POINT_SIZE);
|
+ POINT_SIZE, ts.height() + fm.descent() + POINT_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WaypointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void WaypointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
@ -36,10 +36,10 @@ void WaypointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
|||||||
QRect ts = fm.tightBoundingRect(_entry.description());
|
QRect ts = fm.tightBoundingRect(_entry.description());
|
||||||
|
|
||||||
painter->setFont(font);
|
painter->setFont(font);
|
||||||
painter->drawText(POINT_SIZE - qMax(ts.x(), 0), POINT_SIZE + ts.height(),
|
painter->drawText(POINT_SIZE/2 - qMax(ts.x(), 0), POINT_SIZE/2 + ts.height(),
|
||||||
_entry.description());
|
_entry.description());
|
||||||
painter->setBrush(Qt::SolidPattern);
|
painter->setBrush(Qt::SolidPattern);
|
||||||
painter->drawEllipse(0, 0, POINT_SIZE, POINT_SIZE);
|
painter->drawEllipse(-POINT_SIZE/2, -POINT_SIZE/2, POINT_SIZE, POINT_SIZE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
painter->setPen(Qt::red);
|
painter->setPen(Qt::red);
|
||||||
|
Reference in New Issue
Block a user