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


C++ QCheckBox::font方法代码示例

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


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

示例1: sceneChanged

void GroupSelWidget::sceneChanged()
{
    QSet<QString> groupSet = _scene->getAllGroups();
    if(groupSet == _prevGroupSet)
        return;
    _prevGroupSet = groupSet;

    QList<QString> groups = groupSet.toList();
    qSort(groups);

    for(int i = 0; i < (int)_checkBoxes.size(); ++i)
        delete _checkBoxes[i];
    _checkBoxes.clear();

    int childWidth = 0;
    for(int i = 0; i < (int)groups.size(); ++i) {
        QCheckBox *box =  new QCheckBox(groups[i], this);
        QFont font = box->font();
        font.setPointSize(14);
        box->setFont(font);
        box->setCheckState(_scene->isGroupVisible(groups[i]) ? Qt::Checked : Qt::Unchecked);
        new VisibilitySetter(box, _scene, groups[i]);
        layout()->addWidget(box);
        childWidth = max(childWidth, box->sizeHint().width());
        _checkBoxes.push_back(box);
    }

    setMinimumWidth(150);

    QWidget *scrollArea = parentWidget()->parentWidget()->parentWidget();
    scrollArea->setMinimumWidth(childWidth + 20);
}
开发者ID:F2X,项目名称:cornucopia-lib,代码行数:32,代码来源:GroupSelWidget.cpp

示例2: doTick

void MetronomeWindow::doTick() {
	if( this->tickIndex >= this->accentChecks.size() ) this->tickIndex = 0;
	QCheckBox *box = this->accentChecks.at(this->tickIndex);
	if( box->isChecked() )
		this->ticker->tick(Ticker::HighTick);
	else
		this->ticker->tick(Ticker::LowTick);
	int size = this->accentChecks.size();
	for( int i=0; i<size; i++ ) {
		QCheckBox *temp = this->accentChecks.at(i);
		QFont font(temp->font());
		font.setBold(false);
		temp->setFont( font );
	}
	QFont font(box->font());
	font.setBold(true);
	box->setFont( font );

	this->tickIndex++;
}
开发者ID:jrharshath,项目名称:qmetronome,代码行数:20,代码来源:MetronomeWindow.cpp

示例3: fileInfo

ToolInstance::ToolInstance(QString filename, ToolInformation information, mcrl2::gui::qt::PersistentFileDialog* fileDialog, QWidget *parent) :
  QWidget(parent),
  m_filename(filename),
  m_info(information),
  m_fileDialog(fileDialog)
{
  m_ui.setupUi(this);

  connect(this, SIGNAL(colorChanged(QColor)), this, SLOT(onColorChanged(QColor)));

  connect(&m_process, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(onStateChange(QProcess::ProcessState)));
  connect(&m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(onStandardOutput()));
  connect(&m_process, SIGNAL(readyReadStandardError()), this, SLOT(onStandardError()));
  connect(m_ui.btnRun, SIGNAL(clicked()), this, SLOT(onRun()));
  connect(m_ui.btnAbort, SIGNAL(clicked()), this, SLOT(onAbort()));
  connect(m_ui.btnSave, SIGNAL(clicked()), this, SLOT(onSave()));
  connect(m_ui.btnClear, SIGNAL(clicked()), m_ui.edtOutput, SLOT(clear()));

  QFileInfo fileInfo(filename);

  m_process.setWorkingDirectory(fileInfo.absoluteDir().absolutePath());
  m_ui.lblDirectoryValue->setText(fileInfo.absoluteDir().absolutePath());
  m_ui.lblFileValue->setText(fileInfo.fileName());

  if (m_info.hasOutput())
  {
    QDir dir = fileInfo.absoluteDir();
    QString newfile = fileInfo.baseName().append(".%1").arg(m_info.output);
    int filenr = 0;
    while(dir.exists(newfile))
    {
      filenr++;
      newfile = fileInfo.baseName().append("_%1.%2").arg(filenr).arg(m_info.output);
    }
    m_pckFileOut = new FilePicker(m_fileDialog, m_ui.pckFileOut);
    m_ui.pckFileOut->layout()->addWidget(m_pckFileOut);
    m_pckFileOut->setText(newfile);
  }
  else
  {
    m_pckFileOut = NULL;
    m_ui.lblFileOut->setVisible(false);
    m_ui.pckFileOut->setVisible(false);
  }

  if (m_info.hasSecondInput())
  {
    m_pckFileIn = new FilePicker(m_fileDialog, m_ui.pckFileIn, false);
    m_ui.pckFileIn->layout()->addWidget(m_pckFileIn);
  }
  else
  {
    m_pckFileIn = NULL;
    m_ui.lblFileIn->setVisible(false);
    m_ui.pckFileIn->setVisible(false);
  }

  QFormLayout *formLayout = new QFormLayout();
  formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
  for (int i = 0; i < m_info.options.count(); i++)
  {
    ToolOption option = m_info.options.at(i);
    QWidget *nameOpt = NULL;
    QCheckBox* cbOpt = NULL;
    QVBoxLayout *lytOpt = new QVBoxLayout();

    if (option.argument.type == EnumArgument)
    {
      nameOpt = new QLabel("<b>"+option.nameLong+": </b>");
    }
    else
    {
      cbOpt = new QCheckBox(option.nameLong + ": ", this);
      cbOpt->setChecked(option.standard);
      QFont font(cbOpt->font());
      font.setBold(true);
      cbOpt->setFont(font);
      nameOpt = cbOpt;
    }

    formLayout->addRow(nameOpt, lytOpt);

    QLabel *lblOpt = new QLabel(option.description, this);
    lblOpt->setAlignment(Qt::AlignJustify | Qt::AlignTop);
    lblOpt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
    lblOpt->setWordWrap(true);
    lytOpt->addWidget(lblOpt);

    if (!option.hasArgument())
    {
      m_optionValues.append(new OptionValue(option, cbOpt));
    }
    else
    {
      switch (option.argument.type)
      {
        case StringArgument:
        case LevelArgument:
        case IntegerArgument:
        case RealArgument:
//.........这里部分代码省略.........
开发者ID:gijskant,项目名称:mcrl2-pmc,代码行数:101,代码来源:toolinstance.cpp


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