Ejemplo n.º 1
0
void LineBand::paintEvent(QPaintEvent * event)
{
    QPainter painter(this);
	setDefaultStyle(painter);
	
	painter.strokePath(mVisiblePath, painter.pen());
}
Ejemplo n.º 2
0
void LassoBand::paintEvent(QPaintEvent * event)
{
    QPainter painter(this);
	setDefaultStyle(painter);
	//updatePath();
	//painter.setOpacity(0.5);
	
	painter.drawPath(mPath);
}
Ejemplo n.º 3
0
gtWriter::gtWriter(bool append, PageItem *pageitem)
{
	action = new gtAction(append, pageitem);
	errorSet = false;
	action->setProgressInfo();
	setDefaultStyle();
	unsetCharacterStyle();
	unsetParagraphStyle();
}
Ejemplo n.º 4
0
bool MScore::readDefaultStyle(QString file)
      {
      if (file.isEmpty())
            return false;
      MStyle style = defaultStyle();
      QFile f(file);
      if (!f.open(QIODevice::ReadOnly))
            return false;
      bool rv = style.load(&f);
      if (rv)
            setDefaultStyle(style);
      f.close();
      return rv;
      }
Ejemplo n.º 5
0
void MScore::init()
      {
      spatium = SPATIUM20;

#ifdef __MINGW32__
      QDir dir(QCoreApplication::applicationDirPath() + QString("/../" INSTALL_NAME));
      _globalShare = dir.absolutePath() + "/";
#else
#ifdef Q_WS_MAC
      QDir dir(QCoreApplication::applicationDirPath() + QString("/../Resources"));
      _globalShare = dir.absolutePath() + "/";
#else
      _globalShare = QString( INSTPREFIX "/share/" INSTALL_NAME);
#endif
#endif
      selectColor[0].setRgb(0, 0, 255);     //blue
      selectColor[1].setRgb(0, 150, 0);     //green
      selectColor[2].setRgb(230, 180, 50);  //yellow
      selectColor[3].setRgb(200, 0, 200);   //purple
      defaultColor        = Qt::black;
      dropColor           = Qt::red;
      nudgeStep           = .1;       // in spatium units (default 0.1)
      defaultPlayDuration = 300;      // ms
      warnPitchRange      = true;
      paperSize           = QPrinter::A4;     // default paper size
      paperWidth          = (210 / INCH);
      paperHeight         = (297 / INCH);
      landscape           = false;
      twosided            = true;
      replaceFractions    = true;
      partStyle           = "";
      layoutBreakColor    = Qt::green;
      soundFont           = _globalShare + "sound/TimGM6mb.sf2";
      bgColor.setRgb(0x76, 0x76, 0x6e);

      _defaultStyle         = new Style();
      setDefaultStyle(_defaultStyle);     // initialize default style
      _baseStyle            = new Style(*_defaultStyle);
      //
      //  load internal fonts
      //
      //
      // do not load application specific fonts
      // for MAC, they are in Resources/fonts
      //
#if !defined(Q_WS_MAC) && !defined(Q_WS_UIKIT)
      static const char* fonts[] = {
            "mscore-20.otf",
            "mscore1-20.ttf",
            "MuseJazz.ttf",
            "FreeSans.ttf",
            "FreeSerifMscore.ttf",
            "FreeSerifBold.ttf",
            "gonville-20.otf",
            "mscore_tab_baroque.ttf",
            "mscore_tab_modern.ttf",
            "mscore_tab_renaiss.ttf",
            "mscore_tab_renaiss2.ttf"
            };
      for (unsigned i = 0; i < sizeof(fonts)/sizeof(*fonts); ++i) {
            QString s = QString(":/fonts/%1").arg(fonts[i]);
            if (-1 == QFontDatabase::addApplicationFont(s)) {
                  fprintf(stderr, "Mscore: fatal error: cannot load internal font <%s>\n", fonts[i]);
                  if (!debugMode)
                        exit(-1);
                  }
            }
#endif
      initSymbols(0);   // init emmentaler symbols
      initStaffTypes();
      initDrumset();
      }
Ejemplo n.º 6
0
void RubberBand::paintEvent(QPaintEvent * event)
{
    QPainter painter(this);
	setDefaultStyle(painter);
	painter.drawPath(mPath);
}