Skip to content

Commit 3fbbb9f

Browse files
committed
Fix MSVC compiler warnings
reg.: conversion from 'size_t' to 'int', possible loss of data (C4267)
1 parent 690b0c8 commit 3fbbb9f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/framework/tours/view/toursprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void ToursProvider::doShow()
5151
m_openTimer.stop();
5252

5353
const TourStep& step = m_tour.steps[m_currentStep];
54-
int index = m_currentStep + 1;
54+
size_t index = m_currentStep + 1;
5555

5656
m_currentStep++;
5757

src/inspector/models/measures/measuressettingsmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ bool MeasuresSettingsModel::isMakeIntoSystemAvailable() const
175175
return m_isMakeIntoSystemAvailable;
176176
}
177177

178-
int MeasuresSettingsModel::systemCount() const
178+
size_t MeasuresSettingsModel::systemCount() const
179179
{
180180
return m_systemCount;
181181
}
@@ -213,7 +213,7 @@ void MeasuresSettingsModel::updateIsMakeIntoSystemAvailable()
213213

214214
void MeasuresSettingsModel::updateSystemCount()
215215
{
216-
int count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
216+
size_t count = currentNotation()->elements()->msScore()->selection().selectedSystems().size();
217217
if (count != m_systemCount) {
218218
m_systemCount = count;
219219
emit systemCountChanged(count);

src/inspector/models/measures/measuressettingsmodel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
3939
Q_PROPERTY(bool allSystemsAreLocked READ allSystemsAreLocked NOTIFY allSystemsAreLockedChanged)
4040
Q_PROPERTY(bool scoreIsInPageView READ scoreIsInPageView NOTIFY scoreIsInPageViewChanged)
4141
Q_PROPERTY(bool isMakeIntoSystemAvailable READ isMakeIntoSystemAvailable NOTIFY isMakeIntoSystemAvailableChanged)
42-
Q_PROPERTY(int systemCount READ systemCount NOTIFY systemCountChanged)
42+
Q_PROPERTY(size_t systemCount READ systemCount NOTIFY systemCountChanged)
4343

4444
public:
4545
explicit MeasuresSettingsModel(QObject* parent, IElementRepositoryService* repository);
@@ -79,7 +79,7 @@ class MeasuresSettingsModel : public AbstractInspectorModel
7979
bool scoreIsInPageView() const;
8080
bool isMakeIntoSystemAvailable() const;
8181

82-
int systemCount() const;
82+
size_t systemCount() const;
8383

8484
protected:
8585
void onNotationChanged(const mu::engraving::PropertyIdSet&, const mu::engraving::StyleIdSet&) override;
@@ -94,13 +94,13 @@ class MeasuresSettingsModel : public AbstractInspectorModel
9494
void allSystemsAreLockedChanged(bool allLocked);
9595
void scoreIsInPageViewChanged(bool isInPageView);
9696
void isMakeIntoSystemAvailableChanged(bool isMakeIntoSystemAvailable);
97-
void systemCountChanged(int count);
97+
void systemCountChanged(size_t count);
9898

9999
private:
100100
bool m_allSystemsAreLocked = false;
101101
bool m_scoreIsInPageView = false;
102102
bool m_isMakeIntoSystemAvailable = false;
103-
int m_systemCount = 0;
103+
size_t m_systemCount = 0;
104104
};
105105
}
106106

src/notation/view/notationruler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void NotationRuler::paint(Painter* painter, const NoteInputState& state)
8282
bool currentPositionPainted = false;
8383

8484
for (size_t i = 0; i < lineCount; ++i) {
85-
const int lineTicks = measureTicks + subdivisionTicks * i;
85+
const int lineTicks = measureTicks + subdivisionTicks * static_cast<int>(i);
8686
double lineX = 0.0;
8787

8888
auto it = lineToSegment.find(i);

0 commit comments

Comments
 (0)