コード例 #1
0
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);
      }
コード例 #2
0
void PageSettings::pageFormatSelected(int size)
      {
      PageFormat pf;
      pf.copy(*preview->score()->pageFormat());
      pf.setSize(&paperSizes[size]);
      double f  = mmUnit ? 1.0/INCH : 1.0;
      pf.setPrintableWidth(pf.width() - (oddPageLeftMargin->value() + oddPageRightMargin->value())  * f);
      preview->score()->setPageFormat(pf);
      updatePreview(0);
      }
コード例 #3
0
void PageSettings::landscapeToggled(bool flag)
      {
      PageFormat pf;
      pf.copy(*preview->score()->pageFormat());
      if (flag ^ (pf.width() > pf.height()))
            pf.setSize(QSizeF(pf.height(), pf.width()));
      double f  = mmUnit ? 1.0/INCH : 1.0;
      pf.setPrintableWidth(pf.width() - (oddPageLeftMargin->value() + oddPageRightMargin->value())  * f);
      preview->score()->setPageFormat(pf);
      updatePreview(0);
      }
コード例 #4
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();
      }