This commit is contained in:
Nav
2021-12-26 00:15:24 +00:00
parent 893be12597
commit 42ea81971f

View File

@@ -6,15 +6,21 @@
using namespace Bloom::Widgets; using namespace Bloom::Widgets;
AnnotationItem::AnnotationItem(std::uint32_t startAddress, std::size_t size, QString labelText, AnnotationItemPosition position) AnnotationItem::AnnotationItem(
: QGraphicsItem(nullptr), std::uint32_t startAddress,
startAddress(startAddress), std::size_t size,
size(size), QString labelText,
endAddress(static_cast<std::uint32_t>(startAddress + size - 1)), AnnotationItemPosition position
labelText(std::move(labelText)), ):
position(position), QGraphicsItem(nullptr),
width(static_cast<int>((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN)), startAddress(startAddress),
height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT) { size(size),
endAddress(static_cast<std::uint32_t>(startAddress + size - 1)),
labelText(std::move(labelText)),
position(position),
width(static_cast<int>((ByteItem::WIDTH + ByteItem::RIGHT_MARGIN) * size - ByteItem::RIGHT_MARGIN)),
height(position == AnnotationItemPosition::TOP ? AnnotationItem::TOP_HEIGHT : AnnotationItem::BOTTOM_HEIGHT
) {
this->setAcceptHoverEvents(true); this->setAcceptHoverEvents(true);
this->setToolTip(this->labelText); this->setToolTip(this->labelText);
} }