Skip to content

Commit

Permalink
Fixed errors:
Browse files Browse the repository at this point in the history
- QDropEvent::position() was introduced since Qt 6.0 and as QGV provide supports for version 5.0 it should be wrapped to needed ifdef (fixed)
- "Mixed line ending" - \n and \r\n not allowed in same file (check other files, but I am sure but project mostly uses UNIX style) (fixed)
- "clang-format" - simply check result of failed run or apply clang-format (fixed)
- "Update legacy headers" - all files in project should have same legacy header. You can copy it from other file (fixed)
  • Loading branch information
leonardooyama committed May 23, 2024
1 parent 189910d commit 95e6540
Show file tree
Hide file tree
Showing 30 changed files with 115 additions and 159 deletions.
6 changes: 3 additions & 3 deletions lib/include/QGeoView/QGVMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#pragma once

#include <QWidget>
#include <QMimeData>
#include <QWidget>

#include "QGVCamera.h"
#include "QGVGlobal.h"
Expand Down Expand Up @@ -104,7 +104,7 @@ class QGV_LIB_DECL QGVMap : public QWidget
void mapMouseMove(QPointF projPos);
void mapMousePress(QPointF projPos);

void dropOnMap(QGV::GeoPos pos, const QMimeData *data);
void dropOnMap(QGV::GeoPos pos, const QMimeData* data);

private:
QScopedPointer<QGVProjection> mProjection;
Expand All @@ -114,5 +114,5 @@ class QGV_LIB_DECL QGVMap : public QWidget
QSet<QGVItem*> mSelections;

private slots:
void handleDropDataOnQGVMapQGView(QPointF position, const QMimeData *dropData);
void handleDropDataOnQGVMapQGView(QPointF position, const QMimeData* dropData);
};
12 changes: 6 additions & 6 deletions lib/include/QGeoView/QGVMapQGView.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include <QMenu>

#include <QDragEnterEvent>
#include <QDragLeaveEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QDragLeaveEvent>
#include <QMimeData>

class QGVMap;
Expand Down Expand Up @@ -90,10 +90,10 @@ class QGV_LIB_DECL QGVMapQGView : public QGraphicsView
void showEvent(QShowEvent* event) override final;
void keyPressEvent(QKeyEvent* event) override final;

void dragEnterEvent(QDragEnterEvent *event) override final;
void dragMoveEvent(QDragMoveEvent *event) override final;
void dropEvent(QDropEvent *event) override final;
void dragLeaveEvent(QDragLeaveEvent *event) override final;
void dragEnterEvent(QDragEnterEvent* event) override final;
void dragMoveEvent(QDragMoveEvent* event) override final;
void dropEvent(QDropEvent* event) override final;
void dragLeaveEvent(QDragLeaveEvent* event) override final;

private:
QGVMap* mGeoMap;
Expand All @@ -114,5 +114,5 @@ class QGV_LIB_DECL QGVMapQGView : public QGraphicsView
QScopedPointer<QGVMapRubberBand> mSelectionRect;
QScopedPointer<QMenu> mContextMenu;
signals:
void dropData(QPointF position, const QMimeData *dropData);
void dropData(QPointF position, const QMimeData* dropData);
};
18 changes: 6 additions & 12 deletions lib/src/QGVCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,15 @@ QGVCameraState::QGVCameraState(const QGVCameraState& other)
, mAzimuth(other.mAzimuth)
, mProjRect(other.mProjRect)
, mAnimation(other.mAnimation)
{
}
{}

QGVCameraState::QGVCameraState(const QGVCameraState&& other)
: mGeoMap(std::move(other.mGeoMap))
, mScale(std::move(other.mScale))
, mAzimuth(std::move(other.mAzimuth))
, mProjRect(std::move(other.mProjRect))
, mAnimation(std::move(other.mAnimation))
{
}
{}

QGVCameraState& QGVCameraState::operator=(const QGVCameraState& other)
{
Expand Down Expand Up @@ -216,8 +214,7 @@ QGVCameraAnimation::QGVCameraAnimation(const QGVCameraActions& actions, QObject*
: QAbstractAnimation(parent)
, mDuration(1000)
, mActions(actions)
{
}
{}

void QGVCameraAnimation::setDuration(int msecs)
{
Expand All @@ -235,12 +232,10 @@ QGVCameraActions& QGVCameraAnimation::actions()
}

void QGVCameraAnimation::onStart()
{
}
{}

void QGVCameraAnimation::onStop()
{
}
{}

double QGVCameraAnimation::interpolateScale(double from, double to, double progress)
{
Expand Down Expand Up @@ -308,8 +303,7 @@ void QGVCameraAnimation::onStateChanged(QGV::MapState state)
QGVCameraSimpleAnimation::QGVCameraSimpleAnimation(const QGVCameraActions& actions, QObject* parent)
: QGVCameraAnimation(actions, parent)
, mEasing(QEasingCurve::Linear)
{
}
{}

void QGVCameraSimpleAnimation::setEasingCurve(const QEasingCurve& easing)
{
Expand Down
15 changes: 5 additions & 10 deletions lib/src/QGVDrawItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ double highlightScale = 1.15;

QGVDrawItem::QGVDrawItem()
: mDirty{ false }
{
}
{}

void QGVDrawItem::setFlags(QGV::ItemFlags flags)
{
Expand Down Expand Up @@ -162,8 +161,7 @@ QString QGVDrawItem::projDebug()
}

void QGVDrawItem::projOnFlags()
{
}
{}

void QGVDrawItem::projOnMouseClick(const QPointF& projPos)
{
Expand All @@ -182,16 +180,13 @@ void QGVDrawItem::projOnMouseDoubleClick(const QPointF& projPos)
}

void QGVDrawItem::projOnObjectStartMove(const QPointF& /*projPos*/)
{
}
{}

void QGVDrawItem::projOnObjectStopMove(const QPointF& /*projPos*/)
{
}
{}

void QGVDrawItem::projOnObjectMovePos(const QPointF& /*projPos*/)
{
}
{}

void QGVDrawItem::onProjection(QGVMap* geoMap)
{
Expand Down
18 changes: 6 additions & 12 deletions lib/src/QGVGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ GeoPos::GeoPos()
: mEmpty(true)
, mLat(0)
, mLon(0)
{
}
{}

GeoPos::GeoPos(double lat, double lon)
: mEmpty(false)
Expand Down Expand Up @@ -157,8 +156,7 @@ QString GeoPos::latToString(double lat, const QString& format)
}

GeoRect::GeoRect()
{
}
{}

GeoRect::GeoRect(double lat1, double lon1, double lat2, double lon2)
{
Expand Down Expand Up @@ -238,26 +236,22 @@ bool GeoRect::intersects(const GeoRect& rect) const

GeoTilePos::GeoTilePos()
: mZoom(-1)
{
}
{}

GeoTilePos::GeoTilePos(int zoom, const QPoint& pos)
: mZoom(zoom)
, mPos(pos)
{
}
{}

GeoTilePos::GeoTilePos(const GeoTilePos& other)
: mZoom(other.mZoom)
, mPos(other.mPos)
{
}
{}

GeoTilePos::GeoTilePos(const GeoTilePos&& other)
: mZoom(std::move(other.mZoom))
, mPos(std::move(other.mPos))
{
}
{}

GeoTilePos& GeoTilePos::operator=(const GeoTilePos& other)
{
Expand Down
3 changes: 1 addition & 2 deletions lib/src/QGVItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ void QGVItem::onCamera(const QGVCameraState& oldState, const QGVCameraState& new
}

void QGVItem::onUpdate()
{
}
{}

void QGVItem::onClean()
{
Expand Down
5 changes: 2 additions & 3 deletions lib/src/QGVMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ class RootItem : public QGVItem
public:
explicit RootItem(QGVMap* geoMap)
: mGeoMap(geoMap)
{
}
{}
virtual ~RootItem();

QGVMap* getMap() const override final
Expand Down Expand Up @@ -382,7 +381,7 @@ void QGVMap::mousePressEvent(QMouseEvent* event)
QWidget::mousePressEvent(event);
}

void QGVMap::handleDropDataOnQGVMapQGView(QPointF position, const QMimeData *dropData)
void QGVMap::handleDropDataOnQGVMapQGView(QPointF position, const QMimeData* dropData)
{
const auto mapToProjectionPos = mapToProj(QPoint(position.rx(), position.ry()));
auto geoPos = getProjection()->projToGeo(mapToProjectionPos);
Expand Down
18 changes: 11 additions & 7 deletions lib/src/QGVMapQGView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <QSequentialAnimationGroup>
#include <QToolTip>
#include <QWheelEvent>
#include <QtGlobal>
#include <QtMath>


namespace {
int wheelAreaMargin = 10;
double wheelExponentDown = qPow(2, 1.0 / 2.0);
Expand Down Expand Up @@ -603,26 +603,30 @@ void QGVMapQGView::keyPressEvent(QKeyEvent* event)
QWidget::keyPressEvent(event);
}

void QGVMapQGView::dragEnterEvent(QDragEnterEvent *event)
void QGVMapQGView::dragEnterEvent(QDragEnterEvent* event)
{
event->accept();
}

void QGVMapQGView::dragMoveEvent(QDragMoveEvent *event)
void QGVMapQGView::dragMoveEvent(QDragMoveEvent* event)
{
event->accept();
}

void QGVMapQGView::dropEvent(QDropEvent *event)
void QGVMapQGView::dropEvent(QDropEvent* event)
{
if (event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist"))
{
if (event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist")) {
#if QT_VERSION >= 0x060000
emit dropData(event->position(), event->mimeData());
#else
QPointF dropPoint = event->posF();
emit dropData(dropPoint, event->mimeData());
#endif
}
event->ignore();
}

void QGVMapQGView::dragLeaveEvent(QDragLeaveEvent *event)
void QGVMapQGView::dragLeaveEvent(QDragLeaveEvent* event)
{
event->accept();
}
3 changes: 1 addition & 2 deletions lib/src/QGVProjection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ QGVProjection::QGVProjection(const QString& id, const QString& name, const QStri
: mID(id)
, mName(name)
, mDescription(description)
{
}
{}

QString QGVProjection::getID() const
{
Expand Down
6 changes: 2 additions & 4 deletions lib/src/QGVWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,10 @@ void QGVWidget::anchoreWidget()
}

void QGVWidget::onProjection(QGVMap* /*geoMap*/)
{
}
{}

void QGVWidget::onCamera(const QGVCameraState& /*oldState*/, const QGVCameraState& /*newState*/)
{
}
{}

void QGVWidget::resizeEvent(QResizeEvent* /*event*/)
{
Expand Down
3 changes: 1 addition & 2 deletions lib/src/Raster/QGVImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

QGVImage::QGVImage()
: mCeilingOnScale{ true }
{
}
{}

void QGVImage::setGeometry(const QGV::GeoRect& geoRect)
{
Expand Down
3 changes: 1 addition & 2 deletions samples/10000/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}

QGV::GeoRect MainWindow::target10000Area() const
{
Expand Down
3 changes: 1 addition & 2 deletions samples/background/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}

QGroupBox* MainWindow::createOptionsList()
{
Expand Down
3 changes: 1 addition & 2 deletions samples/basic/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}
3 changes: 1 addition & 2 deletions samples/camera-actions/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}

QGroupBox* MainWindow::createOptionsList()
{
Expand Down
3 changes: 1 addition & 2 deletions samples/custom-tiles/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}

QGV::GeoRect MainWindow::targetArea() const
{
Expand Down
3 changes: 1 addition & 2 deletions samples/custom-tiles/mytile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
MyTile::MyTile(const QGV::GeoTilePos& tilePos, QColor color)
: mTilePos(tilePos)
, mColor(color)
{
}
{}

void MyTile::onProjection(QGVMap* geoMap)
{
Expand Down
3 changes: 1 addition & 2 deletions samples/debug/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ MainWindow::MainWindow()
}

MainWindow::~MainWindow()
{
}
{}

QGV::GeoRect MainWindow::targetArea() const
{
Expand Down
Loading

0 comments on commit 95e6540

Please sign in to comment.