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


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

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


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

示例1: indicatorPrefDialog

int LOWPASS::indicatorPrefDialog (QWidget *w)
{
  QString pl = QObject::tr("Parms");
  QString cl = QObject::tr("Color");
  QString ll = QObject::tr("Label");
  QString ltl = QObject::tr("Line Type");
  QString fl = QObject::tr("Freq");
  QString wl = QObject::tr("Width");
  QString il = QObject::tr("Input");
  
  PrefDialog *dialog = new PrefDialog(w);
  dialog->setCaption(QObject::tr("LOWPASS Indicator"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  dialog->addColorItem(cl, pl, color);
  dialog->addTextItem(ll, pl, label);
  dialog->addComboItem(ltl, pl, lineTypes, lineType);
  dialog->addComboItem(il, pl, inputTypeList, input);
  dialog->addDoubleItem(fl, pl, freq, 0, 0.5);
  dialog->addDoubleItem(wl, pl, width, 0.0001, 0.2);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    lineType = (PlotLine::LineType) dialog->getComboIndex(ltl);
    dialog->getText(ll, label);
    input = (BarData::InputType) dialog->getComboIndex(il);

    freq = dialog->getDouble(fl);
    if (freq < 0.0)
      freq = 0.0;
    if (freq > 0.5)
      freq = 0.5;

    width = dialog->getDouble(wl);
    if (width < 0.0001)
      width = 0.0001;
    if (width > 0.2)
      width = 0.2;

    rc = TRUE;
  }
  else
    rc = FALSE;
  
  delete dialog;
  return rc;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:51,代码来源:LOWPASS.cpp

示例2: formatDialog

void LOWPASS::formatDialog (QStringList &vl, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);
  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  QString fl = QObject::tr("Freq");
  QString wl = QObject::tr("Width");
  QString il = QObject::tr("Input");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("LOWPASS Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  dialog->addTextItem(vnl, pl, s);
  dialog->addComboItem(il, pl, vl, input);
  dialog->addDoubleItem(fl, pl, freq, 0, 0.5);
  dialog->addDoubleItem(wl, pl, width, 0.0001, 0.2);

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);

    dialog->getCombo(il, s);
    rs.append(s + ",");

    double t = dialog->getDouble(fl);
    rs.append(QString::number(t) + ",");

    t = dialog->getDouble(wl);
    rs.append(QString::number(t));
  }

  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:38,代码来源:LOWPASS.cpp

示例3: formatDialog

void THERM::formatDialog (QStringList &, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);
  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  QString tl = QObject::tr("Threshold");
  QString sl = QObject::tr("Smoothing");
  QString stl = QObject::tr("Smoothing Type");
  QString mpl = QObject::tr("MA Period");
  QString mtl = QObject::tr("MA Type");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("THERM Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  QStringList l;
  getMATypes(l);
  dialog->addTextItem(vnl, pl, s);
  dialog->addComboItem(mtl, pl, l, maType);
  dialog->addIntItem(mpl, pl, maPeriod, 0, 99999999);
  dialog->addDoubleItem(tl, pl, threshold, 1, 99999999);
  dialog->addComboItem(stl, pl, l, smoothType);
  dialog->addIntItem(sl, pl, smoothing, 0, 99999999);

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);

    dialog->getCombo(mtl, rs);

    int t = dialog->getInt(mpl);
    rs.append("," + QString::number(t));

    double d = dialog->getDouble(tl);
    rs.append("," + QString::number(d));

    dialog->getCombo(stl, s);
    rs.append("," + s);

    t = dialog->getInt(sl);
    rs.append("," + QString::number(t));
  }

  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:49,代码来源:THERM.cpp

示例4: editItem

void IndexDialog::editItem ()
{
  QListViewItem *item = list->selectedItem();
  if (! item)
    return;

  QString s = item->text(0);
  double weight = item->text(1).toFloat();
  
  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit Index Item"));
  QString pl = tr("Details");
  dialog->createPage (pl);
  QString t = tr("Symbol");
  Config config;
  QString t2;
  config.getData(Config::DataPath, t2);
  dialog->addSymbolItem(t, pl, t2, s);
  t = tr("Weight");
  dialog->addDoubleItem(t, pl, weight);
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    t = tr("Symbol");
    dialog->getSymbol(t, s);
    if (! s.length())
    {
      delete dialog;
      return;
    }
    
    t = tr("Weight");
    weight = dialog->getDouble(t);
    
    symbolDict.remove(item->text(0));
    QStringList l = QStringList::split("/", s, FALSE);
    symbolDict.insert(l[l.count() - 1], new QString(s));
    
    item->setText(0, l[l.count() - 1]);
    item->setText(1, QString::number(weight));
   
    buttonStatus();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:47,代码来源:IndexDialog.cpp

示例5: 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

示例6: 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

示例7: addItem

void IndexDialog::addItem ()
{
  double weight = 1;
  QString s;
  
  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Add Index Item"));
  QString pl = tr("Details");
  dialog->createPage (pl);
  QString t = tr("Symbol");
  Config config;
  QString t2;
  config.getData(Config::DataPath, t2);
  dialog->addSymbolItem(t, pl, t2, s);
  t = tr("Weight");
  dialog->addDoubleItem(t, pl, weight);
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    t = tr("Symbol");
    dialog->getSymbol(t, s);
    if (! s.length())
    {
      delete dialog;
      return;
    }
    
    t = tr("Weight");
    weight = dialog->getDouble(t);
    
    QStringList l = QStringList::split("/", s, FALSE);
    symbolDict.insert(l[l.count() - 1], new QString(s));
    
    new QListViewItem(list, l[l.count() - 1], QString::number(weight));
    
    buttonStatus();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:41,代码来源:IndexDialog.cpp

示例8: 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

示例9: indicatorPrefDialog


//.........这里部分代码省略.........
    l.append(QObject::tr("Default"));
    l.append(QObject::tr("Custom"));
    dialog->addComboItem(pfml, pl, l, pfMethod);

    dialog->addColorItem(pfxcl, pl, pfXColor);
    dialog->addColorItem(pfocl, pl, pfOColor);

    double bs = pfBoxSize;
    int rv = pfReversal;

    if (! pfMethod.compare(QObject::tr("Custom")))
    {
      QString s;
      Config config;
      config.getData(Config::CurrentChart, s);
      QFileInfo fi(s);
      s = fi.fileName();

      DBBase db;
      if (! db.open(dbPath))
      {
        QString s2;
        db.getData(s, s2);
        if (s2.length())
        {
          QStringList l = QStringList::split(",", s2, FALSE);
          bs = l[0].toDouble();
          rv = l[1].toInt();
        }
        db.close();
      }
    }

    dialog->addDoubleItem(pfbsl, pl, bs, 0.0001, 999999.0);
    dialog->addIntItem(pfrl, pl, rv, 1, 99);
  }

  dialog->addTextItem(ll, pl, label);

  QStringList mal;
  getMATypes(mal);

  if (! method.compare("OHLC") || ! method.compare("Candle") || ! method.compare("HACandle"))
  {
    dialog->createPage (pl2);
    dialog->addColorItem(macl, pl2, maColor);
    dialog->addTextItem(mall, pl2, maLabel);
    dialog->addComboItem(maltl, pl2, lineTypes, maLineType);
    dialog->addComboItem(matl, pl2, mal, maType);
    dialog->addIntItem(mapl, pl2, maPeriod, 1, 999999);
    dialog->addComboItem(mail, pl2, inputTypeList, maInput);

    dialog->createPage (pl3);
    dialog->addColorItem(ma2cl, pl3, maColor2);
    dialog->addTextItem(ma2ll, pl3, maLabel2);
    dialog->addComboItem(ma2ltl, pl3, lineTypes, maLineType2);
    dialog->addComboItem(ma2tl, pl3, mal, maType2);
    dialog->addIntItem(ma2pl, pl3, maPeriod2, 1, 999999);
    dialog->addComboItem(ma2il, pl3, inputTypeList, maInput2);

    dialog->createPage (pl4);
    dialog->addColorItem(ma3cl, pl4, maColor3);
    dialog->addTextItem(ma3ll, pl4, maLabel3);
    dialog->addComboItem(ma3ltl, pl4, lineTypes, maLineType3);
    dialog->addComboItem(ma3tl, pl4, mal, maType3);
    dialog->addIntItem(ma3pl, pl4, maPeriod3, 1, 999999);
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:67,代码来源:BARS.cpp

示例10: formatDialog

void TALIB::formatDialog (QStringList &vl, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);

  const TA_FuncHandle *handle;
  const TA_FuncInfo *theInfo;
 
  // open a TALIB handle
  TA_RetCode retCode = TA_GetFuncHandle(formatMethod, &handle);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::getFormatList:can't open handle");
    return;
  }

  // get info on the function
  retCode = TA_GetFuncInfo(handle, &theInfo);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::getFormatList:can't get function info");
    return;
  }

  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("TALIB Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  dialog->addTextItem(vnl, pl, s);

  // check for any array inputs
  const TA_InputParameterInfo *inputParms;
  int loop;
  for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
  {
    s = QObject::tr("Input") + QString::number(loop + 1);
    TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
    switch (inputParms->type)
    {
      case TA_Input_Real:
        dialog->addComboItem(s, pl, vl, (int) BarData::Close);
        break;
      default:
        break;
    }
  }

  QStringList mal;
  getMATypes(mal);
  mal.remove("Wilder");

  // get the input parms
  const TA_OptInputParameterInfo *optInfo;
  for (loop = 0; loop < (int) theInfo->nbOptInput; loop++ )
  {
    TA_GetOptInputParameterInfo(theInfo->handle, loop, &optInfo);
    s = optInfo->displayName;
    switch (optInfo->type)
    {
      case TA_OptInput_RealRange:
        dialog->addDoubleItem(s, pl, (double) optInfo->defaultValue, 0, 99999999);
        break;
      case TA_OptInput_IntegerRange:
        dialog->addIntItem(s, pl, (int) optInfo->defaultValue, 1, 999999);
        break;
      case TA_OptInput_IntegerList:
        dialog->addComboItem(s, pl, mal, (int) optInfo->defaultValue);
        break;
      case TA_OptInput_RealList:
        break;
      default:
        break;
    }
  }

  if (theInfo->nbOutput > 1)
  {
    s = "Plot";
    dialog->addIntItem(s, pl, 1, 1, theInfo->nbOutput);
  }

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);
    rs = formatMethod;

    QString ts;
    for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
    {
      s = QObject::tr("Input") + QString::number(loop + 1);
      TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
      switch (inputParms->type)
      {
        case TA_Input_Real:
//.........这里部分代码省略.........
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:101,代码来源:TALIB.cpp

示例11: indicatorPrefDialog

int TALIB::indicatorPrefDialog (QWidget *w)
{
  const TA_FuncHandle *handle;
  const TA_FuncInfo *theInfo;
 
  // open a TALIB handle
  QString ts = "method";
  QString ts2;
  parms.getData(ts, ts2);
  TA_RetCode retCode = TA_GetFuncHandle(ts2, &handle);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::indicatorPrefDialog:can't open handle");
    return FALSE;
  }

  // get info on the function
  retCode = TA_GetFuncInfo(handle, &theInfo);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::indicatorPrefDialog:can't get function info");
    return FALSE;
  }

  QString pl = QObject::tr("Parms");
  PrefDialog *dialog = new PrefDialog(w);
  dialog->setCaption(QObject::tr("TALIB Indicator"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QStringList mal;
  getMATypes(mal);
  mal.remove("Wilder");

  // get the input parms
  const TA_OptInputParameterInfo *optInfo;
  int loop;
  for (loop = 0; loop < (int) theInfo->nbOptInput; loop++ )
  {
    TA_GetOptInputParameterInfo(theInfo->handle, loop, &optInfo);
    QString s = optInfo->displayName;
    switch (optInfo->type)
    {
      case TA_OptInput_RealRange:
        parms.getData(s, ts);
        if (! ts.length())
        {
          dialog->addDoubleItem(s, pl, (double) optInfo->defaultValue, 0, 99999999);
          ts = QString::number((double) optInfo->defaultValue);
          parms.setData(s, ts);
        }
        else
          dialog->addDoubleItem(s, pl, parms.getDouble(s), 0, 99999999);
        break;
      case TA_OptInput_IntegerRange:
        parms.getData(s, ts);
        if (! ts.length())
        {
          dialog->addIntItem(s, pl, (int) optInfo->defaultValue, 1, 999999);
          ts = QString::number((int) optInfo->defaultValue);
          parms.setData(s, ts);
        }
        else
          dialog->addIntItem(s, pl, parms.getInt(s), 1, 999999);
        break;
      case TA_OptInput_IntegerList:
        parms.getData(s, ts);
        if (! ts.length())
        {
          dialog->addComboItem(s, pl, mal, (int) optInfo->defaultValue);
          ts = QString::number((int) optInfo->defaultValue);
          parms.setData(s, ts);
        }
        else
          dialog->addComboItem(s, pl, mal, parms.getInt(s));
        break;
      case TA_OptInput_RealList:
        break;
      default:
        break;
    }
  }

  // check for any array inputs
  const TA_InputParameterInfo *inputParms;
  for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
  {
    QString s = QObject::tr("input") + QString::number(loop + 1);
    TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
    switch (inputParms->type)
    {
      case TA_Input_Real:
        parms.getData(s, ts);
        if (! ts.length())
        {
          dialog->addComboItem(s, pl, inputTypeList, (int) BarData::Close);
          ts = QString::number(BarData::Close);
          parms.setData(s, ts);
        }
        else
//.........这里部分代码省略.........
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:101,代码来源:TALIB.cpp

示例12: indicatorPrefDialog

int THERM::indicatorPrefDialog (QWidget *w)
{
  QString pl = QObject::tr("THERM Parms");
  QString pl2 = QObject::tr("MA Parms");
  QString cal = QObject::tr("Color Above MA");
  QString cbl = QObject::tr("Color Below MA");
  QString ctl = QObject::tr("Color Threshold");
  QString ll = QObject::tr("Label");
  QString tl = QObject::tr("Threshold");
  QString sl = QObject::tr("Smoothing");
  QString stl = QObject::tr("Smoothing Type");
  QString mcl = QObject::tr("MA Color");
  QString mltl = QObject::tr("MA Line Type");
  QString mll = QObject::tr("MA Label");
  QString mpl = QObject::tr("MA Period");
  QString mtl = QObject::tr("MA Type");

  PrefDialog *dialog = new PrefDialog(w);
  dialog->setCaption(QObject::tr("THERM Indicator"));
  dialog->setHelpFile(helpFile);

  dialog->createPage (pl);
  dialog->addColorItem(cal, pl, upColor);
  dialog->addColorItem(cbl, pl, downColor);
  dialog->addColorItem(ctl, pl, threshColor);
  dialog->addTextItem(ll, pl, label);
  dialog->addDoubleItem(tl, pl, threshold, 1, 99999999);
  dialog->addIntItem(sl, pl, smoothing, 0, 99999999);
  QStringList l;
  getMATypes(l);
  dialog->addComboItem(stl, pl, l, smoothType);
  
  dialog->createPage (pl2);
  dialog->addColorItem(mcl, pl2, maColor);
  dialog->addComboItem(mltl, pl2, lineTypes, maLineType);
  dialog->addTextItem(mll, pl2, maLabel);
  dialog->addIntItem(mpl, pl2, maPeriod, 0, 99999999);
  dialog->addComboItem(mtl, pl2, l, maType);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cal, upColor);
    dialog->getColor(cbl, downColor);
    dialog->getColor(ctl, threshColor);
    dialog->getText(ll, label);
    threshold = dialog->getDouble(tl);
    smoothing = dialog->getInt(sl);
    smoothType = dialog->getComboIndex(stl);
    
    dialog->getColor(mcl, maColor);
    maLineType = (PlotLine::LineType) dialog->getComboIndex(mltl);
    dialog->getText(mll, maLabel);
    maPeriod = dialog->getInt(mpl);
    maType = dialog->getComboIndex(mtl);
    rc = TRUE;
  }
  else
    rc = FALSE;
  
  delete dialog;
  return rc;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:64,代码来源:THERM.cpp


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