From 60240db8b8d17e01b4386ee874d7a025352bd409 Mon Sep 17 00:00:00 2001 From: re1san Date: Thu, 22 Aug 2024 20:28:49 +0530 Subject: [PATCH] Update itemRect to use QRectF --- src/notation/view/abstractelementpopupmodel.cpp | 4 ++-- src/notation/view/abstractelementpopupmodel.h | 8 ++++---- .../view/internal/soundflag/soundflagsettingsmodel.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/notation/view/abstractelementpopupmodel.cpp b/src/notation/view/abstractelementpopupmodel.cpp index 49b285a307b3a..70d19cab7f729 100644 --- a/src/notation/view/abstractelementpopupmodel.cpp +++ b/src/notation/view/abstractelementpopupmodel.cpp @@ -55,7 +55,7 @@ PopupModelType AbstractElementPopupModel::modelType() const return m_modelType; } -QRect AbstractElementPopupModel::itemRect() const +QRectF AbstractElementPopupModel::itemRect() const { return m_itemRect; } @@ -232,7 +232,7 @@ const mu::engraving::ElementTypeSet& AbstractElementPopupModel::dependentElement void AbstractElementPopupModel::updateItemRect() { - QRect rect = m_item ? fromLogical(m_item->canvasBoundingRect()).toQRect() : QRect(); + QRectF rect = m_item ? fromLogical(m_item->canvasBoundingRect()).toQRectF() : QRectF(); if (m_itemRect != rect) { m_itemRect = rect; diff --git a/src/notation/view/abstractelementpopupmodel.h b/src/notation/view/abstractelementpopupmodel.h index 5adb8385b6656..bebdb481c5f5f 100644 --- a/src/notation/view/abstractelementpopupmodel.h +++ b/src/notation/view/abstractelementpopupmodel.h @@ -37,7 +37,7 @@ class AbstractElementPopupModel : public QObject, public muse::Injectable, publi Q_OBJECT Q_PROPERTY(PopupModelType modelType READ modelType CONSTANT) - Q_PROPERTY(QRect itemRect READ itemRect NOTIFY itemRectChanged) + Q_PROPERTY(QRectF itemRect READ itemRect NOTIFY itemRectChanged) public: muse::Inject dispatcher = { this }; @@ -58,7 +58,7 @@ class AbstractElementPopupModel : public QObject, public muse::Injectable, publi AbstractElementPopupModel(PopupModelType modelType, QObject* parent = nullptr); PopupModelType modelType() const; - QRect itemRect() const; + QRectF itemRect() const; static bool supportsPopup(const mu::engraving::EngravingItem* element); static PopupModelType modelTypeFromElement(const mu::engraving::ElementType& elementType); @@ -67,7 +67,7 @@ class AbstractElementPopupModel : public QObject, public muse::Injectable, publi signals: void dataChanged(); - void itemRectChanged(QRect rect); + void itemRectChanged(QRectF rect); protected: muse::PointF fromLogical(muse::PointF point) const; @@ -96,7 +96,7 @@ class AbstractElementPopupModel : public QObject, public muse::Injectable, publi void updateItemRect(); PopupModelType m_modelType = PopupModelType::TYPE_UNDEFINED; - QRect m_itemRect; + QRectF m_itemRect; }; using PopupModelType = AbstractElementPopupModel::PopupModelType; diff --git a/src/playback/view/internal/soundflag/soundflagsettingsmodel.cpp b/src/playback/view/internal/soundflag/soundflagsettingsmodel.cpp index 055e2bca487df..7eb95e26eeb16 100644 --- a/src/playback/view/internal/soundflag/soundflagsettingsmodel.cpp +++ b/src/playback/view/internal/soundflag/soundflagsettingsmodel.cpp @@ -99,7 +99,7 @@ void SoundFlagSettingsModel::init() { TRACEFUNC; - connect(this, &SoundFlagSettingsModel::itemRectChanged, this, [this](const QRect&) { + connect(this, &SoundFlagSettingsModel::itemRectChanged, this, [this](const QRectF&) { QRect rect = iconRect(); if (rect.isValid()) { emit iconRectChanged(rect);