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


C++ TextWidget::setFont方法代码示例

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


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

示例1: initialize

void PLFO::initialize(PVirtualPort* out, PDimmer* k, PDimmer* range,
                      PDimmer* offset, PSelector* selector)
{
    TextWidget* title = new TextWidget(tr("LFO"), this);
    title->setFont(QFont("Courier", 18, QFont::Bold));

    k->setSize(80, 80);
    range->setSize(80, 80);
    offset->setSize(80, 80);
    selector->setMaximumSize(120, 155);

    // Layout
    bottomArea()->addCornerAnchors(k, Qt::BottomLeftCorner, bottomArea(), Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(k, Qt::BottomRightCorner, offset, Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(k, Qt::TopRightCorner, range, Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(range, Qt::BottomRightCorner, offset, Qt::TopRightCorner);
    bottomArea()->addCornerAnchors(offset, Qt::BottomRightCorner, selector, Qt::BottomLeftCorner);

    bottomArea()->addCornerAnchors(selector, Qt::BottomRightCorner, bottomArea(), Qt::BottomRightCorner);
    bottomArea()->addCornerAnchors(selector, Qt::TopRightCorner, bottomArea(), Qt::TopRightCorner);

    rightArea()->addAnchors(out, rightArea());
    centerArea()->addAnchors(title, centerArea());

    bottomArea()->activate();
    layout()->activate();
}
开发者ID:iMax-pp,项目名称:SynthPro,代码行数:27,代码来源:plfo.cpp

示例2: initialize

void PSampler::initialize(PVirtualPort* in, PVirtualPort* out, PVirtualPort* gate, PDimmer* bpm,
                          PPushButton* record, PPushButton* stop, PPushButton* play)
{
    TextWidget* title = new TextWidget(tr("Sampler"), this);
    title->setFont(QFont("Courier", 18, QFont::Bold));

    bpm->setSize(80, 80);

    record->setIcon(QIcon(":/src/resources/images/record-icon.png"));
    stop->setIcon(QIcon(":/src/resources/images/stop-icon.png"));
    play->setIcon(QIcon(":/src/resources/images/play-icon.png"));

    ProgressBarWidget* progressBar = new ProgressBarWidget(this);
    connect(this, SIGNAL(valueChanged(int)), progressBar, SLOT(setValue(int)));
    connect(this, SIGNAL(lengthChanged(int)), progressBar, SLOT(setMaximum(int)));

    // Layout
    bottomArea()->addCornerAnchors(record, Qt::TopLeftCorner, bottomArea(), Qt::TopLeftCorner);
    bottomArea()->addCornerAnchors(record, Qt::TopRightCorner, stop, Qt::TopLeftCorner);
    bottomArea()->addCornerAnchors(stop, Qt::TopRightCorner, play, Qt::TopLeftCorner);
    bottomArea()->addCornerAnchors(progressBar, Qt::BottomLeftCorner, bottomArea(), Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(progressBar, Qt::BottomRightCorner, gate, Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(gate, Qt::BottomRightCorner, bpm, Qt::BottomLeftCorner);

    bottomArea()->addCornerAnchors(bpm, Qt::TopRightCorner, bottomArea(), Qt::TopRightCorner);
    bottomArea()->addCornerAnchors(bpm, Qt::BottomRightCorner, bottomArea(), Qt::BottomRightCorner);

    leftArea()->addAnchors(in, leftArea());
    centerArea()->addAnchors(title, centerArea());
    rightArea()->addAnchors(out, rightArea());

    bottomArea()->activate();
    layout()->activate();
}
开发者ID:iMax-pp,项目名称:SynthPro,代码行数:34,代码来源:psampler.cpp

示例3: initialize

void PDelay::initialize(PVirtualPort* in, PVirtualPort* out, PDimmer* duration, PDimmer* decay)
{
    TextWidget* title = new TextWidget(tr("Delay"), this);
    title->setFont(QFont("Courier", 18, QFont::Bold));

    duration->setSize(80, 80);
    decay->setSize(80, 80);

    // Layout
    bottomArea()->addCornerAnchors(duration, Qt::TopLeftCorner, bottomArea(), Qt::TopLeftCorner);
    bottomArea()->addCornerAnchors(decay, Qt::TopRightCorner, bottomArea(), Qt::TopRightCorner);
    bottomArea()->addCornerAnchors(duration, Qt::BottomLeftCorner, bottomArea(), Qt::BottomLeftCorner);
    bottomArea()->addCornerAnchors(decay, Qt::BottomRightCorner, bottomArea(), Qt::BottomRightCorner);
    bottomArea()->addAnchor(duration, Qt::AnchorRight, decay, Qt::AnchorLeft);

    leftArea()->addAnchors(in, leftArea());
    rightArea()->addAnchors(out, rightArea());
    centerArea()->addAnchors(title, centerArea());

    bottomArea()->activate();
    layout()->activate();
}
开发者ID:iMax-pp,项目名称:SynthPro,代码行数:22,代码来源:pdelay.cpp


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