当前位置: 首页>>代码示例>>C++>>正文


C++ PaletteScrollArea::setRestrictHeight方法代码示例

本文整理汇总了C++中PaletteScrollArea::setRestrictHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ PaletteScrollArea::setRestrictHeight方法的具体用法?C++ PaletteScrollArea::setRestrictHeight怎么用?C++ PaletteScrollArea::setRestrictHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PaletteScrollArea的用法示例。


在下文中一共展示了PaletteScrollArea::setRestrictHeight方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

TextPalette::TextPalette(QWidget* parent)
   : QWidget(parent)
      {
      setWindowFlags(Qt::Tool);
      setupUi(this);

      codePage->setEnabled(false);

      pCommon = new Palette;
      pCommon->setName(QT_TRANSLATE_NOOP("Palette", "common symbols"));
      pCommon->setMag(0.8);
      pCommon->setGrid(33, 60);
      pCommon->setReadOnly(true);

      pAll = new Palette;
      pAll->setName(QT_TRANSLATE_NOOP("Palette", "all font symbols"));
      pAll->setMag(0.8);
      pAll->setGrid(33, 60);
      pAll->setReadOnly(true);

      PaletteScrollArea* psa = new PaletteScrollArea(pCommon);
      psa->setRestrictHeight(false);
      stack->addWidget(psa);

      psa = new PaletteScrollArea(pAll);
      psa->setRestrictHeight(false);
      stack->addWidget(psa);

      connect(commonButton,  SIGNAL(toggled(bool)),       SLOT(commonToggled(bool)));
      connect(stack,         SIGNAL(currentChanged(int)), SLOT(pageChanged(int)));
      connect(codePage,      SIGNAL(valueChanged(int)),   SLOT(populateAll()));
      setFocusPolicy(Qt::NoFocus);
      }
开发者ID:eightx8,项目名称:MuseScore,代码行数:33,代码来源:textpalette.cpp

示例2: addPalette

void MasterPalette::addPalette(Palette* sp)
      {
      sp->setReadOnly(true);
      PaletteScrollArea* psa = new PaletteScrollArea(sp);
      psa->setRestrictHeight(false);
      stack->addWidget(psa);
      }
开发者ID:33akash,项目名称:MuseScore,代码行数:7,代码来源:masterpalette.cpp

示例3: addPalette

void MasterPalette::addPalette(Palette* sp)
      {
      sp->setReadOnly(true);
      PaletteScrollArea* psa = new PaletteScrollArea(sp);
      psa->setRestrictHeight(false);
      QTreeWidgetItem* item = new QTreeWidgetItem(QStringList(sp->name()));
      item->setData(0, Qt::UserRole, stack->count());
      stack->addWidget(psa);
      treeWidget->addTopLevelItem(item);
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:10,代码来源:masterpalette.cpp

示例4: createPalette

Palette* MasterPalette::createPalette(int w, int h, bool grid, double mag)
      {
      Palette* sp = new Palette;
      PaletteScrollArea* psa = new PaletteScrollArea(sp);
      psa->setRestrictHeight(false);
      sp->setMag(mag);
      sp->setGrid(w, h);
      sp->setDrawGrid(grid);
      sp->setReadOnly(true);
      stack->addWidget(psa);
      return sp;
      }
开发者ID:33akash,项目名称:MuseScore,代码行数:12,代码来源:masterpalette.cpp

示例5: setChordList

void ChordStyleEditor::setChordList(ChordList* cl)
      {
      harmonyList->clear();
      foreach (const ChordDescription& d, *cl) {
            QTreeWidgetItem* item = new QTreeWidgetItem;
            item->setData(0, Qt::UserRole, QVariant::fromValue<void*>((void*)&d));
            item->setText(0, QString("%1").arg(d.id));
            if (!d.names.isEmpty())
                  item->setText(1, QString("%1").arg(d.names.front()));
            harmonyList->addTopLevelItem(item);
            }
      delete chordList;
      chordList = new ChordList(*cl);
      canvas->setChordDescription(0, 0);

      paletteTab->clear();
      foreach(const ChordFont& f, chordList->fonts) {
            // create symbol palette
            Palette* p = new Palette();
            PaletteScrollArea* accPalette = new PaletteScrollArea(p);
            QSizePolicy policy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
            accPalette->setSizePolicy(policy1);
            accPalette->setRestrictHeight(false);
            p->setGrid(50, 50);
            paletteTab->addTab(accPalette, f.family);
            QFont qf(f.family);
            qf.setStyleStrategy(QFont::NoFontMerging);
            int size = lrint(20.0 * DPI / PPI);
            qf.setPixelSize(size);

            QFontMetricsF fi(qf);
            for (int i = 0; i < 255; ++i) {
                  if (fi.inFont(QChar(i))) {
                        FSymbol* s = new FSymbol(gscore);
                        s->setFont(qf);
                        s->setCode(i);
                        p->append(s, "??");
                        }
                  }
            }
      raise();
      }
开发者ID:CammyVee,项目名称:MuseScore,代码行数:42,代码来源:harmonyedit.cpp

示例6: fi

TextPalette::TextPalette(QWidget* parent)
   : QWidget(parent)
      {
      setWindowFlags(Qt::Tool);
      setupUi(this);

      pCommon = new Palette;
      pCommon->setMag(0.8);
      pCommon->setGrid(33, 60);
      pCommon->setReadOnly(true);

      pSmufl = new Palette;
      pSmufl->setMag(0.8);
      pSmufl->setGrid(33, 60);
      pSmufl->setReadOnly(true);

      pUnicode = new Palette;
      pUnicode->setMag(0.8);
      pUnicode->setGrid(33, 60);
      pUnicode->setReadOnly(true);

      PaletteScrollArea* psa = new PaletteScrollArea(pCommon);
      psa->setRestrictHeight(false);

      tabWidget->clear();
      tabWidget->addTab(psa, tr("Common Symbols"));

      psa = new PaletteScrollArea(pSmufl);
      psa->setRestrictHeight(false);

      QSplitter* ws = new QSplitter;
      lws = new QListWidget;

      ScoreFont* scoreFont = ScoreFont::fontFactory("Bravura");
      QFile fi(scoreFont->fontPath() + "ranges.json");
      if (!fi.open(QIODevice::ReadOnly))
            qDebug("ScoreFont: open ranges file <%s> failed", qPrintable(fi.fileName()));
      QJsonParseError error;
      QJsonObject o = QJsonDocument::fromJson(fi.readAll(), &error).object();
      if (error.error != QJsonParseError::NoError)
            qDebug("Json parse error in <%s>(offset: %d): %s", qPrintable(fi.fileName()),
               error.offset, qPrintable(error.errorString()));
	int i = 0;
      QStringList smuflRangeNames;
      for (auto s : o.keys()) {
            QJsonObject range = o.value(s).toObject();
            QString desc = range.value("description").toString();
            QJsonArray glyphs = range.value("glyphs").toArray();
            if (glyphs.size() > 0) {
                  for (QJsonValue g : glyphs)
                        smuflMap[i].append(g.toString());
                  smuflRangeNames.append(desc);
                  i++;
                  }
            }

      lws->addItems(smuflRangeNames);
      lws->setCurrentRow(0);

      ws->addWidget(lws);
      ws->addWidget(psa);

      tabWidget->addTab(ws, tr("Musical Symbols"));

      psa = new PaletteScrollArea(pUnicode);
      psa->setRestrictHeight(false);

      QSplitter* wu = new QSplitter;
      lwu = new QListWidget;
      lwu->setSortingEnabled(true);
      for (i = 0; i < unicodeRangeNames.length(); i++) {
            QListWidgetItem* newItem = new QListWidgetItem(qApp->translate("accidental", unicodeRangeNames.at(i).toUtf8().constData()));
            newItem->setData(Qt::UserRole, i);
            lwu->addItem(newItem);
            if (i == 0)
                  lwu->setCurrentItem(newItem);
            }

      wu->addWidget(lwu);
      wu->addWidget(psa);

      tabWidget->addTab(wu, tr("Unicode Symbols"));

      connect(lws, SIGNAL(currentRowChanged(int)), SLOT(populateSmufl()));
      connect(lwu, SIGNAL(currentRowChanged(int)), SLOT(populateUnicode()));

	// others are done in setFont
      populateSmufl();

      setFocusPolicy(Qt::NoFocus);
      }
开发者ID:FryderykChopin,项目名称:MuseScore,代码行数:91,代码来源:textpalette.cpp

示例7: QWidget

TextPalette::TextPalette(QWidget* parent)
   : QWidget(parent)
      {
      setWindowFlags(Qt::Tool);
      setupUi(this);

      pCommon = new Palette;
      pCommon->setMag(0.8);
      pCommon->setGrid(33, 60);
      pCommon->setReadOnly(true);

      pSmufl = new Palette;
      pSmufl->setMag(0.8);
      pSmufl->setGrid(33, 60);
      pSmufl->setReadOnly(true);

      pUnicode = new Palette;
      pUnicode->setMag(0.8);
      pUnicode->setGrid(33, 60);
      pUnicode->setReadOnly(true);

      PaletteScrollArea* psa = new PaletteScrollArea(pCommon);
      psa->setRestrictHeight(false);

      tabWidget->clear();
      tabWidget->addTab(psa, tr("Common Symbols"));

      psa = new PaletteScrollArea(pSmufl);
      psa->setRestrictHeight(false);

      QSplitter* ws = new QSplitter;
      lws = new QListWidget;

      lws->addItems(smuflRanges()->keys());
      lws->setCurrentRow(0);

      ws->addWidget(lws);
      ws->addWidget(psa);

      tabWidget->addTab(ws, tr("Musical Symbols"));

      psa = new PaletteScrollArea(pUnicode);
      psa->setRestrictHeight(false);

      QSplitter* wu = new QSplitter;
      lwu = new QListWidget;
      lwu->setSortingEnabled(true);
      for (int i = 0; i < unicodeRangeNames.length(); i++) {
            QListWidgetItem* newItem = new QListWidgetItem(qApp->translate("accidental", unicodeRangeNames.at(i).toUtf8().constData()));
            newItem->setData(Qt::UserRole, i);
            lwu->addItem(newItem);
            if (i == 0)
                  lwu->setCurrentItem(newItem);
            }

      wu->addWidget(lwu);
      wu->addWidget(psa);

      tabWidget->addTab(wu, tr("Unicode Symbols"));

      connect(lws, SIGNAL(currentRowChanged(int)), SLOT(populateSmufl()));
      connect(lwu, SIGNAL(currentRowChanged(int)), SLOT(populateUnicode()));

	// others are done in setFont
      populateSmufl();

      setFocusPolicy(Qt::NoFocus);
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:68,代码来源:textpalette.cpp


注:本文中的PaletteScrollArea::setRestrictHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。