Fixed byte item hover bug
This commit is contained in:
@@ -172,6 +172,14 @@ void ByteItemGraphicsScene::onByteWidgetLeave() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ByteItemGraphicsScene::event(QEvent* event) {
|
||||||
|
if (event->type() == QEvent::Type::GraphicsSceneLeave && this->hoveredByteWidget.has_value()) {
|
||||||
|
this->onByteWidgetLeave();
|
||||||
|
}
|
||||||
|
|
||||||
|
return QGraphicsScene::event(event);
|
||||||
|
}
|
||||||
|
|
||||||
void ByteItemGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) {
|
void ByteItemGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) {
|
||||||
auto hoveredItems = this->items(mouseEvent->scenePos());
|
auto hoveredItems = this->items(mouseEvent->scenePos());
|
||||||
if (!hoveredItems.empty()) {
|
if (!hoveredItems.empty()) {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace Bloom::Widgets
|
|||||||
void byteWidgetsAdjusted();
|
void byteWidgetsAdjusted();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
bool event(QEvent* event) override;
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) override;
|
void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user