您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateValue函数代码示例

51自学网 2021-06-03 09:14:55
  C++
这篇教程C++ updateValue函数代码示例写得很实用,希望能帮到您。

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

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

示例1: updateValue

void CloseColorDots::cycleThroughColors(){	colorIndex = updateValue(colorIndex, up, 0, maxColorIndex, cycles);		for (int n=0;n<countFoos();n++)	{		int tmpIndex = updateValueBy(colorIndex, up, n, 0, maxColorIndex, cycles);				foos.entry(n)->me->fLEDs.entry(0)->me->color.calculateRGB(maxColorIndex, tmpIndex);	}}
开发者ID:ryantuck,项目名称:lit-halo,代码行数:11,


示例2: getchar

/*long int next_int(){        long int n = 0;        char c = getchar();        while (!('0' <= c && c <= '9'))        {                c = getchar();        }        while ('0' <= c && c <= '9')        {                n = (n<<3)+(n<<1) + c - '0';                c = getchar();        }        return n;}*/int main(){ ios_base::sync_with_stdio(false);	char c[100005];    int arr[100005],count,i,s,j;	long int n,q;cin>>n>>q;	//n=next_int();    //q=next_int();	cin>>c;for(i=0;i<n;i++){	arr[i]=(c[i]-'0');}		 int *st = constructST(arr, n);	while(q--)	{		long int a,b,d;	//	a=next_int();      //  b=next_int();      //  d=next_int();	cin>>a>>b>>d;		if(a==1)		{			    updateValue(arr, st, n, b-1, d);	}		else		{		count=0;			for(i=b-1;i<d;i++)		{		for(j=i;j<d;j++)			{		s=getSum(st, n, i, j);if(s%3==0)count++;         }		}		cout<<count<<"/n";		}	}	return 0;}
开发者ID:2012ankitkmr,项目名称:My-works,代码行数:71,


示例3: Button

AccountWindow::IntegerOption::IntegerOption(PurpleAccount *account_,    PurpleAccountOption *option_): Button(FLAG_VALUE), account(account_), option(option_){  g_assert(account);  g_assert(option);  setText(purple_account_option_get_text(option));  updateValue();  signal_activate.connect(sigc::mem_fun(this, &IntegerOption::onActivate));}
开发者ID:jonyamo,项目名称:centerim5,代码行数:11,


示例4: updateValue

voidAnimation::restart(){    forward = true;    updateValue(0.);    started = currentTimeMillis();    if (timer == NULL) {        timer = new Timer(10, Animation_TimerCallback, (void*)this);    }}
开发者ID:mardy,项目名称:trg2,代码行数:11,


示例5: update

 void update(float t) {             hasStarted = (t >= startTime);     hasEnded = (t >= endTime);          if(isAlive) updateValue(t);          if(hasEnded) isAlive = false;      };
开发者ID:RecoilPerformanceGroup,项目名称:Stereo2016,代码行数:11,


示例6: updateValue

void MovingFoo::move(bool direction){	if (hasLEDs())	{		for (int n=0;n<countLEDs();n++)		{			byte addr = fLEDs.entry(n)->me->address;			addr = updateValue(addr, direction, 0, 31, cycles);			fLEDs.entry(n)->me->address = addr;		}	}}
开发者ID:ryantuck,项目名称:lit-halo,代码行数:12,


示例7: setText

void AccountWindow::StringOption::initialize(){  if (type == TYPE_PASSWORD)    setText(_("Password"));  else if (type == TYPE_ALIAS)    setText(_("Alias"));  else    setText(purple_account_option_get_text(option));  updateValue();  signal_activate.connect(sigc::mem_fun(this, &StringOption::onActivate));}
开发者ID:jonyamo,项目名称:centerim5,代码行数:12,


示例8: getState

bool Slider::touchEvent(Touch::TouchEvent evt, int x, int y, unsigned int contactIndex){    State state = getState();    switch (evt)    {    case Touch::TOUCH_PRESS:        updateValue(x, y);        return true;    case Touch::TOUCH_MOVE:        if (state == ACTIVE)        {            updateValue(x, y);            return true;        }        break;    }    return Control::touchEvent(evt, x, y, contactIndex);}
开发者ID:03050903,项目名称:GamePlay,代码行数:21,


示例9: qDebug

// Textual value change notification.void qtractorTimeSpinBox::valueChangedSlot ( const QString& sText ){#ifdef CONFIG_DEBUG_0	qDebug("qtractorTimeSpinBox[%p]::valueChangedSlot(/"%s/")",		this, sText.toUtf8().constData());#endif	// Kind of interim fixup.	if (updateValue(valueFromText(sText), false)) {		// Just forward this one...		emit valueChanged(sText);	}}
开发者ID:davidpucheta,项目名称:qtractor,代码行数:14,


示例10: KListViewItem

//BEGIN Class PropertyEditorItemPropertyEditorItem::PropertyEditorItem( PropertyEditorItem * par, Property * property )	: KListViewItem( par, property->editorCaption(), property->displayString() ){	setExpandable( false );	m_property=property;	connect( m_property, SIGNAL(valueChanged( QVariant, QVariant )), this, SLOT(propertyValueChanged()) );	updateValue();	//3 rows per item is enough?	setMultiLinesEnabled( true );	setHeight(static_cast<PropertyEditor*>(listView())->baseRowHeight()*3);}
开发者ID:Munrek,项目名称:ktechlab,代码行数:14,


示例11: Color

void BatteryFoo::grow(){	// set the color of each subsequent LED as some range from red to green	// this is a bit of a hack, but it works and looks cool.	// calculateRGB is the same function used to create a rainbow line of	//	arbitrary length.	Color tmpColor = Color(LITColor.black);	tmpColor.calculateRGB(96, valueCounter);		addLEDs(tmpColor, maxBrightness, valueCounter, valueCounter);		valueCounter = updateValue(valueCounter, up, 0, value, !cycles);}
开发者ID:ryantuck,项目名称:lit-halo,代码行数:13,


示例12: super_t

	ParamValue<const LLFontGL*>::ParamValue(const LLFontGL* fontp)	:	super_t(fontp),		name("name"),		size("size"),		style("style")	{		if (!fontp)		{			updateValue(LLFontGL::getFontDefault());		}		addSynonym(name, "");		updateBlockFromValue(false);	}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:13,


示例13: fast_log10

	void FloatEntry::setValue(double val)	{		if (_log)		{			if (val == 0.0f)				_value = _minValue;			else				_value = fast_log10(val) * 20.0f;		}		else			_value = val;		updateValue();	}
开发者ID:87maxi,项目名称:oom,代码行数:13,


示例14: updateValue

	void ParamValue<const LLFontGL*>::updateValueFromBlock()	{		const LLFontGL* res_fontp = LLFontGL::getFontByName(name);		if (res_fontp)		{			updateValue(res_fontp);			return;		}		U8 fontstyle = 0;		fontstyle = LLFontGL::getStyleFromString(style());		LLFontDescriptor desc(name(), size(), fontstyle);		const LLFontGL* fontp = LLFontGL::getFont(desc);		if (fontp)		{			updateValue(fontp);		}		else		{			updateValue(LLFontGL::getFontDefault());		}	}
开发者ID:ArxNet,项目名称:SingularityViewer,代码行数:22,


示例15: GConfItem

void GConfItemQmlProxy::setKey(const QString &newKey){#ifndef QT_SIMULATOR   if (_gconfItem) {       delete _gconfItem;   }   _gconfItem = new GConfItem(newKey);#endif   _key = newKey;#ifndef QT_SIMULATOR   connect(_gconfItem, SIGNAL(valueChanged()), this, SLOT(updateValue()));#endif}
开发者ID:anandbibek,项目名称:clipbook-meego,代码行数:14,


示例16: print

static void print(void){	stopLcdScroll(0);	clearLcdLine(0);	strcpy_P(buffer, (char *) pgm_read_word(&(strings[OPTION_1 + selectedOption])));	if (stringsSizes[OPTION_1 + selectedOption] > 16)		newLcdScroll(buffer, 0, 200);	else		printLcd(8 - stringsSizes[OPTION_1 + selectedOption], 0, buffer);	updateValue();}
开发者ID:GilDev,项目名称:IntelliCasier,代码行数:14,


示例17: updateValue

void TCPJwL::listen(){	if (audio.beats.detected())	{		baseCycler = updateValue(baseCycler, up, 0, 2, cycles);				TwoColorParticleJam* x = (TwoColorParticleJam*)foos.entry(0)->me;				int a1 = baseCycler;		int a2 = baseCycler+3;				x->changeColors(*LITColor.colorList[a1],*LITColor.colorList[a2]);	}}
开发者ID:ryantuck,项目名称:lit-halo,代码行数:14,


示例18: dataSize

MemoryTablePrivate::Error MemoryTablePrivate::insert(const key_type &key, const value_type &value, TableMetadata *table){    const quint32 valueSize = dataSize(value);    IndexElement *tableEnd = end(table);    IndexElement *position = std::lower_bound(begin(table), tableEnd, key);    if (position != tableEnd && position->key == key) {        // This is a replacement - the item has an allocation already        Allocation *allocation = allocationAt(position->offset, table);        if (allocation->size < requiredSpace(valueSize)) {            // Replace the existing allocation with a bigger one            quint32 newOffset = allocate(valueSize, table, false);            if (!newOffset)                return MemoryTable::InsufficientSpace;            deallocate(position->offset, table);            position->offset = newOffset;        } else {            // Reuse this allocation            // TODO: swap with a better fit from the free list?        }    } else {        // This item needs to be added to the index        if (table->count == std::numeric_limits<quint32>::max())            return MemoryTable::InsufficientSpace;        quint32 offset = allocate(valueSize, table, true);        if (!offset)            return MemoryTable::InsufficientSpace;        // For index insertion, move the displaced elements of the index        if (position != tableEnd)            std::memmove(position + 1, position, (tableEnd - position) * sizeof(IndexElement));        ++(table->count);        position->key = key;        position->offset = offset;    }    Q_ASSERT(contains(key, table));    // Ensure that the data allocation does not overlap the index space    Q_ASSERT((reinterpret_cast<char *>(table) + table->freeOffset) >= reinterpret_cast<char *>(end(table)));    // Update the value stored at the position    updateValue(value, valueSize, position->offset, table);    return MemoryTable::NoError;}
开发者ID:amtep,项目名称:qtcontacts-sqlite,代码行数:49,


示例19: millis

void ScrollBar::update(uint16_t x1, uint16_t y1, uint16_t z) {	bool press = false;	if (z > MINPRESSURE && z < MAXPRESSURE) press = true;	if (press) {		if (x < x1 && x1 < (x + size) && y < y1 && y1 < (y + size)) {			pressedL = true;			lastpressed = millis();			updateValue();		}		uint16_t v = width + pageW + size + x;		if (( v ) < x1 && x1 < (v+size)  && y < y1 && y1 < (y + size)) 		{			pressedR = true;			lastpressed = millis();			updateValue();		}	}	if (millis() - lastpressed > 200) {		pressedR = false;		pressedL = false;	}	if (pressedR != opressedR || pressedL != opressedL ) { 	// some buttons state changed												reDrawButtons();		opressedR = pressedR;		opressedL = pressedL;			//if (handler != 0) handler->callBack1(pressed, ID);		return;	}	//if (pressed && handler != 0)  handler->callBack2(pressed, ID);     // continouse pressing }
开发者ID:Nand-e,项目名称:STM32-Watering,代码行数:36,


示例20: currentTimeMillis

voidAnimation::rewind(){    forward = false;    if (timer != NULL) {        int elapsed = currentTimeMillis() - started;        int remaining = duration - elapsed;        started = currentTimeMillis() - remaining;    } else {        updateValue(1.);        started = currentTimeMillis();        timer = new Timer(10, Animation_TimerCallback, (void*)this);    }}
开发者ID:mardy,项目名称:trg2,代码行数:15,


示例21: switch

int RoundRectItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a){    _id = QObject::qt_metacall(_c, _id, _a);    if (_id < 0)        return _id;    if (_c == QMetaObject::InvokeMetaMethod) {        switch (_id) {        case 0: activated(); break;        case 1: updateValue((*reinterpret_cast< qreal(*)>(_a[1]))); break;        default: ;        }        _id -= 2;    }    return _id;}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:15,


示例22: connect

void Dial::setupUi(){	QDial::setCursor(Qt::PointingHandCursor);	connect(this, &QDial::valueChanged,			this, &Dial::updateValue);	setMinimumSize(100,100);	setMaximumAngle(-360);	setStartAngle(270);	updateValue();}
开发者ID:eriser,项目名称:Anthem,代码行数:15,


示例23: updateValue

	void FloatEntry::setSValue(const QString& s)	{		bool ok;		double v = s.toFloat(&ok);		if (ok && (v != _value))		{			if (v < _minValue)				v = _minValue;			if (v > _maxValue)				v = _maxValue;			_value = v;			updateValue();			valueChange();		}	}
开发者ID:87maxi,项目名称:oom,代码行数:15,


示例24: QLineEdit

	FloatEntry::FloatEntry(QWidget* parent)	: QLineEdit(parent)	{		_id = 0;		_minValue = 0.0;		_maxValue = 1.0;		_log = false;		evx = 1.0;		_precision = 3;		timer = new QTimer(this);		connect(timer, SIGNAL(timeout()), SLOT(repeat()));		_value = 0.0f;		connect(this, SIGNAL(returnPressed()), SLOT(endEdit()));		setCursor(QCursor(Qt::ArrowCursor));		updateValue();	}
开发者ID:87maxi,项目名称:oom,代码行数:16,


示例25: updateValue

/*! * /brief Focus out event handler. * * This updates the geometry of parameter group, validates * the text and also clears the selection. */void PropertyItem::focusOutEvent(QFocusEvent *event){    if(m_edited) {        updateValue();    }    qApp->removeEventFilter(this);    // Clear the text selection    QTextCursor c = textCursor();    c.clearSelection();    setTextCursor(c);    disconnect(document(), SIGNAL(contentsChanged()), this,            SLOT(textChanged()));    QGraphicsTextItem::focusOutEvent(event);}
开发者ID:damiansimanuk,项目名称:qucs-qt4,代码行数:23,


示例26: updateValue

void GuiInspectorDynamicField::setData( const char* data, bool callbacks ){   if ( mDynField == NULL )      return;      const U32 numTargets = mInspector->getNumInspectObjects();   if( callbacks && numTargets > 1 )   { mInspector->beginCompoundUndo_callback(); }         // Setting an empty string will kill the field.   const bool isRemoval = !data[ 0 ];         for( U32 i = 0; i < numTargets; ++ i )   {      SimObject* target = mInspector->getInspectObject( i );      // Callback on the inspector when the field is modified      // to allow creation of undo/redo actions.      const char *oldData = target->getDataField( mDynField->slotName, NULL );      if ( !oldData )         oldData = "";      if ( dStrcmp( oldData, data ) != 0 )      {         target->inspectPreApply();                  if( callbacks )         {            if( isRemoval )            { mInspector->onFieldRemoved_callback( target->getIdString(), mDynField->slotName ); }            else            { mInspector->onInspectorFieldModified_callback( target->getIdString(), mDynField->slotName,"(null)", oldData, data ); }         }         target->setDataField( mDynField->slotName, NULL, data );         // give the target a chance to validate         target->inspectPostApply();      }   }      if( callbacks && numTargets > 1 )   { mInspector->endCompoundUndo_callback(); }   // Force our edit to update   updateValue();}
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:46,


示例27: assert

void ShortIntValueFieldWidget::refreshImpl(){    assert(m_ui.m_serValueLineEdit != nullptr);    updateValue(*m_ui.m_serValueLineEdit, m_wrapper->getSerialisedString());    auto value = adjustRealToDisplayed(m_wrapper->getValue());    assert(m_ui.m_valueSpinBox);    if (m_ui.m_valueSpinBox->value() != value) {        m_ui.m_valueSpinBox->setValue(value);    }    bool valid = m_wrapper->valid();    setValidityStyleSheet(*m_ui.m_nameLabel, valid);    setValidityStyleSheet(*m_ui.m_serFrontLabel, valid);    setValidityStyleSheet(*m_ui.m_serValueLineEdit, valid);    setValidityStyleSheet(*m_ui.m_serBackLabel, valid);}
开发者ID:bygreencn,项目名称:comms_champion,代码行数:17,



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


C++ updateVertices函数代码示例
C++ updateUi函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。