Further reduced CPU load when hovering in the hex viewer

This commit is contained in:
Nav
2023-03-18 13:00:23 +00:00
parent 65f1aead11
commit 27f9c1446b
2 changed files with 6 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ namespace Bloom::Widgets
this->displayAbsoluteAddressAction->setCheckable(true);
this->setAddressType(this->state.settings.addressLabelType);
this->setItemIndexMethod(QGraphicsScene::NoIndex);
this->setItemIndexMethod(QGraphicsScene::ItemIndexMethod::NoIndex);
QObject::connect(
InsightSignals::instance(),
@@ -615,9 +615,10 @@ namespace Bloom::Widgets
this->hoverRectX->setVisible(true);
this->hoverRectY->setVisible(true);
this->hoverRectX->update();
this->hoverRectY->update();
}
this->update();
emit this->hoveredAddress(byteItem.startAddress);
}
@@ -628,7 +629,8 @@ namespace Bloom::Widgets
this->hoverRectX->setVisible(false);
this->hoverRectY->setVisible(false);
this->update();
this->hoverRectX->update();
this->hoverRectY->update();
emit this->hoveredAddress(std::nullopt);
}

View File

@@ -21,7 +21,7 @@ namespace Bloom::Widgets
this->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOn);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAlwaysOff);
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
this->setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
this->setViewportUpdateMode(QGraphicsView::ViewportUpdateMode::MinimalViewportUpdate);
this->setOptimizationFlag(QGraphicsView::DontSavePainterState, true);
this->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing, true);
this->setCacheMode(QGraphicsView::CacheModeFlag::CacheNone);