本文整理汇总了C++中PaletteScrollArea类的典型用法代码示例。如果您正苦于以下问题:C++ PaletteScrollArea类的具体用法?C++ PaletteScrollArea怎么用?C++ PaletteScrollArea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PaletteScrollArea类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PaletteScrollArea
void MasterPalette::addPalette(Palette* sp)
{
sp->setReadOnly(true);
PaletteScrollArea* psa = new PaletteScrollArea(sp);
psa->setRestrictHeight(false);
stack->addWidget(psa);
}
示例2: 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);
}
示例3: PaletteScrollArea
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);
}
示例4: QDockWidget
DrumTools::DrumTools(QWidget* parent)
: QDockWidget(parent)
{
drumset = 0;
_score = 0;
setObjectName("drum-tools");
setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));
QWidget* w = new QWidget(this);
w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
w->setMaximumHeight(100);
QHBoxLayout* layout = new QHBoxLayout;
w->setLayout(layout);
QVBoxLayout* layout1 = new QVBoxLayout;
layout1->setSpacing(6);
pitchName = new QLabel;
pitchName->setAlignment(Qt::AlignCenter);
pitchName->setWordWrap(true);
pitchName->setContentsMargins(25, 0, 25, 0);
layout1->addWidget(pitchName);
QHBoxLayout* buttonLayout = new QHBoxLayout;
buttonLayout->setContentsMargins(25, 10, 25, 10);
editButton = new QToolButton;
editButton->setMinimumWidth(100);
editButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
buttonLayout->addWidget(editButton);
layout1->addLayout(buttonLayout);
layout->addLayout(layout1);
drumPalette = new Palette;
drumPalette->setMag(0.8);
drumPalette->setSelectable(true);
drumPalette->setGrid(28, 60);
PaletteScrollArea* sa = new PaletteScrollArea(drumPalette);
sa->setFocusPolicy(Qt::NoFocus);
layout->addWidget(sa);
setWidget(w);
w = new QWidget(this);
setTitleBarWidget(w);
titleBarWidget()->hide();
connect(editButton, SIGNAL(clicked()), SLOT(editDrumset()));
void boxClicked(int);
connect(drumPalette, SIGNAL(boxClicked(int)), SLOT(drumNoteSelected(int)));
retranslate();
drumPalette->setContextMenuPolicy(Qt::PreventContextMenu);
}
示例5: foreach
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();
}
示例6: QDockWidget
DrumTools::DrumTools(QWidget* parent)
: QDockWidget(parent)
{
drumset = 0;
_score = 0;
setObjectName("drum-tools");
setWindowTitle(tr("Drum Tools"));
setAllowedAreas(Qt::DockWidgetAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea));
QWidget* w = new QWidget(this);
w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
QHBoxLayout* layout = new QHBoxLayout;
w->setLayout(layout);
QVBoxLayout* layout1 = new QVBoxLayout;
QToolButton* tb = new QToolButton;
tb->setText(tr("Edit Drumset"));
layout1->addWidget(tb);
layout1->addStretch();
layout->addLayout(layout1);
drumPalette = new Palette;
drumPalette->setName(tr("Drums"));
drumPalette->setMag(0.8);
drumPalette->setSelectable(true);
drumPalette->setGrid(28, 60);
PaletteScrollArea* sa = new PaletteScrollArea(drumPalette);
sa->setFocusPolicy(Qt::NoFocus);
layout->addWidget(sa);
setWidget(w);
// setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
w = new QWidget(this);
setTitleBarWidget(w);
titleBarWidget()->hide();
connect(tb, SIGNAL(clicked()), SLOT(editDrumset()));
void boxClicked(int);
connect(drumPalette, SIGNAL(boxClicked(int)), SLOT(drumNoteSelected(int)));
}
示例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;
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);
}
示例8: 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);
}