Added members variables initialization, removed virtual keyword for overriden methods and made other style fixes by review comments

This commit is contained in:
pereverzev_v 2020-04-14 18:02:25 +02:00
parent acf07f006e
commit 2aa3b18292
28 changed files with 41 additions and 35 deletions

View file

@ -12,7 +12,7 @@
<file>resources/icons/format-text-underline.svg</file>
<file>resources/icons/raster-vertical.svg</file>
<file>resources/icons/raster-horizontal.svg</file>
<file>view/qml/general_inspector/GeneralInspectorView.qml</file>
<file>view/qml/general/GeneralInspectorView.qml</file>
<file>view/qml/InspectorForm.qml</file>
<file>resources/icons/arrow_down.svg</file>
<file>view/qml/common/CheckBox.qml</file>
@ -25,25 +25,25 @@
<file>view/qml/common/FocusableItem.qml</file>
<file>view/qml/common/ExpandableBlankSection.qml</file>
<file>view/qml/common/TabPanel.qml</file>
<file>view/qml/notation_inspector/NotationInspectorView.qml</file>
<file>view/qml/notation/NotationInspectorView.qml</file>
<file>view/qml/common/StyledPopup.qml</file>
<file>view/qml/common/FlatRadioButton.qml</file>
<file>view/qml/common/StyledIcon.qml</file>
<file>view/qml/common/RadioButtonGroup.qml</file>
<file>view/qml/common/FlatButton.qml</file>
<file>view/qml/notation_inspector/NoteSettingsPopup.qml</file>
<file>view/qml/notation_inspector/StemSettings.qml</file>
<file>view/qml/notation_inspector/NoteSettingsTabPanel.qml</file>
<file>view/qml/notation/NoteSettingsPopup.qml</file>
<file>view/qml/notation/StemSettings.qml</file>
<file>view/qml/notation/NoteSettingsTabPanel.qml</file>
<file>resources/icons/horizontal_adjustment.svg</file>
<file>resources/icons/note.svg</file>
<file>resources/icons/orientation_arrow_down.svg</file>
<file>resources/icons/orientation_arrow_up.svg</file>
<file>resources/icons/vertical_adjustment.svg</file>
<file>resources/icons/orientation_auto.svg</file>
<file>view/qml/notation_inspector/HeadSettings.qml</file>
<file>view/qml/notation/HeadSettings.qml</file>
<file>resources/icons/orientation_arrow_left.svg</file>
<file>resources/icons/orientation_arrow_right.svg</file>
<file>view/qml/notation_inspector/internal/NoteheadsGrid.qml</file>
<file>view/qml/notation/internal/NoteheadsGrid.qml</file>
<file>resources/icons/notehead_brevis_alt.svg</file>
<file>resources/icons/notehead_circled.svg</file>
<file>resources/icons/notehead_circled_large.svg</file>
@ -74,12 +74,12 @@
<file>resources/icons/notehead_whole.svg</file>
<file>resources/icons/dot_position_above.svg</file>
<file>resources/icons/dot_position_below.svg</file>
<file>view/qml/notation_inspector/BeamSettings.qml</file>
<file>view/qml/notation/BeamSettings.qml</file>
<file>resources/icons/beam_hight_left.svg</file>
<file>resources/icons/beam_hight_right.svg</file>
<file>resources/icons/feathering_height_left.svg</file>
<file>resources/icons/feathering_height_right.svg</file>
<file>view/qml/notation_inspector/internal/BeamTypesGrid.qml</file>
<file>view/qml/notation/internal/BeamTypesGrid.qml</file>
<file>resources/icons/beams/beam_32_sub.svg</file>
<file>resources/icons/beams/beam_16_sub.svg</file>
<file>resources/icons/beams/beam_middle.svg</file>
@ -88,20 +88,20 @@
<file>resources/icons/beams/beam_auto.svg</file>
<file>resources/icons/beams/beam_pos_lock.svg</file>
<file>view/qml/common/FlatToogleButton.qml</file>
<file>view/qml/general_inspector/playback/PlaybackPopup.qml</file>
<file>view/qml/general_inspector/playback/PlaybackTabPanel.qml</file>
<file>view/qml/general_inspector/playback/GeneralSettingsTab.qml</file>
<file>view/qml/general_inspector/playback/internal/NoteExpandableBlank.qml</file>
<file>view/qml/general/playback/PlaybackPopup.qml</file>
<file>view/qml/general/playback/PlaybackTabPanel.qml</file>
<file>view/qml/general/playback/GeneralSettingsTab.qml</file>
<file>view/qml/general/playback/internal/NoteExpandableBlank.qml</file>
<file>resources/icons/playback.svg</file>
<file>resources/icons/appearance.svg</file>
<file>view/qml/general_inspector/playback/internal/FermataExpandableBlank.qml</file>
<file>view/qml/general/playback/internal/FermataExpandableBlank.qml</file>
<file>view/qml/common/StyledComboBox.qml</file>
<file>view/qml/general_inspector/playback/internal/PausesExpandableBlank.qml</file>
<file>view/qml/general_inspector/playback/internal/GlissandoExpandableBlank.qml</file>
<file>view/qml/general_inspector/playback/internal/DynamicsExpandableBlank.qml</file>
<file>view/qml/general_inspector/playback/DynamicsSettingsTab.qml</file>
<file>view/qml/general_inspector/playback/internal/HairpinsExpandableBlank.qml</file>
<file>view/qml/general_inspector/playback/internal/ArpeggioExpandableBlank.qml</file>
<file>view/qml/general/playback/internal/PausesExpandableBlank.qml</file>
<file>view/qml/general/playback/internal/GlissandoExpandableBlank.qml</file>
<file>view/qml/general/playback/internal/DynamicsExpandableBlank.qml</file>
<file>view/qml/general/playback/DynamicsSettingsTab.qml</file>
<file>view/qml/general/playback/internal/HairpinsExpandableBlank.qml</file>
<file>view/qml/general/playback/internal/ArpeggioExpandableBlank.qml</file>
<file>resources/icons/indeterminate_check_mark.svg</file>
<file>resources/icons/beams/beam_feathered_right.svg</file>
<file>resources/icons/beams/beam_feathered_none.svg</file>

View file

@ -26,7 +26,7 @@ QVariant BeamModeListModel::data(const QModelIndex& index, int role) const
BeamTypesData beamTypeData = m_beamTypesDataList.at(index.row());
switch (role) {
case BeamModeRole: return static_cast<int>(beamTypeData.mode);
case BeamModeRole: return beamTypeData.mode;
case HintRole: return beamTypeData.hint;
default: return QVariant();
}

View file

@ -44,7 +44,7 @@ private:
QHash<int, QByteArray> m_roleNames;
QVector<BeamTypesData> m_beamTypesDataList;
int m_selectedTypeIndex;
int m_selectedTypeIndex = -1;
};
#endif // BEAMTYPESMODEL_H

View file

@ -119,7 +119,11 @@ void NoteheadSettingsModel::setNoteheadTypesModel(NoteheadTypesModel* noteheadTy
});
connect(m_headGroup, &PropertyItem::valueChanged, [this] (const QVariant noteHeadGroup) {
m_noteheadTypesModel->init(static_cast<Ms::NoteHead::Group>(noteHeadGroup.toInt()));
if (m_headGroup->isUndefined()) {
m_noteheadTypesModel->init(Ms::NoteHead::Group::HEAD_INVALID);
} else {
m_noteheadTypesModel->init(static_cast<Ms::NoteHead::Group>(noteHeadGroup.toInt()));
}
});
emit noteheadTypesModelChanged(m_noteheadTypesModel);

View file

@ -38,7 +38,7 @@ signals:
private:
struct HeadTypeData {
Ms::NoteHead::Group group;
Ms::NoteHead::Group group = Ms::NoteHead::Group::HEAD_INVALID;
QString hint;
};

View file

@ -3,8 +3,8 @@ import QtQml.Models 2.3
import MuseScore.Inspectors 3.3
import "common"
import "general_inspector"
import "notation_inspector"
import "general"
import "notation"
FocusableItem {
id: root

View file

@ -38,9 +38,9 @@ ExpandableBlank {
valueRoleName: "value"
model: [
{ text: "Staff", value: Dynamic.SCOPE_STAFF },
{ text: "Single instrument", value: Dynamic.SCOPE_SINGLE_INSTRUMENT },
{ text: "All instruments", value: Dynamic.SCOPE_ALL_INSTRUMENTS }
{ text: qsTr("Staff"), value: Dynamic.SCOPE_STAFF },
{ text: qsTr("Single instrument"), value: Dynamic.SCOPE_SINGLE_INSTRUMENT },
{ text: qsTr("All instruments"), value: Dynamic.SCOPE_ALL_INSTRUMENTS }
]
currentIndex: root.model && !root.model.scopeType.isUndefined ? indexOfValue(root.model.scopeType.value) : -1

View file

@ -37,7 +37,6 @@ FocusableItem {
id: noteheadGridView
noteHeadTypesModel: root.model ? root.model.noteheadTypesModel : null
isIndeterminate: root.model ? root.model.headGroup.isUndefined : false
}
StyledTextLabel {

View file

@ -90,6 +90,6 @@ FocusableItem {
radius: 2
}
currentIndex: noteHeadTypesModel && !isIndeterminate ? noteHeadTypesModel.selectedHeadTypeIndex : -1
currentIndex: noteHeadTypesModel ? noteHeadTypesModel.selectedHeadTypeIndex : -1
}
}

View file

@ -35,11 +35,11 @@ enum class FretDotType : signed char;
class FretCanvas : public QFrame {
Q_OBJECT
FretDiagram* diagram;
int cstring;
int cfret;
FretDiagram* diagram { nullptr };
int cstring { 0 };
int cfret { 0 };
bool _automaticDotType { true };
bool _automaticDotType { true };
FretDotType _currentDtype;
bool _barreMode { false };
bool _multidotMode { false };

View file

@ -207,6 +207,9 @@ public:
const Measure* findMeasure() const;
MeasureBase* findMeasureBase();
const MeasureBase* findMeasureBase() const;
//!Note Returns basic representative for the current element.
//! For example: notes->chord, chords->beam, etc.
virtual Element* elementBase() const { return const_cast<Element*>(this); }
virtual bool isElement() const override { return true; }