fix #180996: bad 2.xx import; compact inspector text panel

This commit is contained in:
Werner Schweer 2017-03-13 10:24:49 +01:00
parent 8976f4f2ef
commit ac3e8dbbc4
6 changed files with 367 additions and 350 deletions

View file

@ -175,10 +175,10 @@ bool Score::sanityCheck(const QString& name)
QString error;
for (Measure* m = firstMeasure(); m; m = m->nextMeasure()) {
Fraction mLen = m->len();
int endStaff = staves().size();
int endStaff = staves().size();
for (int staffIdx = 0; staffIdx < endStaff; ++staffIdx) {
Rest* fmrest0 = 0; // full measure rest in voice 0
Fraction voices[VOICES] = {};
Fraction voices[VOICES];
#ifndef NDEBUG
m->setCorrupted(staffIdx, false);
#endif

View file

@ -1144,9 +1144,7 @@ bool SLine::readProperties(XmlReader& e)
_dashGapLen = e.readDouble();
else if (tag == "lineColor")
_lineColor = e.readColor();
else if (Element::readProperties(e))
;
else
else if (!Element::readProperties(e))
return false;
return true;
}

View file

@ -111,7 +111,8 @@ static constexpr PropertyData propertyList[] = {
{ P_ID::TEXT, "text", false, 0, P_TYPE::STRING },
{ P_ID::HTML_TEXT, "html_text", false, 0, P_TYPE::STRING },
{ P_ID::USER_MODIFIED, "user_modified", false, 0, P_TYPE::BOOL },
{ P_ID::BEAM_POS, "beam_pos", false, 0, P_TYPE::POINT_SP },
// { P_ID::BEAM_POS, "beam_pos", false, 0, P_TYPE::POINT_SP },
{ P_ID::BEAM_POS, "beam_pos", false, 0, P_TYPE::POINT },
{ P_ID::BEAM_MODE, "beam_mode", true, "BeamMode", P_TYPE::BEAM_MODE },
{ P_ID::BEAM_NO_SLOPE, "beam_no_slope", true, "noSlope", P_TYPE::BOOL },
{ P_ID::USER_LEN, "user_len", false, "userLen", P_TYPE::REAL },

View file

@ -45,6 +45,7 @@
#include "pedal.h"
#include "hairpin.h"
#include "ottava.h"
#include "trill.h"
#ifdef OMR
#include "omr/omr.h"
@ -1113,6 +1114,21 @@ static void readHairpin(XmlReader& e, Hairpin* h)
}
}
//---------------------------------------------------------
// readTrill
//---------------------------------------------------------
static void readTrill(XmlReader& e, Trill* t)
{
while (e.readNextStartElement()) {
const QStringRef& tag(e.name());
if (tag == "subtype")
t->setTrillType(e.readElementText());
else if (!t->SLine::readProperties(e))
e.unknown();
}
}
//---------------------------------------------------------
// readTextLine
//---------------------------------------------------------
@ -1494,6 +1510,8 @@ static void readMeasure(Measure* m, int staffIdx, XmlReader& e)
readOttava(e, toOttava(sp));
else if (tag == "HairPin")
readHairpin(e, toHairpin(sp));
else if (tag == "Trill")
readTrill(e, toTrill(sp));
else
readTextLine(e, static_cast<TextLineBase*>(sp));
score->addSpanner(sp);

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>197</width>
<height>157</height>
<width>227</width>
<height>216</height>
</rect>
</property>
<property name="accessibleName">
@ -89,16 +89,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Stacking order:</string>
</property>
<property name="buddy">
<cstring>z</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QToolButton" name="resetOffset">
<property name="toolTip">
@ -224,21 +214,59 @@
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QSpinBox" name="z">
<property name="accessibleName">
<string>Stacking order</string>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
<property name="singleStep">
<number>100</number>
<item row="5" column="1" colspan="2">
<widget class="Ms::OffsetSelect" name="offset" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="Ms::OffsetSelect" name="offset" native="true"/>
<item row="2" column="0" colspan="3">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Stacking order:</string>
</property>
<property name="buddy">
<cstring>z</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="z">
<property name="accessibleName">
<string>Stacking order</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>

View file

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>399</width>
<width>324</width>
<height>357</height>
</rect>
</property>
@ -106,34 +106,303 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Alignment:</string>
<item row="1" column="3">
<widget class="QToolButton" name="resetFontSize">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="buddy">
<cstring>align</cstring>
<property name="accessibleName">
<string>Reset 'Font size' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<item row="6" column="3">
<widget class="QToolButton" name="resetAlign">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Alignment' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="16" column="0" colspan="4">
<widget class="QWidget" name="frameWidget" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="frameWidth">
<property name="prefix">
<string/>
</property>
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="buddy" stdset="0">
<cstring>style</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Awl::ColorLabel" name="bgColor">
<property name="accessibleName">
<string>Color:</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Foreground:</string>
</property>
<property name="indent">
<number>20</number>
</property>
<property name="buddy">
<cstring>frameColor</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Awl::ColorLabel" name="frameColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Color:</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Border:</string>
</property>
<property name="indent">
<number>20</number>
</property>
<property name="buddy">
<cstring>frameWidth</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="resetFrameColor">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Foreground color' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="paddingWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.200000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Background:</string>
</property>
<property name="indent">
<number>20</number>
</property>
<property name="buddy">
<cstring>bgColor</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Text margin:</string>
</property>
<property name="indent">
<number>20</number>
</property>
<property name="buddy">
<cstring>paddingWidth</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Border radius:</string>
</property>
<property name="indent">
<number>20</number>
</property>
<property name="buddy">
<cstring>frameRound</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="frameRound"/>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="resetBgColor">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Background color' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="resetFrameWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset Border thickness' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QToolButton" name="resetPaddingWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset Text margin' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="resetFrameRound">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Border radius' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="Ms::AlignSelect" name="align" native="true">
<property name="toolTip">
<string>Text Alignment</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QSpinBox" name="fontSize">
<property name="toolTip">
<string>Font Size</string>
</property>
<property name="suffix">
<string>pt</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Font style:</string>
<item row="0" column="0" colspan="3">
<widget class="QFontComboBox" name="fontFace">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Font face</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<item row="2" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="bold">
<property name="toolTip">
<string>Font style: Bold</string>
</property>
<property name="accessibleName">
<string>Bold</string>
</property>
@ -178,6 +447,9 @@
</item>
<item>
<widget class="QPushButton" name="italic">
<property name="toolTip">
<string>Font style: Italic</string>
</property>
<property name="accessibleName">
<string>Italic</string>
</property>
@ -228,6 +500,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Font style: Underline</string>
</property>
<property name="accessibleName">
<string>Underline</string>
</property>
@ -257,92 +532,15 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="3">
<widget class="QToolButton" name="resetFontSize">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Font size' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QToolButton" name="resetAlign">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Alignment' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Font face:</string>
</property>
<property name="buddy">
<cstring>fontFace</cstring>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QFontComboBox" name="fontFace">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Font size:</string>
</property>
<property name="buddy">
<cstring>fontSize</cstring>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<widget class="Ms::AlignSelect" name="align" native="true"/>
</item>
<item row="8" column="0" colspan="3">
<item row="8" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="hasFrame">
<property name="toolTip">
<string>Show frame</string>
</property>
<property name="text">
<string>Frame:</string>
</property>
@ -428,232 +626,6 @@
</item>
</layout>
</item>
<item row="16" column="0" colspan="4">
<widget class="QWidget" name="frameWidget" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="frameWidth">
<property name="prefix">
<string/>
</property>
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="buddy" stdset="0">
<cstring>style</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Awl::ColorLabel" name="bgColor">
<property name="accessibleName">
<string>Color:</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Foreground color:</string>
</property>
<property name="indent">
<number>30</number>
</property>
<property name="buddy">
<cstring>frameColor</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Awl::ColorLabel" name="frameColor">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="accessibleName">
<string>Color:</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Border thickness:</string>
</property>
<property name="indent">
<number>30</number>
</property>
<property name="buddy">
<cstring>frameWidth</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="resetFrameColor">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Foreground color' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="paddingWidth">
<property name="suffix">
<string>sp</string>
</property>
<property name="singleStep">
<double>0.200000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Background color:</string>
</property>
<property name="indent">
<number>30</number>
</property>
<property name="buddy">
<cstring>bgColor</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Text margin:</string>
</property>
<property name="indent">
<number>30</number>
</property>
<property name="buddy">
<cstring>paddingWidth</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Border radius:</string>
</property>
<property name="indent">
<number>30</number>
</property>
<property name="buddy">
<cstring>frameRound</cstring>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="frameRound"/>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="resetBgColor">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Background color' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="resetFrameWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset Border thickness' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QToolButton" name="resetPaddingWidth">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset Text margin' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QToolButton" name="resetFrameRound">
<property name="toolTip">
<string>Reset to default</string>
</property>
<property name="accessibleName">
<string>Reset 'Border radius' value</string>
</property>
<property name="text">
<string notr="true"/>
</property>
<property name="icon">
<iconset resource="../musescore.qrc">
<normaloff>:/data/icons/edit-reset.svg</normaloff>:/data/icons/edit-reset.svg</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>