• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setPrecision函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setPrecision函数的典型用法代码示例。如果您正苦于以下问题:C++ setPrecision函数的具体用法?C++ setPrecision怎么用?C++ setPrecision使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: saveValuesFromUi

void PropertyTreeViewer::normalise(bool _toggled)
{
    m_treePropertyWidget->setEditable(!_toggled);

    if(_toggled)
    {
        saveValuesFromUi();
        TreeRightSideValues* oldVals = m_loader->createRightSide(m_leftSideTreeId,
                                       "tmp", true);

        if(isServiceTab(m_currentTab))
            oldVals = m_treePropertyWidget->updateRightSideFromUi(oldVals);
        else
            oldVals = m_values[m_currentTab];
        Q_ASSERT(oldVals);

        TreeRightSideValues* newVals = normalise(oldVals);
        m_treePropertyWidget->setValues(newVals);

        setPrecision(6);
    }
    else
    {
        if(m_ui->tabWidget->widget(m_currentTab) == m_ui->average)
            displayValuesForArithmeticalMean();
        else
            m_treePropertyWidget->setValues(m_values[m_currentTab]);

        setPrecision(2);
    }
}
开发者ID:AndreyMlashkin,项目名称:ExpertReview,代码行数:31,代码来源:propertytreeviewer.cpp


示例2: switch

int QProg::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 1: setValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 2: setMaxValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 3: setMinValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 4: setFontDim((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: setPrecision((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: setBarColor((*reinterpret_cast< QColor(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< double*>(_v) = value(); break;
        case 1: *reinterpret_cast< double*>(_v) = minValue(); break;
        case 2: *reinterpret_cast< double*>(_v) = maxValue(); break;
        case 3: *reinterpret_cast< int*>(_v) = font(); break;
        case 4: *reinterpret_cast< int*>(_v) = numPrec(); break;
        case 5: *reinterpret_cast< QColor*>(_v) = color(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setValue(*reinterpret_cast< double*>(_v)); break;
        case 1: setMinValue(*reinterpret_cast< double*>(_v)); break;
        case 2: setMaxValue(*reinterpret_cast< double*>(_v)); break;
        case 3: setFontDim(*reinterpret_cast< int*>(_v)); break;
        case 4: setPrecision(*reinterpret_cast< int*>(_v)); break;
        case 5: setBarColor(*reinterpret_cast< QColor*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
开发者ID:Linux-enCaja,项目名称:SIE,代码行数:57,代码来源:moc_qprog.cpp


示例3: ofSetWindowTitle

void GuiApp::setup(void)
{
    ofSetWindowTitle("Controls");

    gui = new ofxDatGui(ofxDatGuiAnchor::TOP_LEFT);

    auto theme = new GuiTheme();
    gui->setTheme(theme);

    gui->addHeader("boids");
    gui->getHeader()->setDraggable(false);

    gui->addFRM(0.1);
    auto fps_toggle = gui->addToggle("cap to 30 FPS");
    fps_toggle->toggleEventCallback = std::bind(&GuiApp::fpsCapToggleEvent, this, std::placeholders::_1);

    gui->addBreak();
    gui->addLabel("boid controls");
    for (const auto &type_boid_pair : Config::boids_by_type) {
        const auto &boid_type = type_boid_pair.first;
        const auto &boid_type_config = type_boid_pair.second;

        auto boid_type_folder = gui->addFolder(BoidMisc::typeToTypename(boid_type));

        auto amount_slider = boid_type_folder->addSlider("amount", 1, 1200);
        amount_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeAmountChanged, this, std::placeholders::_1, boid_type);
        amount_slider->setPrecision(0);
        amount_slider->setValue(boid_type_config.amount);

        auto infl_max_dist_slider = boid_type_folder->addSlider("infl max dist", 1, 120, boid_type_config.infl_max_dist);
        infl_max_dist_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeInflMaxDistChanged, this, std::placeholders::_1, boid_type);

        auto angle_of_view_slider = boid_type_folder->addSlider("angle of view", 10, 180, boid_type_config.angle_of_view);
        angle_of_view_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeAngleOfViewChanged, this, std::placeholders::_1, boid_type);

        auto max_speed_slider = boid_type_folder->addSlider("max speed", 0.5, 10, boid_type_config.max_speed);
        max_speed_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeMaxSpeedChanged, this, std::placeholders::_1, boid_type);

        auto color_picker = boid_type_folder->addColorPicker("color", boid_type_config.graphics.color);
        color_picker->colorPickerEventCallback = std::bind(&GuiApp::boidTypeColorChanged, this, std::placeholders::_1, boid_type);

        auto size_slider = boid_type_folder->addSlider("size", 1, 4);
        size_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeSizeChanged, this, std::placeholders::_1, boid_type);
        size_slider->setPrecision(0);
        size_slider->setValue(boid_type_config.graphics.size); // We need to set this after the precision so that the proper precision is applied

        auto draw_head_toggle = boid_type_folder->addToggle("draw head", boid_type_config.graphics.draw_head);
        draw_head_toggle->toggleEventCallback = std::bind(&GuiApp::boidTypeDrawHeadChanged, this, std::placeholders::_1, boid_type);
    }

    ofBackground(theme->color.guiBackground);

    ofSetFrameRate(60);
}
开发者ID:nventuro,项目名称:boids,代码行数:54,代码来源:GuiApp.cpp


示例4: IntensityFactor

 IntensityFactor() : rif(0.0), secs(0.0)
 {
     setSymbol("coggan_if");
     setName("IF");
     setType(RideMetric::Average);
     setPrecision(3);
 }
开发者ID:psychenaut,项目名称:GoldenCheetah,代码行数:7,代码来源:Coggan.cpp


示例5: initialize

 void initialize() {
     setName(tr("Aerobic Decoupling"));
     setType(RideMetric::Average);
     setMetricUnits(tr("%"));
     setImperialUnits(tr("%"));
     setPrecision(1);
 }
开发者ID:ClaFio,项目名称:GoldenCheetah,代码行数:7,代码来源:AerobicDecoupling.cpp


示例6: initialize

 void initialize() {
     setName("LNP");
     setType(RideMetric::Average);
     setMetricUnits("watts");
     setImperialUnits("watts");
     setPrecision(0);
 }
开发者ID:JanDeVisser,项目名称:GoldenCheetah,代码行数:7,代码来源:GOVSS.cpp


示例7: QTableWidget

caTable::caTable(QWidget *parent) : QTableWidget(parent)

{
    setPrecisionMode(Channel);
    setLimitsMode(Channel);
    setPrecision(0);
    setMinValue(0.0);
    setMaxValue(1.0);
    for(int i=0; i< MaxRows; i++) {
        setFormat(i, 1);
        for(int j=0; j< MaxCols; j++) tableItem[i][j] = (QTableWidgetItem*) 0;
    }

    thisItemFont = this->font();

    setColorMode(Static);
    setAlternatingRowColors(true);
    setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
    setEditTriggers(QTableWidget::NoEditTriggers);
    verticalHeader()->setDefaultSectionSize(20);
    horizontalHeader()->setResizeMode(QHeaderView::Stretch);

    defaultForeColor = palette().foreground().color();

    createActions();
    addAction(copyAct);

    connect(this, SIGNAL( cellDoubleClicked (int, int) ), this, SLOT(celldoubleclicked( int, int ) ) );
    //connect(this, SIGNAL( cellClicked (int, int) ), this, SLOT(cellclicked( int, int ) ) );
}
开发者ID:SLAC-Advanced-Control-Systems,项目名称:caqtdm,代码行数:30,代码来源:catable.cpp


示例8: PeakWPK

 PeakWPK() : wpk(0.0), secs(0.0), weight(0.0)
 {
     setType(RideMetric::Peak);
     setMetricUnits(tr("wpk"));
     setImperialUnits(tr("wpk"));
     setPrecision(1);
 }
开发者ID:g3rg,项目名称:GoldenCheetah,代码行数:7,代码来源:WattsPerKilogram.cpp


示例9: initialize

 void initialize() {
     setName(tr("Left/Right Balance"));
     setMetricUnits(tr("%"));
     setImperialUnits(tr("%"));
     setType(RideMetric::Average);
     setPrecision(1);
 }
开发者ID:Walibu,项目名称:GoldenCheetah,代码行数:7,代码来源:LeftRightBalance.cpp


示例10: switch

bool RealFormat::setValue(int idx, const Variant& val)
{
  bool result;
  int tmp;
  switch (idx)
  {
    case 0:
      result = setInt(tmp, val) && setMode((FmtMode)tmp);
      break;
    case 1:
      result = setInt(tmp, val) && setBase(tmp);
      break;
    case 2:
      result = setInt(tmp, val) && setSignificandBase(tmp);
      break;
    case 3:
      result = setInt(tmp, val) && setScaleBase(tmp);
      break;
    case 4:
      result = setInt(tmp, val) && setPrecision(tmp);
      break;
//      result = setChar(dot, val); break;
    default:
      result = false;
  }
  return result;
}
开发者ID:ruphy,项目名称:speedcrunch,代码行数:27,代码来源:formatreal.cpp


示例11: VI

 VI() : vi(0.0), secs(0.0)
 {
     setSymbol("coggam_variability_index");
     setName("VI");
     setType(RideMetric::Average);
     setPrecision(3);
 }
开发者ID:psychenaut,项目名称:GoldenCheetah,代码行数:7,代码来源:Coggan.cpp


示例12: initialize

 void initialize() {
     setName("NP");
     setType(RideMetric::Average);
     setMetricUnits("watts");
     setImperialUnits("watts");
     setPrecision(0);
     setDescription(tr("Normalized Power is an estimate of the power that you could have maintained for the same physiological 'cost' if your power output had been perfectly constant."));
 }
开发者ID:ChangSpivey,项目名称:GoldenCheetah,代码行数:8,代码来源:Coggan.cpp


示例13: ZoneTime

 ZoneTime() : level(0), seconds(0.0)
 {
     setType(RideMetric::Total);
     setMetricUnits("seconds");
     setImperialUnits("seconds");
     setPrecision(0);
     setConversion(1.0);
 }
开发者ID:FuzzyBunnys,项目名称:GoldenCheetah,代码行数:8,代码来源:TimeInZone.cpp


示例14: setChannels

//ported from bsnes
Resampler::Resampler()
{
    setChannels(2);
    setPrecision(16);
    setFrequency(44100.0, 44100.0);
    setVolume(1.0);
    clear();
}
开发者ID:ST3ALth,项目名称:TwoMbit-Core,代码行数:9,代码来源:resampler.cpp


示例15: initialize

 void initialize() {
     setName("LNP");
     setType(RideMetric::Average);
     setMetricUnits("watts");
     setImperialUnits("watts");
     setPrecision(0);
     setDescription(tr("Lactate Normalized Power as defined by Dr. Skiba in GOVSS algorithm"));
 }
开发者ID:CaptainOnly,项目名称:GoldenCheetah,代码行数:8,代码来源:GOVSS.cpp


示例16: mReTrailingZeroes

QgsRendererRangeV2LabelFormat::QgsRendererRangeV2LabelFormat( QString format, int precision, bool trimTrailingZeroes ):
    mReTrailingZeroes( "[.,]?0*$" ),
    mReNegativeZero( "^\\-0(?:[.,]0*)?$" )
{
  setFormat( format );
  setPrecision( precision );
  setTrimTrailingZeroes( trimTrailingZeroes );
}
开发者ID:Margaral,项目名称:QGIS,代码行数:8,代码来源:qgsgraduatedsymbolrendererv2.cpp


示例17: inFocus

void OSIntegerEdit2::onEditingFinished() {

  emit inFocus(true, hasData());

  QString text = this->text();
  if (text.isEmpty() || m_text == text) return;

  if (m_modelObject) {
    std::string str = this->text().toStdString();
    boost::regex autore("[aA][uU][tT][oO]");
    ModelObject modelObject = m_modelObject.get();

    if (str.empty()) {
      if (m_reset) {
        (*m_reset)();
      }
    }
    else if (boost::regex_search(str,autore)) {
      if (m_isAutosized) {
        if (m_autosize) {
          (*m_autosize)();
        }
        else if (m_reset) {
          (*m_reset)();
        }
      }
      if (m_isAutocalculated) {
        if (m_autocalculate) {
          (*m_autocalculate)();
        }
        else if (m_reset) {
          (*m_reset)();
        }
      }
    }
    else {
      try {
        int value = boost::lexical_cast<int>(str);
        setPrecision(str);
        if (m_set) {
          QString text = this->text();
          if (text.isEmpty() || m_text == text) return;
          bool result = (*m_set)(value);
          if (!result){
            //restore
            refreshTextAndLabel();
          }
        }
      }
      catch (...) 
      {
        // restore
        refreshTextAndLabel();
      }
    }
  }
}
开发者ID:jtanaa,项目名称:OpenStudio,代码行数:57,代码来源:OSIntegerEdit.cpp


示例18: NP

 NP() : np(0.0), secs(0.0)
 {
     setSymbol("coggan_np");
     setName("NP");
     setType(RideMetric::Average);
     setMetricUnits("watts");
     setImperialUnits("watts");
     setPrecision(0);
 }
开发者ID:psychenaut,项目名称:GoldenCheetah,代码行数:9,代码来源:Coggan.cpp


示例19: EfficiencyFactor

 EfficiencyFactor() : ef(0.0)
 {
     setSymbol("friel_efficiency_factor");
     setName(tr("Efficiency Factor"));
     setType(RideMetric::Average);
     setMetricUnits(tr(""));
     setImperialUnits(tr(""));
     setPrecision(3);
 }
开发者ID:psychenaut,项目名称:GoldenCheetah,代码行数:9,代码来源:Coggan.cpp


示例20: AerobicDecoupling

 AerobicDecoupling() : percent(0.0)
 {
     setSymbol("aerobic_decoupling");
     setName(tr("Aerobic Decoupling"));
     setType(RideMetric::Average);
     setMetricUnits(tr("%"));
     setImperialUnits(tr("%"));
     setPrecision(2);
 }
开发者ID:ebrandt,项目名称:GoldenCheetah,代码行数:9,代码来源:AerobicDecoupling.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setPreferredLogicalWidthsDirty函数代码示例发布时间:2022-05-30
下一篇:
C++ setPreData函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap