点击死机原因可能是多次进入导致
This commit is contained in:
@@ -62,7 +62,7 @@ void AltitudeItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
|
|
||||||
}
|
}
|
||||||
QGraphicsItem::mousePressEvent(event);
|
//QGraphicsItem::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AltitudeItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
void AltitudeItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
@@ -72,7 +72,8 @@ void AltitudeItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
if (event->button() == Qt::LeftButton) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
|
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
//QGraphicsItem::mouseReleaseEvent(event);
|
||||||
|
|
||||||
}
|
}
|
||||||
void AltitudeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
void AltitudeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
@@ -83,9 +84,9 @@ void AltitudeItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
void AltitudeItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
void AltitudeItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (isDragging) {
|
if (isDragging) {
|
||||||
|
this->setPos(event->pos());
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseMoveEvent(event);
|
//QGraphicsItem::mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
namespace mapcontrol {
|
namespace mapcontrol {
|
||||||
|
|
||||||
|
|
||||||
#ifdef QtopmapWidget
|
#ifdef QtopmapWidget
|
||||||
#include <mapwidgetglobal.h>
|
#include <mapwidgetglobal.h>
|
||||||
class OPMAPWIDGETSHARED_EXPORT AltitudeItem : public QObject, public QGraphicsItem {
|
class OPMAPWIDGETSHARED_EXPORT AltitudeItem : public QObject, public QGraphicsItem {
|
||||||
@@ -26,9 +27,8 @@ class AltitudeItem : public QObject, public QGraphicsItem {
|
|||||||
public:
|
public:
|
||||||
AltitudeItem(MapGraphicItem *map, QColor background = Qt::green);
|
AltitudeItem(MapGraphicItem *map, QColor background = Qt::green);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
void setColor(const QColor &color)
|
void setColor(const QColor &color)
|
||||||
{
|
{
|
||||||
myColor = color;
|
myColor = color;
|
||||||
@@ -46,7 +46,7 @@ protected:
|
|||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||||
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user