Skip to content

Commit

Permalink
Merge pull request #25049 from cbjeukendrup/warnings
Browse files Browse the repository at this point in the history
Fix compiler/clazy/moc/QML warnings
  • Loading branch information
cbjeukendrup authored Oct 7, 2024
2 parents d7d20b0 + a27f0b9 commit 392c8c0
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion sandbox/engraving/fontproviderstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ qreal FontProviderStub::height(const Font&) const
return 0.0;
}

qreal FontProviderStub::capHeight(const Font &f) const
qreal FontProviderStub::capHeight(const Font&) const
{
return 0.0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/appshell/qml/HomePage/HomeMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Item {
delegate: PageTabButton {
id: radioButtonDelegate

width: parent.width
width: radioButtonList.width

navigation.name: title
navigation.panel: navPanel
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/score/systemlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ void SystemLayout::layoutSystemElements(System* system, LayoutContext& ctx)
}
}
}
for (auto staffSticking : staffStickings) {
for (const auto& staffSticking : staffStickings) {
AlignmentLayout::alignItemsGroup(staffSticking.second.stickingsAbove, system);
AlignmentLayout::alignItemsGroup(staffSticking.second.stickingsBelow, system);
}
Expand Down
8 changes: 4 additions & 4 deletions src/framework/dockwindow/view/dockpageview.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ class DockPageView : public QQuickItem, public muse::Injectable
Q_OBJECT

Q_PROPERTY(QString uri READ uri WRITE setUri NOTIFY uriChanged)
Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> mainToolBars READ mainToolBarsProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> toolBars READ toolBarsProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockingHolderView> toolBarsDockingHolders READ toolBarsDockingHoldersProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockPanelView> panels READ panelsProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> mainToolBars READ mainToolBarsProperty CONSTANT)
Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> toolBars READ toolBarsProperty CONSTANT)
Q_PROPERTY(QQmlListProperty<muse::dock::DockingHolderView> toolBarsDockingHolders READ toolBarsDockingHoldersProperty CONSTANT)
Q_PROPERTY(QQmlListProperty<muse::dock::DockPanelView> panels READ panelsProperty CONSTANT)
Q_PROPERTY(QQmlListProperty<muse::dock::DockingHolderView> panelsDockingHolders READ panelsDockingHoldersProperty)
Q_PROPERTY(muse::dock::DockCentralView * centralDock READ centralDock WRITE setCentralDock NOTIFY centralDockChanged)
Q_PROPERTY(muse::dock::DockStatusBarView * statusBar READ statusBar WRITE setStatusBar NOTIFY statusBarChanged)
Expand Down
5 changes: 2 additions & 3 deletions src/framework/dockwindow/view/dockwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "framework/uicomponents/view/qmllistproperty.h"

#include "async/asyncable.h"
#include "async/asyncable.h"

#include "modularity/ioc.h"
Expand Down Expand Up @@ -55,8 +54,8 @@ class DockWindow : public QQuickItem, public IDockWindow, public muse::Injectabl

Q_PROPERTY(QString currentPageUri READ currentPageUri NOTIFY currentPageUriChanged)

Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> toolBars READ toolBarsProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockPageView> pages READ pagesProperty)
Q_PROPERTY(QQmlListProperty<muse::dock::DockToolBarView> toolBars READ toolBarsProperty CONSTANT)
Q_PROPERTY(QQmlListProperty<muse::dock::DockPageView> pages READ pagesProperty CONSTANT)

Q_PROPERTY(QQuickWindow * window READ windowProperty NOTIFY windowPropertyChanged)

Expand Down
10 changes: 0 additions & 10 deletions src/framework/draw/internal/fontsengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,12 @@ static const double DEFAULT_PIXEL_SIZE = 100.0;
static const double SYMBOLS_PIXEL_SIZE = 200.0;
static const double LOADED_PIXEL_SIZE = 200.0;

static const double TEXT_LINE_SCALE = 1.2;

static const int SDF_WIDTH = 64;
static const int SDF_HEIGHT = 64;

static inline RectF fromFBBox(const FBBox& bb, double scale)
{
return RectF(from_f26d6(bb.left()) * scale, from_f26d6(bb.top()) * scale,
from_f26d6(bb.width()) * scale, from_f26d6(bb.height()) * scale);
}

static inline RectF scaleRect(const RectF& r, double scale)
{
return RectF(r.x() * scale, r.y() * scale, r.width() * scale, r.height() * scale);
}

static const IFontFace* findSubtitutionFont(char32_t ch, const std::vector<IFontFace*>& subtitutionFaces)
{
const IFontFace* founded = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/framework/uicomponents/view/buttonboxmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const std::vector <ButtonBoxModel::ButtonRole>& ButtonBoxModel::chooseButtonLayo
if (m_buttonLayout != ButtonLayout::UnknownLayout) {
index = static_cast<size_t>(m_buttonLayout);
} else {
#if defined (Q_OS_OSX)
#if defined (Q_OS_MACOS)
index = 1;
#elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX) || defined(Q_OS_FREEBSD)
index = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ StyledDialogView {
UpdateModel {
id: updateModel

onFinished: {
onFinished: function(errorCode, installerPath) {
root.ret = { errcode: errorCode, value: installerPath }
root.hide()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6583,7 +6583,7 @@ Note* MusicXMLParserPass2::note(const String& partId,
String tieType;
MusicXMLParserLyric lyric { m_pass1.getMusicXmlPart(partId).lyricNumberHandler(), m_e, m_score, m_logger,
m_pass1.isVocalStaff(partId) };
MusicXMLParserNotations notations { m_e, m_score, m_logger, m_pass1, *this };
MusicXMLParserNotations notations { m_e, m_score, m_logger, *this };

MxmlNoteDuration mnd { m_divs, m_logger, &m_pass1 };
MxmlNotePitch mnp { m_logger };
Expand Down Expand Up @@ -8624,9 +8624,8 @@ String Notation::print() const
// MusicXMLParserNotations
//---------------------------------------------------------

MusicXMLParserNotations::MusicXMLParserNotations(XmlStreamReader& e, Score* score, MxmlLogger* logger, MusicXMLParserPass1& pass1,
mu::engraving::MusicXMLParserPass2& pass2)
: m_e(e), m_pass1(pass1), m_pass2(pass2), m_score(score), m_logger(logger)
MusicXMLParserNotations::MusicXMLParserNotations(XmlStreamReader& e, Score* score, MxmlLogger* logger, MusicXMLParserPass2& pass2)
: m_e(e), m_pass2(pass2), m_score(score), m_logger(logger)
{
// nothing
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ using MusicXMLTieMap = std::map<TieLocation, Tie*>;
class MusicXMLParserNotations
{
public:
MusicXMLParserNotations(muse::XmlStreamReader& e, Score* score, MxmlLogger* logger, MusicXMLParserPass1& pass1,
MusicXMLParserPass2& pass2);
MusicXMLParserNotations(muse::XmlStreamReader& e, Score* score, MxmlLogger* logger, MusicXMLParserPass2& pass2);
void parse();
void addToScore(ChordRest* const cr, Note* const note, const int tick, SlurStack& slurs, Glissando* glissandi[MAX_NUMBER_LEVEL][2],
MusicXmlSpannerMap& spanners, TrillStack& trills, MusicXMLTieMap& ties, std::vector<Note*>& unstartedTieNotes,
Expand Down Expand Up @@ -344,7 +343,6 @@ class MusicXMLParserNotations
void tuplet();
void otherNotation();
muse::XmlStreamReader& m_e;
MusicXMLParserPass1& m_pass1;
MusicXMLParserPass2& m_pass2;
Score* m_score = nullptr; // the score
MxmlLogger* m_logger = nullptr; // the error logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PercussionPanelPadListModel : public QAbstractListModel
Q_OBJECT

Q_PROPERTY(int numColumns READ numColumns CONSTANT)
Q_PROPERTY(int numPads READ numPads NOTIFY numPadsChanged CONSTANT)
Q_PROPERTY(int numPads READ numPads NOTIFY numPadsChanged)

public:
explicit PercussionPanelPadListModel(QObject* parent = nullptr);
Expand Down
2 changes: 1 addition & 1 deletion tools/check_build_without_qt/fontproviderstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ double FontProviderStub::height(const Font&) const
return 0.0;
}

double FontProviderStub::capHeight(const Font& f) const
double FontProviderStub::capHeight(const Font&) const
{
return 0.0;
}
Expand Down

0 comments on commit 392c8c0

Please sign in to comment.