diff --git a/global/context/scorestateobserver.cpp b/global/context/scorestateobserver.cpp index fedff94c44b2b..9a1d63f061b90 100644 --- a/global/context/scorestateobserver.cpp +++ b/global/context/scorestateobserver.cpp @@ -1,8 +1,8 @@ #include "scorestateobserver.h" -ScoreStateObserver::ScoreStateObserver(QObject* parent) : QObject(parent) +ScoreStateObserver::ScoreStateObserver(QObject* parent) + : QObject(parent) { - } Ms::ScoreState ScoreStateObserver::currentState() const @@ -12,8 +12,9 @@ Ms::ScoreState ScoreStateObserver::currentState() const void ScoreStateObserver::setCurrentState(Ms::ScoreState currentState) { - if (m_currentState == currentState) + if (m_currentState == currentState) { return; + } m_currentState = currentState; emit currentStateChanged(m_currentState); diff --git a/global/context/scorestateobserver.h b/global/context/scorestateobserver.h index 8e0c846096a4c..a58529cafb70d 100644 --- a/global/context/scorestateobserver.h +++ b/global/context/scorestateobserver.h @@ -10,7 +10,8 @@ class ScoreStateObserver : public QObject Q_OBJECT public: - static ScoreStateObserver* instance() { + static ScoreStateObserver* instance() + { static ScoreStateObserver obs; return &obs; } diff --git a/global/gui/miconengine.h b/global/gui/miconengine.h index 978a4a3785b35..0d665cfe729e1 100644 --- a/global/gui/miconengine.h +++ b/global/gui/miconengine.h @@ -33,25 +33,25 @@ class MIconEnginePrivate; //--------------------------------------------------------- class MIconEngine : public QIconEngine - { - public: - static QString iconDirPath; - - MIconEngine(); - MIconEngine(const MIconEngine &other); - ~MIconEngine(); - void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state); - QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state); - QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state); - - void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state); - void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state); - - QString key() const; - QIconEngine *clone() const; - - private: - QSharedDataPointer d; - }; +{ +public: + static QString iconDirPath; + + MIconEngine(); + MIconEngine(const MIconEngine& other); + ~MIconEngine(); + void paint(QPainter* painter, const QRect& rect, QIcon::Mode mode, QIcon::State state); + QSize actualSize(const QSize& size, QIcon::Mode mode, QIcon::State state); + QPixmap pixmap(const QSize& size, QIcon::Mode mode, QIcon::State state); + + void addPixmap(const QPixmap& pixmap, QIcon::Mode mode, QIcon::State state); + void addFile(const QString& fileName, const QSize& size, QIcon::Mode mode, QIcon::State state); + + QString key() const; + QIconEngine* clone() const; + +private: + QSharedDataPointer d; +}; #endif diff --git a/libmscore/ambitus.cpp b/libmscore/ambitus.cpp index e66eeeea75643..9310074ca65e0 100644 --- a/libmscore/ambitus.cpp +++ b/libmscore/ambitus.cpp @@ -38,8 +38,8 @@ static const qreal LINEOFFSET_DEFAULT = 0.8; // the distance // Ambitus //--------------------------------------------------------- -Ambitus::Ambitus(Score* s) : - Element(s, ElementFlag::ON_STAFF), _topAccid(s), _bottomAccid(s) +Ambitus::Ambitus(Score* s) + : Element(s, ElementFlag::ON_STAFF), _topAccid(s), _bottomAccid(s) { _noteHeadGroup = NOTEHEADGROUP_DEFAULT; _noteHeadType = NOTEHEADTYPE_DEFAULT; @@ -601,16 +601,16 @@ Ambitus::Ranges Ambitus::estimateRanges() const return result; } Chord* chord; - int firstTrack = track(); - int lastTrack = firstTrack + VOICES-1; - int pitchTop = -1000; - int pitchBottom = 1000; - int tpcTop = 0; // Initialized to prevent warning - int tpcBottom = 0; // Initialized to prevent warning - int trk; + int firstTrack = track(); + int lastTrack = firstTrack + VOICES - 1; + int pitchTop = -1000; + int pitchBottom = 1000; + int tpcTop = 0; // Initialized to prevent warning + int tpcBottom = 0; // Initialized to prevent warning + int trk; Measure* meas = segment()->measure(); Segment* segm = meas->findSegment(SegmentType::ChordRest, segment()->tick()); - bool stop = meas->sectionBreak(); + bool stop = meas->sectionBreak(); while (segm) { // moved to another measure? if (segm->measure() != meas) { @@ -744,35 +744,35 @@ bool Ambitus::setProperty(Pid propertyId, const QVariant& v) //--------------------------------------------------------- QVariant Ambitus::propertyDefault(Pid id) const - { - switch(id) { - case Pid::HEAD_GROUP: - return int(NOTEHEADGROUP_DEFAULT); - case Pid::HEAD_TYPE: - return int(NOTEHEADTYPE_DEFAULT); - case Pid::MIRROR_HEAD: - return int(DIR_DEFAULT); - case Pid::GHOST: - return HASLINE_DEFAULT; - case Pid::LINE_WIDTH: - return Spatium(LINEWIDTH_DEFAULT); - case Pid::TPC1: - return estimateRanges().topTpc; - case Pid::FBPARENTHESIS1: - return estimateRanges().bottomTpc; - case Pid::PITCH: - return estimateRanges().topPitch; - case Pid::FBPARENTHESIS2: - return estimateRanges().bottomPitch; - case Pid::FBPARENTHESIS3: - return int(estimateRanges().topPitch / 12) - 1; - case Pid::FBPARENTHESIS4: - return int(estimateRanges().bottomPitch / 12) - 1; - default: - return Element::propertyDefault(id); - } - //return QVariant(); - } +{ + switch (id) { + case Pid::HEAD_GROUP: + return int(NOTEHEADGROUP_DEFAULT); + case Pid::HEAD_TYPE: + return int(NOTEHEADTYPE_DEFAULT); + case Pid::MIRROR_HEAD: + return int(DIR_DEFAULT); + case Pid::GHOST: + return HASLINE_DEFAULT; + case Pid::LINE_WIDTH: + return Spatium(LINEWIDTH_DEFAULT); + case Pid::TPC1: + return estimateRanges().topTpc; + case Pid::FBPARENTHESIS1: + return estimateRanges().bottomTpc; + case Pid::PITCH: + return estimateRanges().topPitch; + case Pid::FBPARENTHESIS2: + return estimateRanges().bottomPitch; + case Pid::FBPARENTHESIS3: + return int(estimateRanges().topPitch / 12) - 1; + case Pid::FBPARENTHESIS4: + return int(estimateRanges().bottomPitch / 12) - 1; + default: + return Element::propertyDefault(id); + } + //return QVariant(); +} //--------------------------------------------------------- // nextSegmentElement diff --git a/libmscore/barline.cpp b/libmscore/barline.cpp index 08d6c16ef2154..4cdbea055b205 100644 --- a/libmscore/barline.cpp +++ b/libmscore/barline.cpp @@ -631,7 +631,7 @@ void BarLine::draw(QPainter* painter) const break; case BarLineType::DOUBLE_HEAVY: { - qreal lw2 = score()->styleP(Sid::endBarWidth) * mag(); + qreal lw2 = score()->styleP(Sid::endBarWidth) * mag(); painter->setPen(QPen(curColor(), lw2, Qt::SolidLine, Qt::FlatCap)); qreal x = lw2 * .5; painter->drawLine(QLineF(x, y1, x, y2)); @@ -941,24 +941,26 @@ Element* BarLine::drop(EditData& data) //--------------------------------------------------------- void BarLine::setShowTips(bool val) - { - if (!score()) - return; +{ + if (!score()) { + return; + } - score()->undoChangeStyleVal(Sid::repeatBarTips, val); - } + score()->undoChangeStyleVal(Sid::repeatBarTips, val); +} //--------------------------------------------------------- // showTips //--------------------------------------------------------- bool BarLine::showTips() const - { - if (!score()) - return false; +{ + if (!score()) { + return false; + } - return score()->styleB(Sid::repeatBarTips); - } + return score()->styleB(Sid::repeatBarTips); +} //--------------------------------------------------------- // gripsPositions @@ -1297,7 +1299,7 @@ qreal BarLine::layoutWidth(Score* score, BarLineType type) case BarLineType::DOUBLE: w = score->styleP(Sid::doubleBarWidth) + score->styleP(Sid::doubleBarDistance); break; - case BarLineType::DOUBLE_HEAVY: + case BarLineType::DOUBLE_HEAVY: w = score->styleP(Sid::endBarWidth) * 2 + score->styleP(Sid::endBarDistance); break; case BarLineType::END_START_REPEAT: diff --git a/libmscore/beam.cpp b/libmscore/beam.cpp index ef1174da075bc..fdb5adcd2a578 100644 --- a/libmscore/beam.cpp +++ b/libmscore/beam.cpp @@ -55,7 +55,7 @@ struct BeamFragment { //--------------------------------------------------------- Beam::Beam(Score* s) - : Element(s) + : Element(s) { initElementStyle(&beamStyle); _direction = Direction::AUTO; @@ -78,7 +78,7 @@ Beam::Beam(Score* s) //--------------------------------------------------------- Beam::Beam(const Beam& b) - : Element(b) + : Element(b) { _elements = b._elements; _id = b._id; @@ -2276,7 +2276,7 @@ std::vector Beam::gripsPositions(const EditData& ed) const break; } } - for (int i = n-1; i >= 0; --i) { + for (int i = n - 1; i >= 0; --i) { if (_elements[i]->isChordRest()) { c2 = toChordRest(_elements[i]); break; @@ -2500,12 +2500,14 @@ bool Beam::setProperty(Pid propertyId, const QVariant& v) setUserModified(v.toBool()); break; case Pid::BEAM_POS: - if (userModified()) + if (userModified()) { setBeamPos(v.toPointF()); + } break; case Pid::BEAM_NO_SLOPE: - if (v.toBool()) + if (v.toBool()) { alignBeamPosition(); + } break; default: if (!Element::setProperty(propertyId, v)) { diff --git a/libmscore/bend.cpp b/libmscore/bend.cpp index 8e77b77b28c0f..a4d1237e567c3 100644 --- a/libmscore/bend.cpp +++ b/libmscore/bend.cpp @@ -436,7 +436,7 @@ bool Bend::setProperty(Pid id, const QVariant& v) updatePointsByBendType(static_cast(v.toInt())); break; case Pid::BEND_CURVE: - setPoints(v.value>()); + setPoints(v.value >()); break; default: return Element::setProperty(id, v); diff --git a/libmscore/chord.cpp b/libmscore/chord.cpp index d9e984b811bc1..96a1a730eb620 100644 --- a/libmscore/chord.cpp +++ b/libmscore/chord.cpp @@ -2882,12 +2882,13 @@ Element* Chord::drop(EditData& data) //--------------------------------------------------------- void Chord::setColor(const QColor& color) - { - ChordRest::setColor(color); +{ + ChordRest::setColor(color); - for (Note* note : _notes) - note->undoChangeProperty(Pid::COLOR, color); - } + for (Note* note : _notes) { + note->undoChangeProperty(Pid::COLOR, color); + } +} //--------------------------------------------------------- // dotPosX @@ -3660,9 +3661,9 @@ void Chord::undoChangeProperty(Pid id, const QVariant& newValue) void Chord::undoChangeProperty(Pid id, const QVariant& newValue, PropertyFlags ps) { if (id == Pid::VISIBLE) { - processSiblings([=] (Element* element) { - element->undoChangeProperty(id, newValue, ps); - }); + processSiblings([=](Element* element) { + element->undoChangeProperty(id, newValue, ps); + }); } Element::undoChangeProperty(id, newValue, ps); diff --git a/libmscore/chord.h b/libmscore/chord.h index 1c181ae4efd44..0db521a2c3b61 100644 --- a/libmscore/chord.h +++ b/libmscore/chord.h @@ -240,7 +240,7 @@ class Chord final : public ChordRest Shape shape() const override; void undoChangeProperty(Pid id, const QVariant& newValue); - void undoChangeProperty(Pid id, const QVariant &newValue, PropertyFlags ps) override; + void undoChangeProperty(Pid id, const QVariant& newValue, PropertyFlags ps) override; }; } // namespace Ms #endif diff --git a/libmscore/dynamic.cpp b/libmscore/dynamic.cpp index 04d586ab5eac1..b039817131a1f 100644 --- a/libmscore/dynamic.cpp +++ b/libmscore/dynamic.cpp @@ -586,7 +586,7 @@ bool Dynamic::setProperty(Pid propertyId, const QVariant& v) QVariant Dynamic::propertyDefault(Pid id) const { - switch(id) { + switch (id) { case Pid::SUB_STYLE: return int(Tid::DYNAMICS); case Pid::DYNAMIC_RANGE: diff --git a/libmscore/edit.cpp b/libmscore/edit.cpp index 96eed287cdea5..a8ea83af5971b 100644 --- a/libmscore/edit.cpp +++ b/libmscore/edit.cpp @@ -1568,9 +1568,10 @@ void Score::cmdFlip() continue; } } else { - flipOnce(chord, [this, chord](){ + flipOnce(chord, [this, chord]() { Direction dir = chord->up() ? Direction::DOWN : Direction::UP; - chord->undoChangeProperty(Pid::STEM_DIRECTION, QVariant::fromValue(dir), propertyFlags(Pid::STEM_DIRECTION)); + chord->undoChangeProperty(Pid::STEM_DIRECTION, QVariant::fromValue(dir), + propertyFlags(Pid::STEM_DIRECTION)); }); } } diff --git a/libmscore/fret.cpp b/libmscore/fret.cpp index cf723076bfa7c..d088a3027e653 100644 --- a/libmscore/fret.cpp +++ b/libmscore/fret.cpp @@ -1226,10 +1226,9 @@ void FretDiagram::addLoaded(Element* e) if (e->isHarmony()) { _harmony = toHarmony(e); _harmony->setTrack(track()); - } - else { + } else { qWarning("FretDiagram: cannot add <%s>\n", e->name()); - } + } } //--------------------------------------------------------- diff --git a/libmscore/hook.cpp b/libmscore/hook.cpp index 15eb3f985eab7..301d8ef041290 100644 --- a/libmscore/hook.cpp +++ b/libmscore/hook.cpp @@ -33,7 +33,7 @@ Hook::Hook(Score* s) Element* Hook::elementBase() const { - return parent(); + return parent(); } //--------------------------------------------------------- diff --git a/libmscore/image.cpp b/libmscore/image.cpp index 2762a20cddb33..a0608bd33e814 100644 --- a/libmscore/image.cpp +++ b/libmscore/image.cpp @@ -178,8 +178,9 @@ void Image::draw(QPainter* painter) const bool Image::isImageFramed() const { - if (!parent()) + if (!parent()) { return false; + } return parent()->isBox(); } @@ -203,8 +204,9 @@ void Image::updateImageHeight(const qreal& height) _size.setHeight(height); - if (_lockAspectRatio) + if (_lockAspectRatio) { _size.setWidth(height * aspectRatio); + } } //--------------------------------------------------------- @@ -217,8 +219,9 @@ void Image::updateImageWidth(const qreal& width) _size.setWidth(width); - if (_lockAspectRatio) + if (_lockAspectRatio) { _size.setHeight(width / aspectRatio); + } } //--------------------------------------------------------- @@ -563,7 +566,7 @@ void Image::layout() QVariant Image::getProperty(Pid propertyId) const { - switch(propertyId) { + switch (propertyId) { case Pid::AUTOSCALE: return autoScale(); case Pid::SIZE: @@ -591,7 +594,7 @@ bool Image::setProperty(Pid propertyId, const QVariant& v) { bool rv = true; score()->addRefresh(canvasBoundingRect()); - switch(propertyId) { + switch (propertyId) { case Pid::AUTOSCALE: setAutoScale(v.toBool()); break; @@ -631,7 +634,7 @@ bool Image::setProperty(Pid propertyId, const QVariant& v) QVariant Image::propertyDefault(Pid id) const { - switch(id) { + switch (id) { case Pid::AUTOSCALE: return defaultAutoScale; case Pid::SIZE: diff --git a/libmscore/page.cpp b/libmscore/page.cpp index 31b132adb9499..0893caea7080a 100644 --- a/libmscore/page.cpp +++ b/libmscore/page.cpp @@ -314,26 +314,27 @@ QString Page::replaceTextMacros(const QString& s) const QString d; for (int i = 0, n = s.size(); i < n; ++i) { QChar c = s[i]; - if (c == '$' && (i < (n-1))) { - QChar nc = s[i+1]; - switch(nc.toLatin1()) { + if (c == '$' && (i < (n - 1))) { + QChar nc = s[i + 1]; + switch (nc.toLatin1()) { case 'p': // not on first page 1 if (!_no) { break; } - // FALLTHROUGH + // FALLTHROUGH case 'N': // on page 1 only if there are multiple pages - if ( (score()->npages() + score()->pageNumberOffset()) <= 1 ) { + if ((score()->npages() + score()->pageNumberOffset()) <= 1) { break; } - // FALLTHROUGH + // FALLTHROUGH case 'P': // on all pages - { + { int no = _no + 1 + score()->pageNumberOffset(); - if (no > 0 ) - d += QString("%1").arg(no); + if (no > 0) { + d += QString("%1").arg(no); } - break; + } + break; case 'n': d += QString("%1").arg(score()->npages() + score()->pageNumberOffset()); break; @@ -341,7 +342,7 @@ QString Page::replaceTextMacros(const QString& s) const if (!_no) { break; } - // FALLTHROUGH + // FALLTHROUGH case 'I': d += score()->metaTag("partName").toHtmlEscaped(); break; @@ -356,39 +357,45 @@ QString Page::replaceTextMacros(const QString& s) const d += QDate::currentDate().toString(Qt::DefaultLocaleShortDate); break; case 'D': - { + { QString creationDate = score()->metaTag("creationDate"); if (creationDate.isNull()) #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) - // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? + { // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? d += masterScore()->fileInfo()->birthTime().date().toString(Qt::DefaultLocaleShortDate); + } #else + { d += masterScore()->fileInfo()->created().date().toString(Qt::DefaultLocaleShortDate); + } #endif - else + else { // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? d += QDate::fromString(creationDate, Qt::ISODate).toString(Qt::DefaultLocaleShortDate); } - break; + } + break; case 'm': - if ( score()->dirty() ) - // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? - d += QTime::currentTime().toString(Qt::DefaultLocaleShortDate); - else - // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? - d += masterScore()->fileInfo()->lastModified().time().toString(Qt::DefaultLocaleShortDate); + if (score()->dirty()) { + // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? + d += QTime::currentTime().toString(Qt::DefaultLocaleShortDate); + } else { + // ToDo for Qt 5.15: Qt::DefaultLocaleShortDate vs. QLocale ?? + d += masterScore()->fileInfo()->lastModified().time().toString(Qt::DefaultLocaleShortDate); + } break; case 'M': - if ( score()->dirty() ) - d += QDate::currentDate().toString(Qt::DefaultLocaleShortDate); - else - d += masterScore()->fileInfo()->lastModified().date().toString(Qt::DefaultLocaleShortDate); + if (score()->dirty()) { + d += QDate::currentDate().toString(Qt::DefaultLocaleShortDate); + } else { + d += masterScore()->fileInfo()->lastModified().date().toString(Qt::DefaultLocaleShortDate); + } break; case 'C': // only on first page if (_no) { break; } - // FALLTHROUGH + // FALLTHROUGH case 'c': d += score()->metaTag("copyright").toHtmlEscaped(); break; @@ -396,26 +403,27 @@ QString Page::replaceTextMacros(const QString& s) const d += '$'; break; case ':': - { + { QString tag; - int k = i+2; + int k = i + 2; for (; k < n; ++k) { - if (s[k].toLatin1() == ':') - break; - tag += s[k]; - } + if (s[k].toLatin1() == ':') { + break; + } + tag += s[k]; + } if (k != n) { // found ':' ? - d += score()->metaTag(tag).toHtmlEscaped(); - i = k-1; - } + d += score()->metaTag(tag).toHtmlEscaped(); + i = k - 1; } - break; + } + break; default: d += '$'; d += nc; break; } - ++i; + ++i; } else { d += c; } diff --git a/libmscore/staff.h b/libmscore/staff.h index 162a1656039dd..4801af23b8f27 100644 --- a/libmscore/staff.h +++ b/libmscore/staff.h @@ -104,12 +104,12 @@ class Staff final : public Element qreal staffMag(const StaffType*) const; - public: - Staff(Score* score = 0); - Staff* clone() const override; - void init(const InstrumentTemplate*, const StaffType *staffType, int); - void initFromStaffType(const StaffType* staffType); - void init(const Staff*); +public: + Staff(Score* score = 0); + Staff* clone() const override; + void init(const InstrumentTemplate*, const StaffType* staffType, int); + void initFromStaffType(const StaffType* staffType); + void init(const Staff*); ElementType type() const override { return ElementType::STAFF; } diff --git a/libmscore/stem.cpp b/libmscore/stem.cpp index c6ed810ac55b3..49550f0bff241 100644 --- a/libmscore/stem.cpp +++ b/libmscore/stem.cpp @@ -45,9 +45,9 @@ Stem::Stem(Score* s) // elementBase //--------------------------------------------------------- Element* Stem::elementBase() const - { +{ return parent(); - } +} //--------------------------------------------------------- // vStaffIdx diff --git a/libmscore/textbase.cpp b/libmscore/textbase.cpp index a63f039919aff..ae99aac541be6 100644 --- a/libmscore/textbase.cpp +++ b/libmscore/textbase.cpp @@ -203,7 +203,6 @@ const CharFormat TextCursor::selectedFragmentsFormat() const CharFormat resultFormat = _text->textBlock(startRow).fragment(startColumn)->format; for (int row = startRow; row <= endSelectionRow; ++row) { - TextBlock* block = &_text->_layout[row]; if (block->fragments().isEmpty()) { @@ -1969,8 +1968,9 @@ bool TextBase::readProperties(XmlReader& e) { const QStringRef& tag(e.name()); for (Pid i :pids) { - if (readProperty(tag, e, i)) + if (readProperty(tag, e, i)) { return true; + } } if (tag == "text") { setXmlText(e.readXml()); diff --git a/libmscore/textbase.h b/libmscore/textbase.h index 6af14f1bf82ce..90194da9ce915 100644 --- a/libmscore/textbase.h +++ b/libmscore/textbase.h @@ -60,12 +60,13 @@ enum class MultiClick : char { // CharFormat //--------------------------------------------------------- -class CharFormat { - FontStyle _style { FontStyle::Normal }; - bool _preedit { false }; - VerticalAlignment _valign { VerticalAlignment::AlignNormal }; - qreal _fontSize { 12.0 }; - QString _fontFamily { "FreeSerif" }; +class CharFormat +{ + FontStyle _style { FontStyle::Normal }; + bool _preedit { false }; + VerticalAlignment _valign { VerticalAlignment::AlignNormal }; + qreal _fontSize { 12.0 }; + QString _fontFamily { "FreeSerif" }; public: CharFormat() {} @@ -398,9 +399,12 @@ class TextBase : public Element bool bold() const { return fontStyle() & FontStyle::Bold; } bool italic() const { return fontStyle() & FontStyle::Italic; } bool underline() const { return fontStyle() & FontStyle::Underline; } - void setBold(bool val) { setFontStyle( val ? fontStyle() + FontStyle::Bold : fontStyle() - FontStyle::Bold); } - void setItalic(bool val) { setFontStyle( val ? fontStyle() + FontStyle::Italic : fontStyle() - FontStyle::Italic); } - void setUnderline(bool val) { setFontStyle( val ? fontStyle() + FontStyle::Underline : fontStyle() - FontStyle::Underline); } + void setBold(bool val) { setFontStyle(val ? fontStyle() + FontStyle::Bold : fontStyle() - FontStyle::Bold); } + void setItalic(bool val) { setFontStyle(val ? fontStyle() + FontStyle::Italic : fontStyle() - FontStyle::Italic); } + void setUnderline(bool val) + { + setFontStyle(val ? fontStyle() + FontStyle::Underline : fontStyle() - FontStyle::Underline); + } bool hasCustomFormatting() const; diff --git a/libmscore/textedit.cpp b/libmscore/textedit.cpp index d495bd80179a4..af82f01469d0e 100644 --- a/libmscore/textedit.cpp +++ b/libmscore/textedit.cpp @@ -522,13 +522,15 @@ void ChangeText::removeText(EditData* ed) TextBlock& l = c.curLine(); int column = c.column(); - for (int n = 0; n < s.size(); ++n) - l.remove(column, &c); - c.text()->triggerLayout(); - if (ed) - *c.text()->cursorFromEditData(*ed) = tc; - c.text()->setTextInvalid(); - } + for (int n = 0; n < s.size(); ++n) { + l.remove(column, &c); + } + c.text()->triggerLayout(); + if (ed) { + *c.text()->cursorFromEditData(*ed) = tc; + } + c.text()->setTextInvalid(); +} //--------------------------------------------------------- // SplitJoinText @@ -542,15 +544,15 @@ void SplitJoinText::join(EditData* ed) t->triggerLayout(); CharFormat* charFmt = c.format(); // take current format - int col = t->textBlock(line-1).columns(); + int col = t->textBlock(line - 1).columns(); int eol = t->textBlock(line).eol(); - t->textBlock(line-1).fragments().append(t->textBlock(line).fragments()); + t->textBlock(line - 1).fragments().append(t->textBlock(line).fragments()); int lines = t->rows(); if (line < lines) { t->textBlock(line).setEol(eol); } t->textBlockList().removeAt(line); - c.setRow(line-1); + c.setRow(line - 1); c.setColumn(col); c.setFormat(*charFmt); // restore orig. format at new line c.clearSelection(); diff --git a/libmscore/textedit.h b/libmscore/textedit.h index ff7d3f3d27aa0..000460d3ee3a5 100644 --- a/libmscore/textedit.h +++ b/libmscore/textedit.h @@ -30,7 +30,8 @@ struct TextEditData : public ElementEditData { TextBase* _textBase = nullptr; bool deleteText = false; - TextEditData(TextBase* t) : _textBase(t) {} + TextEditData(TextBase* t) + : _textBase(t) {} TextEditData(const TextEditData&) = delete; TextEditData& operator=(const TextEditData&) = delete; ~TextEditData(); diff --git a/libmscore/tremolobar.cpp b/libmscore/tremolobar.cpp index 65274e47b399e..4f9525353833b 100644 --- a/libmscore/tremolobar.cpp +++ b/libmscore/tremolobar.cpp @@ -188,7 +188,7 @@ bool TremoloBar::setProperty(Pid propertyId, const QVariant& v) updatePointsByTremoloBarType(static_cast(v.toInt())); break; case Pid::TREMOLOBAR_CURVE: - setPoints(v.value>()); + setPoints(v.value >()); break; default: return Element::setProperty(propertyId, v); diff --git a/libmscore/types.h b/libmscore/types.h index 80252c2469738..5de8920a0310d 100644 --- a/libmscore/types.h +++ b/libmscore/types.h @@ -145,9 +145,9 @@ enum class ElementType { }; inline uint qHash(const ElementType& key) - { - return static_cast(key); - } +{ + return static_cast(key); +} //--------------------------------------------------------- // AccidentalType diff --git a/mscore/cloud/logindialog.cpp b/mscore/cloud/logindialog.cpp index d1cdeac9537bb..550661e50305e 100644 --- a/mscore/cloud/logindialog.cpp +++ b/mscore/cloud/logindialog.cpp @@ -15,7 +15,6 @@ #include "mu4/cloud/internal/cloudmanager.h" namespace Ms { - //--------------------------------------------------------- // LoginDialog //--------------------------------------------------------- diff --git a/mscore/propertymenu.cpp b/mscore/propertymenu.cpp index 61e0c3555ebf1..6e51b2e232e81 100644 --- a/mscore/propertymenu.cpp +++ b/mscore/propertymenu.cpp @@ -462,7 +462,6 @@ void ScoreView::editTimeSigProperties(TimeSig* ts) TimeSigProperties tsp(r); if (tsp.exec()) { - score()->startCmd(); ts->undoChangeProperty(Pid::SHOW_COURTESY, r->showCourtesySig()); diff --git a/mscore/qmltheme.cpp b/mscore/qmltheme.cpp index b8e3ebf1e77ac..a901716f2c940 100644 --- a/mscore/qmltheme.cpp +++ b/mscore/qmltheme.cpp @@ -21,12 +21,12 @@ using namespace msf; -QmlTheme::QmlTheme(const QPalette& pal, QObject *parent) +QmlTheme::QmlTheme(const QPalette& pal, QObject* parent) : QObject(parent), _palette(pal) { } -void QmlTheme::update(const QPalette &pal) +void QmlTheme::update(const QPalette& pal) { _palette = pal; emit themeChanged(); diff --git a/mscore/qmltheme.h b/mscore/qmltheme.h index 78e7256fb1f49..c9a6850620106 100644 --- a/mscore/qmltheme.h +++ b/mscore/qmltheme.h @@ -25,14 +25,14 @@ #include namespace msf { - class QmlTheme : public QObject { Q_OBJECT #define COLOR_PROPERTY(name, role) \ Q_PROPERTY(QColor name READ get##name NOTIFY themeChanged) \ - QColor get##name() const { return _palette.color(role); } + QColor get##name() const { return _palette.color(role); \ + } COLOR_PROPERTY(window, QPalette::Window) COLOR_PROPERTY(windowText, QPalette::WindowText) @@ -65,7 +65,6 @@ class QmlTheme : public QObject QPalette _palette; }; - } #endif // MSF_QMLTHEME_H diff --git a/mscore/scoreview.cpp b/mscore/scoreview.cpp index 2f7d4a0f799a2..df67c4e1010bc 100644 --- a/mscore/scoreview.cpp +++ b/mscore/scoreview.cpp @@ -3269,7 +3269,8 @@ QVariant ScoreView::inputMethodQuery(Qt::InputMethodQuery query) const r = toPhysical(text->canvasBoundingRect()); } r.setHeight(r.height() + 10); // add a little margin under the cursor - qDebug("ScoreView::inputMethodQuery() updating cursorRect to: (%3f, %3f) + (%3f, %3f)", r.x(), r.y(), r.width(), r.height()); + qDebug("ScoreView::inputMethodQuery() updating cursorRect to: (%3f, %3f) + (%3f, %3f)", r.x(), + r.y(), r.width(), r.height()); return QVariant(r); } case Qt::ImEnabled: diff --git a/mscore/shortcut.cpp b/mscore/shortcut.cpp index 0d50e6c399447..30481a4089fa0 100644 --- a/mscore/shortcut.cpp +++ b/mscore/shortcut.cpp @@ -4537,8 +4537,9 @@ QAction* Shortcut::getActionByName(const char* id) { Shortcut* shortCut = Shortcut::getShortcut(id); - if (!shortCut) + if (!shortCut) { return nullptr; + } return shortCut->action(); } diff --git a/mscore/texttools.h b/mscore/texttools.h index ff486919d1a49..1b7b0bc653de9 100644 --- a/mscore/texttools.h +++ b/mscore/texttools.h @@ -56,7 +56,7 @@ private slots: public: TextTools(QWidget* parent = 0); void updateTools(EditData&); - QAction* kbAction() const { return showKeyboard; } + QAction* kbAction() const { return showKeyboard; } void toggleBold(); void toggleItalic(); void toggleUnderline(); diff --git a/mscore/timeline.cpp b/mscore/timeline.cpp index 0d60bce211c70..bbcd6d00d9b00 100644 --- a/mscore/timeline.cpp +++ b/mscore/timeline.cpp @@ -1569,14 +1569,14 @@ bool Timeline::addMetaValue(int x, int pos, QString metaText, int row, ElementTy } // Adjust x for end repeats - if ((metaText == BarLine::userTypeName(BarLineType::END_REPEAT) || - metaText == BarLine::userTypeName(BarLineType::END) || - metaText == BarLine::userTypeName(BarLineType::DOUBLE) || - metaText == BarLine::userTypeName(BarLineType::REVERSE_END) || - metaText == BarLine::userTypeName(BarLineType::HEAVY) || - metaText == BarLine::userTypeName(BarLineType::DOUBLE_HEAVY) || - std::get<2>(_repeatInfo)) - && !_collapsedMeta) { + if ((metaText == BarLine::userTypeName(BarLineType::END_REPEAT) + || metaText == BarLine::userTypeName(BarLineType::END) + || metaText == BarLine::userTypeName(BarLineType::DOUBLE) + || metaText == BarLine::userTypeName(BarLineType::REVERSE_END) + || metaText == BarLine::userTypeName(BarLineType::HEAVY) + || metaText == BarLine::userTypeName(BarLineType::DOUBLE_HEAVY) + || std::get<2>(_repeatInfo)) + && !_collapsedMeta) { if (std::get<0>(_repeatInfo) > 0) { x = pos + _gridWidth - std::get<1>(_repeatInfo) + std::get<0>(_repeatInfo) * _spacing; } else { @@ -1929,16 +1929,16 @@ void Timeline::drawSelection() if (element->isBarLine()) { staffIdx = -1; BarLine* barline = toBarLine(element); - if (barline && - (barline->barLineType() == BarLineType::END_REPEAT || - barline->barLineType() == BarLineType::DOUBLE || - barline->barLineType() == BarLineType::REVERSE_END || - barline->barLineType() == BarLineType::HEAVY || - barline->barLineType() == BarLineType::DOUBLE_HEAVY || - barline->barLineType() == BarLineType::END) && - measure != _score->lastMeasure()) { - if (measure->prevMeasure()) { - measure = measure->prevMeasure(); + if (barline + && (barline->barLineType() == BarLineType::END_REPEAT + || barline->barLineType() == BarLineType::DOUBLE + || barline->barLineType() == BarLineType::REVERSE_END + || barline->barLineType() == BarLineType::HEAVY + || barline->barLineType() == BarLineType::DOUBLE_HEAVY + || barline->barLineType() == BarLineType::END) + && measure != _score->lastMeasure()) { + if (measure->prevMeasure()) { + measure = measure->prevMeasure(); } } } diff --git a/mscore/widgets/alignSelect.cpp b/mscore/widgets/alignSelect.cpp index 5b418292c397b..1e25cd3423be8 100644 --- a/mscore/widgets/alignSelect.cpp +++ b/mscore/widgets/alignSelect.cpp @@ -15,101 +15,102 @@ #include "inspectoriconloader.h" namespace Ms { - //--------------------------------------------------------- // AlignSelect //--------------------------------------------------------- AlignSelect::AlignSelect(QWidget* parent) - : QWidget(parent) - { - setupUi(this); - - g1 = new QButtonGroup(this); - g1->addButton(alignLeft); - g1->addButton(alignHCenter); - g1->addButton(alignRight); - - g2 = new QButtonGroup(this); - g2->addButton(alignTop); - g2->addButton(alignVCenter); - g2->addButton(alignBaseline); - g2->addButton(alignBottom); - - alignLeft->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_LEFT_ICON)); - alignRight->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_RIGHT_ICON)); - alignHCenter->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_CENTER_ICON)); - alignVCenter->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_CENTER_ICON)); - alignTop->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_TOP_ICON)); - alignBaseline->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_BASELINE_ICON)); - alignBottom->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_BOTTOM_ICON)); - - connect(g1, SIGNAL(buttonToggled(int,bool)), SLOT(_alignChanged())); - connect(g2, SIGNAL(buttonToggled(int,bool)), SLOT(_alignChanged())); - } + : QWidget(parent) +{ + setupUi(this); + + g1 = new QButtonGroup(this); + g1->addButton(alignLeft); + g1->addButton(alignHCenter); + g1->addButton(alignRight); + + g2 = new QButtonGroup(this); + g2->addButton(alignTop); + g2->addButton(alignVCenter); + g2->addButton(alignBaseline); + g2->addButton(alignBottom); + + alignLeft->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_LEFT_ICON)); + alignRight->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_RIGHT_ICON)); + alignHCenter->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_JUSTIFY_CENTER_ICON)); + alignVCenter->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_CENTER_ICON)); + alignTop->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_TOP_ICON)); + alignBaseline->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_BASELINE_ICON)); + alignBottom->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_ALIGN_V_BOTTOM_ICON)); + + connect(g1, SIGNAL(buttonToggled(int,bool)), SLOT(_alignChanged())); + connect(g2, SIGNAL(buttonToggled(int,bool)), SLOT(_alignChanged())); +} //--------------------------------------------------------- // _alignChanged //--------------------------------------------------------- void AlignSelect::_alignChanged() - { - emit alignChanged(align()); - } +{ + emit alignChanged(align()); +} //--------------------------------------------------------- // align //--------------------------------------------------------- Align AlignSelect::align() const - { - Align a = Align::LEFT; - if (alignHCenter->isChecked()) - a = a | Align::HCENTER; - else if (alignRight->isChecked()) - a = a | Align::RIGHT; - if (alignVCenter->isChecked()) - a = a | Align::VCENTER; - else if (alignBottom->isChecked()) - a = a | Align::BOTTOM; - else if (alignBaseline->isChecked()) - a = a | Align::BASELINE; - return a; - } +{ + Align a = Align::LEFT; + if (alignHCenter->isChecked()) { + a = a | Align::HCENTER; + } else if (alignRight->isChecked()) { + a = a | Align::RIGHT; + } + if (alignVCenter->isChecked()) { + a = a | Align::VCENTER; + } else if (alignBottom->isChecked()) { + a = a | Align::BOTTOM; + } else if (alignBaseline->isChecked()) { + a = a | Align::BASELINE; + } + return a; +} //--------------------------------------------------------- // blockAlign //--------------------------------------------------------- void AlignSelect::blockAlign(bool val) - { - g1->blockSignals(val); - g2->blockSignals(val); - } +{ + g1->blockSignals(val); + g2->blockSignals(val); +} //--------------------------------------------------------- // setElement //--------------------------------------------------------- void AlignSelect::setAlign(Align a) - { - blockAlign(true); - if (a & Align::HCENTER) - alignHCenter->setChecked(true); - else if (a & Align::RIGHT) - alignRight->setChecked(true); - else - alignLeft->setChecked(true); - if (a & Align::VCENTER) - alignVCenter->setChecked(true); - else if (a & Align::BOTTOM) - alignBottom->setChecked(true); - else if (a & Align::BASELINE) - alignBaseline->setChecked(true); - else - alignTop->setChecked(true); - blockAlign(false); - } - +{ + blockAlign(true); + if (a & Align::HCENTER) { + alignHCenter->setChecked(true); + } else if (a & Align::RIGHT) { + alignRight->setChecked(true); + } else { + alignLeft->setChecked(true); + } + if (a & Align::VCENTER) { + alignVCenter->setChecked(true); + } else if (a & Align::BOTTOM) { + alignBottom->setChecked(true); + } else if (a & Align::BASELINE) { + alignBaseline->setChecked(true); + } else { + alignTop->setChecked(true); + } + blockAlign(false); +} } - diff --git a/mscore/widgets/alignSelect.h b/mscore/widgets/alignSelect.h index fff784a9eb48f..acbb652468827 100644 --- a/mscore/widgets/alignSelect.h +++ b/mscore/widgets/alignSelect.h @@ -16,35 +16,32 @@ #include "ui_align_select.h" namespace Ms { - enum class Align : char; //--------------------------------------------------------- // AlignSelect //--------------------------------------------------------- -class AlignSelect : public QWidget, public Ui::AlignSelect { - Q_OBJECT - - QButtonGroup* g1; - QButtonGroup* g2; +class AlignSelect : public QWidget, public Ui::AlignSelect +{ + Q_OBJECT - void blockAlign(bool val); + QButtonGroup * g1; + QButtonGroup* g2; - private slots: - void _alignChanged(); + void blockAlign(bool val); - signals: - void alignChanged(Align); +private slots: + void _alignChanged(); - public: - AlignSelect(QWidget* parent); - Align align() const; - void setAlign(Align); - }; +signals: + void alignChanged(Align); +public: + AlignSelect(QWidget* parent); + Align align() const; + void setAlign(Align); +}; } - #endif - diff --git a/mscore/widgets/fontStyleSelect.cpp b/mscore/widgets/fontStyleSelect.cpp index e8b7d8d65c58e..9a6a84267391a 100644 --- a/mscore/widgets/fontStyleSelect.cpp +++ b/mscore/widgets/fontStyleSelect.cpp @@ -14,62 +14,62 @@ #include "inspectoriconloader.h" namespace Ms { - //--------------------------------------------------------- // FontStyleSelect //--------------------------------------------------------- FontStyleSelect::FontStyleSelect(QWidget* parent) - : QWidget(parent) - { - setupUi(this); + : QWidget(parent) +{ + setupUi(this); - bold->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_BOLD_ICON)); - italic->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_ITALIC_ICON)); - underline->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_UNDERLINE_ICON)); + bold->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_BOLD_ICON)); + italic->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_ITALIC_ICON)); + underline->setIcon(*InspectorIconLoader::icon(InspectorIconLoader::TEXT_FORMAT_UNDERLINE_ICON)); - connect(bold, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); - connect(italic, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); - connect(underline, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); - } + connect(bold, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); + connect(italic, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); + connect(underline, SIGNAL(toggled(bool)), SLOT(_fontStyleChanged())); +} //--------------------------------------------------------- // _fontStyleChanged //--------------------------------------------------------- void FontStyleSelect::_fontStyleChanged() - { - emit fontStyleChanged(fontStyle()); - } +{ + emit fontStyleChanged(fontStyle()); +} //--------------------------------------------------------- // fontStyle //--------------------------------------------------------- FontStyle FontStyleSelect::fontStyle() const - { - FontStyle fs = FontStyle::Normal; - - if (bold->isChecked()) - fs = fs + FontStyle::Bold; - if (italic->isChecked()) - fs = fs + FontStyle::Italic; - if (underline->isChecked()) - fs = fs + FontStyle::Underline; - - return fs; - } +{ + FontStyle fs = FontStyle::Normal; + + if (bold->isChecked()) { + fs = fs + FontStyle::Bold; + } + if (italic->isChecked()) { + fs = fs + FontStyle::Italic; + } + if (underline->isChecked()) { + fs = fs + FontStyle::Underline; + } + + return fs; +} //--------------------------------------------------------- // setFontStyle //--------------------------------------------------------- void FontStyleSelect::setFontStyle(FontStyle fs) - { - bold->setChecked(fs & FontStyle::Bold); - italic->setChecked(fs & FontStyle::Italic); - underline->setChecked(fs & FontStyle::Underline); - } - +{ + bold->setChecked(fs & FontStyle::Bold); + italic->setChecked(fs & FontStyle::Italic); + underline->setChecked(fs & FontStyle::Underline); +} } - diff --git a/mscore/widgets/fontStyleSelect.h b/mscore/widgets/fontStyleSelect.h index 51e6b96a7e698..e39e606bb7cd4 100644 --- a/mscore/widgets/fontStyleSelect.h +++ b/mscore/widgets/fontStyleSelect.h @@ -17,29 +17,27 @@ #include "libmscore/types.h" namespace Ms { - enum class Align : char; //--------------------------------------------------------- // FontStyleSelect //--------------------------------------------------------- -class FontStyleSelect : public QWidget, public Ui::FontStyleSelect { - Q_OBJECT - - private slots: - void _fontStyleChanged(); +class FontStyleSelect : public QWidget, public Ui::FontStyleSelect +{ + Q_OBJECT - signals: - void fontStyleChanged(FontStyle); +private slots: + void _fontStyleChanged(); - public: - FontStyleSelect(QWidget* parent); - FontStyle fontStyle() const; - void setFontStyle(FontStyle); - }; +signals: + void fontStyleChanged(FontStyle); +public: + FontStyleSelect(QWidget* parent); + FontStyle fontStyle() const; + void setFontStyle(FontStyle); +}; } #endif - diff --git a/mscore/widgets/offsetSelect.cpp b/mscore/widgets/offsetSelect.cpp index 36fa6ff01973e..ee046418822a6 100644 --- a/mscore/widgets/offsetSelect.cpp +++ b/mscore/widgets/offsetSelect.cpp @@ -16,94 +16,90 @@ #include "musescore.h" namespace Ms { - //--------------------------------------------------------- // OffsetSelect //--------------------------------------------------------- OffsetSelect::OffsetSelect(QWidget* parent) - : QWidget(parent) - { - setupUi(this); - - showRaster(false); - - QAction* a = getAction("hraster"); - a->setCheckable(true); - hRaster->setDefaultAction(a); - hRaster->setContextMenuPolicy(Qt::ActionsContextMenu); - hRaster->addAction(getAction("config-raster")); - - a = getAction("vraster"); - a->setCheckable(true); - vRaster->setDefaultAction(a); - vRaster->setContextMenuPolicy(Qt::ActionsContextMenu); - vRaster->addAction(getAction("config-raster")); - - connect(xVal, SIGNAL(valueChanged(double)), SLOT(_offsetChanged())); - connect(yVal, SIGNAL(valueChanged(double)), SLOT(_offsetChanged())); - } + : QWidget(parent) +{ + setupUi(this); + + showRaster(false); + + QAction* a = getAction("hraster"); + a->setCheckable(true); + hRaster->setDefaultAction(a); + hRaster->setContextMenuPolicy(Qt::ActionsContextMenu); + hRaster->addAction(getAction("config-raster")); + + a = getAction("vraster"); + a->setCheckable(true); + vRaster->setDefaultAction(a); + vRaster->setContextMenuPolicy(Qt::ActionsContextMenu); + vRaster->addAction(getAction("config-raster")); + + connect(xVal, SIGNAL(valueChanged(double)), SLOT(_offsetChanged())); + connect(yVal, SIGNAL(valueChanged(double)), SLOT(_offsetChanged())); +} //--------------------------------------------------------- // setSuffix //--------------------------------------------------------- void OffsetSelect::setSuffix(const QString& s) - { - xVal->setSuffix(s); - yVal->setSuffix(s); - } +{ + xVal->setSuffix(s); + yVal->setSuffix(s); +} //--------------------------------------------------------- // showRaster //--------------------------------------------------------- void OffsetSelect::showRaster(bool v) - { - hRaster->setVisible(v); - vRaster->setVisible(v); - } +{ + hRaster->setVisible(v); + vRaster->setVisible(v); +} //--------------------------------------------------------- // _offsetChanged //--------------------------------------------------------- void OffsetSelect::_offsetChanged() - { - emit offsetChanged(QPointF(xVal->value(), yVal->value())); - } +{ + emit offsetChanged(QPointF(xVal->value(), yVal->value())); +} //--------------------------------------------------------- // offset //--------------------------------------------------------- QPointF OffsetSelect::offset() const - { - return QPointF(xVal->value(), yVal->value()); - } +{ + return QPointF(xVal->value(), yVal->value()); +} //--------------------------------------------------------- // blockOffset //--------------------------------------------------------- void OffsetSelect::blockOffset(bool val) - { - xVal->blockSignals(val); - yVal->blockSignals(val); - } +{ + xVal->blockSignals(val); + yVal->blockSignals(val); +} //--------------------------------------------------------- // setOffset //--------------------------------------------------------- void OffsetSelect::setOffset(const QPointF& o) - { - blockOffset(true); - xVal->setValue(o.x()); - yVal->setValue(o.y()); - blockOffset(false); - } - +{ + blockOffset(true); + xVal->setValue(o.x()); + yVal->setValue(o.y()); + blockOffset(false); +} } - - diff --git a/mscore/widgets/offsetSelect.h b/mscore/widgets/offsetSelect.h index 918bf40af8788..e8c203c79c2f2 100644 --- a/mscore/widgets/offsetSelect.h +++ b/mscore/widgets/offsetSelect.h @@ -16,33 +16,29 @@ #include "ui_offset_select.h" namespace Ms { - //--------------------------------------------------------- // OffsetSelect //--------------------------------------------------------- -class OffsetSelect : public QWidget, public Ui::OffsetSelect { - Q_OBJECT - - void blockOffset(bool val); +class OffsetSelect : public QWidget, public Ui::OffsetSelect +{ + Q_OBJECT - private slots: - void _offsetChanged(); + void blockOffset(bool val); - signals: - void offsetChanged(const QPointF&); +private slots: + void _offsetChanged(); - public: - OffsetSelect(QWidget* parent); - void setSuffix(const QString&); - QPointF offset() const; - void setOffset(const QPointF&); - void showRaster(bool); - }; +signals: + void offsetChanged(const QPointF&); +public: + OffsetSelect(QWidget* parent); + void setSuffix(const QString&); + QPointF offset() const; + void setOffset(const QPointF&); + void showRaster(bool); +}; } - #endif - - diff --git a/mtest/libmscore/all_elements/tst_tree_model.cpp b/mtest/libmscore/all_elements/tst_tree_model.cpp index c7473fe5cfdf6..d231ec809eed5 100644 --- a/mtest/libmscore/all_elements/tst_tree_model.cpp +++ b/mtest/libmscore/all_elements/tst_tree_model.cpp @@ -30,7 +30,7 @@ class TestTreeModel : public QObject, public MTest { Q_OBJECT - MasterScore* score; + MasterScore * score; void beam(const char* path); void tstTree(QString file); void traverseTree(ScoreElement* element); @@ -39,10 +39,10 @@ class TestTreeModel : public QObject, public MTest private slots: void initTestCase(); - void tstTreeElements() { tstTree("layout_elements.mscx"); } + void tstTreeElements() { tstTree("layout_elements.mscx"); } void tstTreeTablature() { tstTree("layout_elements_tab.mscx"); } - void tstTreeMoonlight() { tstTree("moonlight.mscx"); } - void tstTreeGoldberg() { tstTree("goldberg.mscx"); } + void tstTreeMoonlight() { tstTree("moonlight.mscx"); } + void tstTreeGoldberg() { tstTree("goldberg.mscx"); } }; //--------------------------------------------------------- @@ -76,7 +76,7 @@ void TestTreeModel::traverseTree(ScoreElement* element) if (!child) { continue; } - + // if parent is not correct print some logging info and exit if (child->treeParent() != element) { qDebug() << "Element does not have correct parent!";