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


C++ PrefDialog::addColorPrefItem方法代码示例

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


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

示例1: prefDialog

void VerticalLine::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString sd = tr("Set Default");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit VerticalLine"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addCheckItem(sd, pl, FALSE);

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);

    bool f = dialog->getCheck(sd);
    if (f)
    {
      defaultColor = color;
      saveDefaults();
    }

    emit signalDraw();
  }

  delete dialog;
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:31,代码来源:VerticalLine.cpp

示例2: prefDialog

void Text::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString sd = tr("Set Default");
  QString fl = tr("Font");
  QString ll = tr("Label");
  QString vl = tr("Value");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit Text"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addFontItem(fl, pl, font);
  dialog->addTextItem(ll, pl, label);
  dialog->addDoubleItem(vl, pl, getValue());
  dialog->addCheckItem(sd, pl, FALSE);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    dialog->getText(ll, label);
    dialog->getFont(fl, font);
    value = dialog->getDouble(vl);
    
    setSaveFlag(TRUE);
    
    bool f = dialog->getCheck(sd);
    if (f)
    {
      dialog->getColor(cl, defaultColor);
      dialog->getFont(fl, dfont);
      saveDefaults();
    }
    
    emit signalDraw();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:43,代码来源:Text.cpp

示例3: prefDialog

void SellArrow::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString vl = tr("Value");
  QString il = tr("Identifier");
  QString bl = tr("Price");
  QString sd = tr("Set Default");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit SellArrow"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addDoubleItem(vl, pl, getValue());
  dialog->addTextItem(il, pl, identifier);
  dialog->addTextItem(bl, pl, price);
  dialog->addCheckItem(sd, pl, FALSE);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    value = dialog->getDouble(vl);
    dialog->getText(il, identifier);
    dialog->getText(bl, price);
    
    setSaveFlag(TRUE);
    
    bool f = dialog->getCheck(sd);
    if (f)
    {
      defaultColor = color;
      saveDefaults();
    }
    
    emit signalDraw();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:42,代码来源:SellArrow.cpp

示例4: prefDialog

void HorizontalLine::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString sd = tr("Set Default");
  QString vl = tr("Value");
  QString tx = tr("Text");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit HorizontalLine"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addDoubleItem(vl, pl, getValue());
  dialog->addTextItem(tx, pl, text);  //cz odkazy na objekty definovane nahore
  dialog->addCheckItem(sd, pl, FALSE);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    value = dialog->getDouble(vl);
    dialog->getText(tx, text);
    setSaveFlag(TRUE);
    
    bool f = dialog->getCheck(sd);
    if (f)
    {
      defaultColor = color;
      saveDefaults();
    }
    
    emit signalDraw();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:38,代码来源:HorizontalLine.cpp


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