void PageSettings::ormChanged(double val) { if (mmUnit) val /= INCH; PageFormat pf; pf.copy(*preview->score()->pageFormat()); if (twosided->isChecked()) { evenPageLeftMargin->blockSignals(true); evenPageLeftMargin->setValue(val * (mmUnit ? INCH : 1.0)); pf.setEvenLeftMargin(val); evenPageLeftMargin->blockSignals(false); } else { evenPageRightMargin->blockSignals(true); evenPageRightMargin->setValue(val * (mmUnit ? INCH : 1.0)); evenPageRightMargin->blockSignals(false); } pf.setPrintableWidth(pf.width() - pf.oddLeftMargin() - val); preview->score()->setPageFormat(pf); updatePreview(0); }
void PageSettings::applyToScore(Score* s) { double f = mmUnit ? 1.0/INCH : 1.0; double f1 = mmUnit ? MScore::DPMM : MScore::DPI; PageFormat pf; pf.setSize(QSizeF(pageWidth->value(), pageHeight->value()) * f); pf.setPrintableWidth((pageWidth->value() - oddPageLeftMargin->value() - oddPageRightMargin->value()) * f); pf.setEvenTopMargin(evenPageTopMargin->value() * f); pf.setEvenBottomMargin(evenPageBottomMargin->value() * f); pf.setEvenLeftMargin(evenPageLeftMargin->value() * f); pf.setOddTopMargin(oddPageTopMargin->value() * f); pf.setOddBottomMargin(oddPageBottomMargin->value() * f); pf.setOddLeftMargin(oddPageLeftMargin->value() * f); pf.setTwosided(twosided->isChecked()); double sp = spatiumEntry->value() * f1; s->startCmd(); s->undoChangePageFormat(&pf, sp, pageOffsetEntry->value()-1); s->endCmd(); }