0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

QTimer singleShot simplified

This commit is contained in:
Arin Alexander 2020-12-30 00:40:46 +03:00
parent fd22897151
commit 47500e6699
3 changed files with 9 additions and 10 deletions

View File

@ -274,8 +274,8 @@ public:
bool isNeedUpdateSize(RenderPass) const; bool isNeedUpdateSize(RenderPass) const;
void copyBandAttributes(BandDesignIntf* source); void copyBandAttributes(BandDesignIntf* source);
signals: signals:
void bandRendered(BandDesignIntf* band); void bandRendered(LimeReport::BandDesignIntf* band);
void bandReRendered(BandDesignIntf* oldBand, BandDesignIntf* newBand); void bandReRendered(LimeReport::BandDesignIntf* oldBand, LimeReport::BandDesignIntf* newBand);
void preparedForRender(); void preparedForRender();
void bandRegistred(); void bandRegistred();
protected: protected:

View File

@ -401,9 +401,9 @@ void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
m_startPos = pos(); m_startPos = pos();
m_oldGeometry = geometry(); m_oldGeometry = geometry();
QGraphicsItem::mousePressEvent(event); QGraphicsItem::mousePressEvent(event);
emit(itemSelected(this)); emit itemSelected(this);
m_isMoveable = false; m_isMoveable = false;
m_timer.singleShot(200, this, SLOT(onChangeGeometryTimeOut())); QTimer::singleShot(200, this, SLOT(onChangeGeometryTimeOut()));
} }
else QGraphicsItem::mousePressEvent(event); else QGraphicsItem::mousePressEvent(event);
} }
@ -523,7 +523,7 @@ void BaseDesignIntf::hoverLeaveEvent(QGraphicsSceneHoverEvent *)
update(); update();
} }
void BaseDesignIntf::hoverEnterEvent(QGraphicsSceneHoverEvent /**event*/) void BaseDesignIntf::hoverEnterEvent(QGraphicsSceneHoverEvent * /*event*/)
{ {
m_hovered = true; m_hovered = true;
update(); update();

View File

@ -344,7 +344,7 @@ protected:
void mousePressEvent(QGraphicsSceneMouseEvent* event); void mousePressEvent(QGraphicsSceneMouseEvent* event);
void hoverMoveEvent(QGraphicsSceneHoverEvent* event); void hoverMoveEvent(QGraphicsSceneHoverEvent* event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent); void hoverEnterEvent(QGraphicsSceneHoverEvent* );
void mouseMoveEvent(QGraphicsSceneMouseEvent* event); void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
@ -467,22 +467,21 @@ private:
bool m_itemGeometryLocked; bool m_itemGeometryLocked;
bool m_isChangingPos; bool m_isChangingPos;
bool m_isMoveable; bool m_isMoveable;
QTimer m_timer;
signals: signals:
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry); void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
void posChanging(QObject* object, QPointF newPos, QPointF oldPos); void posChanging(QObject* object, QPointF newPos, QPointF oldPos);
void posChanged(QObject* object, QPointF newPos, QPointF oldPos); void posChanged(QObject* object, QPointF newPos, QPointF oldPos);
void itemSelected(LimeReport::BaseDesignIntf *item); void itemSelected(LimeReport::BaseDesignIntf *item);
void itemSelectedHasBeenChanged(BaseDesignIntf *item, bool value); void itemSelectedHasBeenChanged(LimeReport::BaseDesignIntf *item, bool value);
void loadCollectionFinished(const QString& collectionName); void loadCollectionFinished(const QString& collectionName);
void objectLoaded(QObject* object); void objectLoaded(QObject* object);
void objectChanged(QObject* object); void objectChanged(QObject* object);
void propertyChanged(const QString& propertName, const QVariant& oldValue,const QVariant& newValue); void propertyChanged(const QString& propertName, const QVariant& oldValue,const QVariant& newValue);
void propertyObjectNameChanged(const QString& oldValue, const QString& newValue); void propertyObjectNameChanged(const QString& oldValue, const QString& newValue);
void propertyesChanged(QVector<QString> propertyNames); void propertyesChanged(QVector<QString> propertyNames);
void itemAlignChanged(BaseDesignIntf* item, const ItemAlign& oldValue, const ItemAlign& newValue); void itemAlignChanged(LimeReport::BaseDesignIntf* item, const LimeReport::BaseDesignIntf::ItemAlign& oldValue, const LimeReport::BaseDesignIntf::ItemAlign& newValue);
void itemVisibleHasChanged(BaseDesignIntf* item); void itemVisibleHasChanged(LimeReport::BaseDesignIntf* item);
void beforeRender(); void beforeRender();
void afterData(); void afterData();
void afterRender(); void afterRender();