本文整理汇总了C++中LayoutBreak::layoutBreakType方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBreak::layoutBreakType方法的具体用法?C++ LayoutBreak::layoutBreakType怎么用?C++ LayoutBreak::layoutBreakType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBreak
的用法示例。
在下文中一共展示了LayoutBreak::layoutBreakType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readProperties
bool MeasureBase::readProperties(XmlReader& e)
{
const QStringRef& tag(e.name());
if (tag == "LayoutBreak") {
LayoutBreak* lb = new LayoutBreak(score());
lb->read(e);
bool doAdd = true;
switch (lb->layoutBreakType()) {
case LayoutBreak::LINE:
if (lineBreak())
doAdd = false;
break;
case LayoutBreak::PAGE:
if (pageBreak())
doAdd = false;
break;
case LayoutBreak::SECTION:
if (sectionBreak())
doAdd = false;
break;
case LayoutBreak::NOBREAK:
if (noBreak())
doAdd = false;
break;
}
if (doAdd) {
add(lb);
cleanupLayoutBreaks(false);
}
else
delete lb;
}
else if (tag == "StaffTypeChange") {
StaffTypeChange* stc = new StaffTypeChange(score());
stc->setTrack(e.track());
stc->setParent(this);
stc->read(e);
add(stc);
}
else if (Element::readProperties(e))
;
else
return false;
return true;
}
示例2: drop
Element* Box::drop(const DropData& data)
{
Element* e = data.element;
switch(e->type()) {
case LAYOUT_BREAK:
{
LayoutBreak* lb = static_cast<LayoutBreak*>(e);
if (_pageBreak || _lineBreak) {
if (
(lb->layoutBreakType() == LAYOUT_BREAK_PAGE && _pageBreak)
|| (lb->layoutBreakType() == LAYOUT_BREAK_LINE && _lineBreak)
|| (lb->layoutBreakType() == LAYOUT_BREAK_SECTION && _sectionBreak)
) {
//
// if break already set
//
delete lb;
break;
}
foreach(Element* elem, _el) {
if (elem->type() == LAYOUT_BREAK) {
score()->undoChangeElement(elem, e);
break;
}
}
break;
}
lb->setTrack(-1); // this are system elements
lb->setParent(this);
score()->undoAddElement(lb);
return lb;
}
case STAFF_TEXT:
{
Text* text = new Text(score());
text->setTextStyle(score()->textStyle(TEXT_STYLE_FRAME));
text->setParent(this);
text->setHtml(static_cast<StaffText*>(e)->getHtml());
score()->undoAddElement(text);
delete e;
return text;
}
case ICON:
switch(static_cast<Icon*>(e)->iconType()) {
case ICON_VFRAME:
score()->insertMeasure(VBOX, this);
break;
case ICON_TFRAME:
score()->insertMeasure(TBOX, this);
break;
case ICON_FFRAME:
score()->insertMeasure(FBOX, this);
break;
case ICON_MEASURE:
score()->insertMeasure(MEASURE, this);
break;
}
break;
default:
e->setParent(this);
score()->undoAddElement(e);
return e;
}
return 0;
}
示例3: drop
Element* Box::drop(const DropData& data)
{
Element* e = data.element;
if (e->flag(ElementFlag::ON_STAFF))
return 0;
switch (e->type()) {
case Element::Type::LAYOUT_BREAK:
{
LayoutBreak* lb = static_cast<LayoutBreak*>(e);
if (_pageBreak || _lineBreak) {
if (
(lb->layoutBreakType() == LayoutBreak::Type::PAGE && _pageBreak)
|| (lb->layoutBreakType() == LayoutBreak::Type::LINE && _lineBreak)
|| (lb->layoutBreakType() == LayoutBreak::Type::SECTION && _sectionBreak)
) {
//
// if break already set
//
delete lb;
break;
}
foreach (Element* elem, _el) {
if (elem->type() == Element::Type::LAYOUT_BREAK) {
score()->undoChangeElement(elem, e);
break;
}
}
break;
}
lb->setTrack(-1); // these are system elements
lb->setParent(this);
score()->undoAddElement(lb);
return lb;
}
case Element::Type::STAFF_TEXT:
{
Text* text = new Text(score());
text->setTextStyleType(TextStyleType::FRAME);
text->setParent(this);
text->setXmlText(static_cast<StaffText*>(e)->xmlText());
score()->undoAddElement(text);
delete e;
return text;
}
case Element::Type::ICON:
switch(static_cast<Icon*>(e)->iconType()) {
case IconType::VFRAME:
score()->insertMeasure(Element::Type::VBOX, this);
break;
case IconType::TFRAME:
score()->insertMeasure(Element::Type::TBOX, this);
break;
case IconType::FFRAME:
score()->insertMeasure(Element::Type::FBOX, this);
break;
case IconType::MEASURE:
score()->insertMeasure(Element::Type::MEASURE, this);
break;
default:
break;
}
break;
case Element::Type::TEXT:
case Element::Type::IMAGE:
case Element::Type::SYMBOL:
e->setParent(this);
score()->undoAddElement(e);
return e;
default:
return 0;
}
return 0;
}