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

C++ setBalance函数代码示例

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

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



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

示例1: tr

void SendCoinsDialog::setModel(WalletModel *model)
{
    this->model = model;

    for(int i = 0; i < ui->entries->count(); ++i)
    {
        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
		        CBitcoinAddress address = entry->getValue().address.toStdString(); 
				if(!model->isMine(address) && ui->splitBlockCheckBox->checkState() == Qt::Checked) 
		{
					model->setSplitBlock(false); //don't allow the blocks to split if sending to an outside address
			ui->splitBlockCheckBox->setCheckState(Qt::Unchecked); 
			QMessageBox::warning(this, tr("Send Coins"), 
				tr("The split block tool does not work when sending to outside addresses. Try again."), 
				QMessageBox::Ok, QMessageBox::Ok); 
			return; 
		}		
        if(entry)
        {
            entry->setModel(model);
        }
    }
    if(model && model->getOptionsModel())
    {
        setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64)));
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));

        // Coin Control
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));
        connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));
        connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(qint64)), this, SLOT(coinControlUpdateLabels()));
        ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures());
        coinControlUpdateLabels();
    }
开发者ID:BlockPioneers,项目名称:1337,代码行数:35,代码来源:sendcoinsdialog.cpp


示例2: setBalance

void SendCoinsDialog::setModel(WalletModel *model)
{
    this->model = model;

    for(int i = 0; i < ui->entries->count(); ++i)
    {
        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
        if(entry)
        {
            entry->setModel(model);
        }
    }
    if(model && model->getOptionsModel())
    {
        setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64)));
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));

        // Coin Control
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));
        connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));
        connect(model->getOptionsModel(), SIGNAL(transactionFeeChanged(qint64)), this, SLOT(coinControlUpdateLabels()));
        ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures());
        coinControlUpdateLabels();
    }
开发者ID:PosCoinDev,项目名称:PosCoin-master,代码行数:25,代码来源:sendcoinsdialog.cpp


示例3: setBalance

void SendCoinsDialog::updateDisplayUnit()
{
    setBalance(model->getBalance(), 0, 0, 0, 0, 0);
    ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
    updateMinFeeLabel();
    updateSmartFeeLabel();
}
开发者ID:josephbisch,项目名称:namecoin-core-1,代码行数:7,代码来源:sendcoinsdialog.cpp


示例4: setBalance

Credit::Credit(float balance, float interest, string pin, bool paid)
{
    setBalance(balance);
    setInterest(interest);
    setPin(pin);
    paid_=paid;
}
开发者ID:hdamon001,项目名称:CSCI-21-SPRING-2016,代码行数:7,代码来源:credit.cpp


示例5: getCellMinV

void Balancer::startBalacing()
{
    //test if battery has recovered after last balancing
    if(!isStable(balancerStartStableCount) || !AnalogInputs::isOutStable())
        return;

    if(minCell < 0) {
        minCell = getCellMinV();
    }
    AnalogInputs::ValueType vmin = getV(minCell);

    //test if we can still discharge
    bool off = true;
    AnalogInputs::ValueType VdisMin =  ProgramData::currentProgramData.getVoltagePerCell(ProgramData::VDischarge);
    for(int i = 0; i < cells; i++) {
        //save voltage values
        AnalogInputs::ValueType v = getV(i);
        if(v < VdisMin) {
            off = true;
            break;
        }
        if(v > vmin) {
            off = false;
        }
        Von_[i] = Voff_[i] = v;
    }

    savedVon = false;
    startBalanceTimeSecondsU16_ = Time::getSecondsU16();
    if(off) {
        endBalancing();
    } else {
        setBalance(calculateBalance());
    }
}
开发者ID:Djok39,项目名称:cheali-charger,代码行数:35,代码来源:Balancer.cpp


示例6: setBalance

void SendCoinsDialog::setModel(WalletModel *_model)
{
    this->model = _model;

    if(_model && _model->getOptionsModel())
    {
        for(int i = 0; i < ui->entries->count(); ++i)
        {
            SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
            if(entry)
            {
                entry->setModel(_model);
            }
        }

        interfaces::WalletBalances balances = _model->wallet().getBalances();
        setBalance(balances);
        connect(_model, &WalletModel::balanceChanged, this, &SendCoinsDialog::setBalance);
        connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::updateDisplayUnit);
        updateDisplayUnit();

        // Coin Control
        connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
        connect(_model->getOptionsModel(), &OptionsModel::coinControlFeaturesChanged, this, &SendCoinsDialog::coinControlFeatureChanged);
        ui->frameCoinControl->setVisible(_model->getOptionsModel()->getCoinControlFeatures());
        coinControlUpdateLabels();

        // fee section
        for (const int n : confTargets) {
            ui->confTargetSelector->addItem(tr("%1 (%2 blocks)").arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)).arg(n));
        }
        connect(ui->confTargetSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::updateSmartFeeLabel);
        connect(ui->confTargetSelector, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &SendCoinsDialog::coinControlUpdateLabels);
        connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls);
        connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels);
        connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
        connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, &SendCoinsDialog::setMinimumFee);
        connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateFeeSectionControls);
        connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
        ui->customFee->setSingleStep(model->wallet().getRequiredFee(1000));
        updateFeeSectionControls();
        updateMinFeeLabel();
        updateSmartFeeLabel();

        // set the smartfee-sliders default value (wallets default conf.target or last stored value)
        QSettings settings;
        if (settings.value("nSmartFeeSliderPosition").toInt() != 0) {
            // migrate nSmartFeeSliderPosition to nConfTarget
            // nConfTarget is available since 0.15 (replaced nSmartFeeSliderPosition)
            int nConfirmTarget = 25 - settings.value("nSmartFeeSliderPosition").toInt(); // 25 == old slider range
            settings.setValue("nConfTarget", nConfirmTarget);
            settings.remove("nSmartFeeSliderPosition");
        }
        if (settings.value("nConfTarget").toInt() == 0)
            ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(model->wallet().getConfirmTarget()));
        else
            ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(settings.value("nConfTarget").toInt()));
    }
}
开发者ID:FeatherCoin,项目名称:Feathercoin,代码行数:59,代码来源:sendcoinsdialog.cpp


示例7: setBalance

void OverviewPage::displayUnitChanged()
{
    if(currentBalance != -1)
        setBalance(currentBalance, currentUnconfirmedBalance);

    txdelegate->unit = model->getOptionsModel()->getDisplayUnit();
    ui->listTransactions->update();
}
开发者ID:flower1024,项目名称:bitcoin-qt,代码行数:8,代码来源:overviewpage.cpp


示例8: setBalance

void LLStatusBar::setUPC(S32 upc)
{
	mTextUPC->setText("UPC " + LLResMgr::getInstance()->getMonetaryString(upc));

	mUPC = upc;

	setBalance(mBalance);
}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:8,代码来源:llstatusbar.cpp


示例9: setCardNumber

void IQLoyaltyCard::reset()
{
    setCardNumber("");
    setCardSecret("");
    setCustomerShortName("");
    setCardUsageId(-1);
    setBalance(0);
    setPointsBalance(0);
}
开发者ID:0x6368656174,项目名称:iqEcKiosk,代码行数:9,代码来源:iqloyaltycard.cpp


示例10: setBalance

void SendCoinsDialog::setModel(WalletModel *model)
{
    this->model = model;

    for(int i = 0; i < ui->entries->count(); ++i)
    {
        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
        if(entry)
        {
            entry->setModel(model);
        }
    }
    if(model && model->getOptionsModel())
    {
        setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64)));
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
    }
开发者ID:Gnos1s,项目名称:anoncoin,代码行数:18,代码来源:sendcoinsdialog.cpp


示例11: setBalance

void SendCoinsDialog::updateDisplayUnit()
{
    setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(), model->getAnonymizedBalance(),
                   model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance());
    CoinControlDialog::coinControl->fUsePrivateSend = ui->checkUsePrivateSend->isChecked();
    coinControlUpdateLabels();
    ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
    updateMinFeeLabel();
    updateSmartFeeLabel();
}
开发者ID:Dash3,项目名称:dash,代码行数:10,代码来源:sendcoinsdialog.cpp


示例12: setBalance

void SendCoinsDialog::setModel(WalletModel *model)
{
  this->model = model;

  for(int i = 0; i < ui->entries->count(); ++i)
  {
    SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
    if(entry)
    {
      entry->setModel(model);
    }
  }
  if(model)
  {
    setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance());
    connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, BurnCoinsBalances)), 
            this, SLOT(setBalance(qint64, qint64, qint64)));
  }
}
开发者ID:lin0sspice,项目名称:Slimcoin-slimcoin,代码行数:19,代码来源:sendcoinsdialog.cpp


示例13: setResampler

DSP::DSP() {
  setResampler(ResampleEngine::Hermite);
  setResamplerFrequency(44100.0);

  setChannels(2);
  setPrecision(16);
  setFrequency(44100.0);
  setVolume(1.0);
  setBalance(0.0);

  clear();
}
开发者ID:Brunnis,项目名称:bsnes-mercury,代码行数:12,代码来源:core.hpp


示例14: setBalance

void SendCoinsDialog::setModel(WalletModel *model)
{
    this->model = model;

    if(model && model->getOptionsModel())
    {
        for(int i = 0; i < ui->entries->count(); ++i)
        {
            SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());
            if(entry)
            {
                entry->setModel(model);
            }
        }

        setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(),
                   model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance());
        connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)));
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
        updateDisplayUnit();

        // Coin Control
        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));
        connect(model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));
        ui->frameCoinControl->setVisible(model->getOptionsModel()->getCoinControlFeatures());
        coinControlUpdateLabels();

        // fee section
        connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel()));
        connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables()));
        connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels()));
        connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateFeeSectionControls()));
        connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables()));
        connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels()));
        connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(updateGlobalFeeVariables()));
        connect(ui->groupCustomFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels()));
        connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(updateGlobalFeeVariables()));
        connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(coinControlUpdateLabels()));
        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables()));
        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
        // LemonCoin: Disable free transactions
        // connect(ui->checkBoxFreeTx, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables()));
        // connect(ui->checkBoxFreeTx, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
        ui->customFee->setSingleStep(CWallet::minTxFee.GetFeePerK());
        updateFeeSectionControls();
        updateMinFeeLabel();
        updateSmartFeeLabel();
        updateGlobalFeeVariables();
    }
}
开发者ID:fflo,项目名称:lemoncoin,代码行数:52,代码来源:sendcoinsdialog.cpp


示例15: setBalance

void QPageIncomeExpense::setModel(WalletModel *model)
{
    this->model = model;

    if (model && model->getOptionsModel())
    {
        // Keep up to date with wallet
        setBalance(model->getBalance(), model->getStake(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64)));

        setNumTransactions(model->getNumTransactions());
        connect(model, SIGNAL(numTransactionsChanged(int)), this, SLOT(setNumTransactions(int)));
    }
开发者ID:StealthSend,项目名称:Stealth,代码行数:13,代码来源:qpageincomeexpense.cpp


示例16: TransactionFilterProxy

void OverviewPage::setWalletModel(WalletModel *model)
{
    this->walletModel = model;
    if(model && model->getOptionsModel())
    {
        // Set up transaction list
        filter = new TransactionFilterProxy();
        filter->setSourceModel(model->getTransactionTableModel());
        filter->setLimit(NUM_ITEMS);
        filter->setDynamicSortFilter(true);
        filter->setSortRole(Qt::EditRole);
        filter->sort(TransactionTableModel::Status, Qt::DescendingOrder);

        ui->listTransactions->setModel(filter);
        ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress);

        // Keep up to date with wallet
        setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance());
        connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64)));

        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
    }
开发者ID:ClaireDuSoleil,项目名称:Legocoin,代码行数:22,代码来源:overviewpage.cpp


示例17: setBalance

void TransactionView::updateDisplayUnit()
{
    if(walletModel && walletModel->getOptionsModel())
    {
        if(currentBalance != -1)
            setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance);

        // Update txdelegate->unit with the current unit
        //txdelegate->unit = walletModel->getOptionsModel()->getDisplayUnit();

        //ui->listTransactions->update();
    }
}
开发者ID:zebbra2014,项目名称:bitcredit,代码行数:13,代码来源:transactionview.cpp


示例18: getV

void Balancer::powerOn()
{
    hardware::setBalancerOutput(true);

    for(uint8_t i = 0; i < MAX_BALANCE_CELLS; i++) {
        AnalogInputs::ValueType vi = getV(i);
        Voff_[i] = Von_[i] = vi;
    }
    balance = 0;
    done = false;
    setBalance(0);
    balancingEnded = 0;
    resetMinCell();
}
开发者ID:sparcisgone,项目名称:cheali-charger,代码行数:14,代码来源:Balancer.cpp


示例19: startBalacing

Strategy::statusType Balancer::doStrategy()
{
    if(balance == 0) {
            startBalacing();
    } else {
        trySaveVon();
        if(getBalanceTime() > maxBalanceTime) {
            setBalance(0);
        }
    }
    if((!isWorking()) && done)
        return Strategy::COMPLETE;
    return Strategy::RUNNING;
}
开发者ID:Djok39,项目名称:cheali-charger,代码行数:14,代码来源:Balancer.cpp


示例20: setActive

Pad::Pad(const QDomElement & dom_elem) {
    if( dom_elem.attribute("active") == "1" ) 
        setActive(1);
    else
        setActive(0);

    if ( ! dom_elem.attribute("volume").isNull()) {
        setVolume(dom_elem.attribute("volume").toInt());
    }

    if ( ! dom_elem.attribute("balance").isNull()) {
        setBalance(dom_elem.attribute("balance").toInt());
    }
}
开发者ID:amarandon,项目名称:slag,代码行数:14,代码来源:Pad.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ setBaudRate函数代码示例发布时间:2022-05-30
下一篇:
C++ setBackgroundVisible函数代码示例发布时间: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