Skip to content

Commit

Permalink
Update itemRect to use QRectF
Browse files Browse the repository at this point in the history
  • Loading branch information
ketgg authored and cbjeukendrup committed Jan 9, 2025
1 parent 5ba07f6 commit 60240db
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/notation/view/abstractelementpopupmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PopupModelType AbstractElementPopupModel::modelType() const
return m_modelType;
}

QRect AbstractElementPopupModel::itemRect() const
QRectF AbstractElementPopupModel::itemRect() const
{
return m_itemRect;
}
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/notation/view/abstractelementpopupmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<muse::actions::IActionsDispatcher> dispatcher = { this };
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 60240db

Please sign in to comment.