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


C++ setNumber函数代码示例

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


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

示例1: setNumber

void QPhoneCallDummy::dial( const QDialOptions& options )
{
    // Change to the "Dialing" state and notify everyone who is interested.
    setNumber( options.number() );
    setState( QPhoneCall::Dialing );

    // Start a timer to transition to the hangup state after 3 seconds.
    QTimer::singleShot( 3000, this, SLOT(dialTimeout()) );
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:9,代码来源:phoneserverdummymodem.cpp

示例2: Projection

EquidistantC::EquidistantC(double gctpParams[], ProjUnit units, ProjDatum dat): 
Projection(gctpParams, units, dat), m_e(0.0), m_es(0.0), 
m_e0(0.0), m_e1(0.0), m_e2(0.0), m_e3(0.0), m_ml0(0.0), m_ns(0.0),
m_g(0.0), m_rh(0.0)
{
	setNumber(EQUIDC);
	setName("Equidistant Conic");
	setParamLoad();
}
开发者ID:bpass,项目名称:prasterblaster,代码行数:9,代码来源:equidistantc.cpp

示例3: WARN

bool RTMFProtocol::load(Exception& ex,const string& host,UInt16 port) {

	if (!UDProtocol::load(ex,host,port))
		return false;

	
	if (getNumber<UInt16,10>("keepalivePeer") < 5) {
		WARN("Value of RTMFP.keepalivePeer can't be less than 5 sec")
		setNumber("keepalivePeer", 5);
	}
	if (getNumber<UInt16,15>("keepaliveServer") < 5) {
		WARN("Value of RTMFP.keepaliveServer can't be less than 5 sec")
		setNumber("keepaliveServer", 5);
	}

	_pHandshake.reset(new RTMFPHandshake(*this, sessions, invoker));
	return true;
}
开发者ID:luc1el,项目名称:MonaServer,代码行数:18,代码来源:RTMFProtocol.cpp

示例4: main

int main()
{
	int fid;
	pid_t pid;
	if((fid = open("number.txt", O_WRONLY|O_CREAT|O_TRUNC))<0)
		err_sys("create file error...\n");
	
	sprintf(str,"%d",number);
	write(fid,str,strlen(str));
	close(fid);
	
	TELL_WAIT();
	
	if((pid = fork())<0)
		err_sys("fork error");
	else if(pid==0)
	{
		while((getNumber("number.txt")+1)<1000)
		{
			WAIT_PARENT();
			number  = getNumber("number.txt");
			setNumber("number.txt",number+1);
			printf("Pid = %d,Number = %d\n",getpid(),number+1);
			TELL_PARENT(getppid());
		}
	}
	else
	{
		while((getNumber("number.txt")+1)<1000)
		{
			number  = getNumber("number.txt");
			setNumber("number.txt",number+1);
			printf("Pid = %d,Number = %d\n",getpid(),number+1);
			TELL_CHILD(pid);
			WAIT_CHILD();
		}
		
		
	}
	
	
	close(fid);
	return 0;
}
开发者ID:springer126,项目名称:C-World,代码行数:44,代码来源:exercise.c

示例5: setNumber

Light::Light(int number, Vector pos, Vector dir, float* attenuation) {
	setNumber(number);
	this->pos = pos;
	this->dir = dir;
	setAttenuation(0, attenuation[0]);
	setAttenuation(1, attenuation[1]);
	setAttenuation(2, attenuation[2]);
	initCutoff();
	initExponent();
}
开发者ID:Twigg92,项目名称:CrimeanCrisis,代码行数:10,代码来源:Units.cpp

示例6: CCLOGERROR

void GameElement::mergeElement(GameElement *elem)
{
    if (_number != elem->_number) {
        CCLOGERROR("number is not equal, could not merge");
    }
    
    // merge elem set numer to number * 2
    setNumber(_number * 2);
    _isMerged = true;
}
开发者ID:fragno,项目名称:TransitionCocos2dX,代码行数:10,代码来源:GameElement.cpp

示例7: setNumber

//-------------------------------------------------------------
BigInteger::BigInteger(int n) // "int" constructor
{
	stringstream ss;
	string s;
	ss << n;
	ss >> s;


	if( isdigit(s[0]) ) // if not signed
	{
		setNumber( s );
		setSign( false ); // +ve
	}
	else
	{
		setNumber( s.substr(1) );
		setSign( s[0] == '-' );
	}
}
开发者ID:thatguyandy27,项目名称:ProjectEuler,代码行数:20,代码来源:BigInteger.cpp

示例8: deQuote

NetworkSetup::NetworkSetup( QTextStream & TS, bool & Dangling ) :
      QList<ANetNodeInstance>() {
    long idx;
    QString S, A, N;

    Number = -1;
    Done = 0;
    IsModified = 0;
    Index = -1;
    Name="";
    IsNew = 0;
    AssignedInterface = 0;
    CurrentState = Unchecked;

    Dangling = 0; // by default node collection is ok

    do {
      S = TS.readLine();
      if( S.isEmpty() ) {
        // empty line
        break;
      }

      idx = S.find('=');
      S.stripWhiteSpace();
      A = S.left( idx );
      A.lower();
      N = S.mid( idx+1, S.length() );
      N.stripWhiteSpace();
      N = deQuote( N );

      if( A == "name" ) {
        Name = N;
      } else if( A == "number" ) {
        setNumber( N.toLong() );
      } else if( A == "node" ) {
        ANetNodeInstance * NNI = NSResources->findNodeInstance( N );
        Log(( "Find node %s : %p\n", N.latin1(), NNI ));
        if( NNI ) {
          append( NNI );
        } else {
          // could not find a node type -> collection invalid
          Log(( "Node %s missing -> NetworkSetup dangling\n",
                      N.latin1() ));
          // create placeholder for this dangling NNI
          NNI = new ErrorNNI( N );
          Dangling = 1;
        }
      }
    } while( 1 );

    Log(( "Profile number %s : %d nodes\n",
          Name.latin1(), count() ));
}
开发者ID:opieproject,项目名称:opie,代码行数:54,代码来源:netnode.cpp

示例9: embeddedM1

static bool embeddedM1( CExecutionContext& executionContext )
{
	DEBUG_PRINT( __FUNCTION__ )
	CArbitraryInteger number;
	if( !readNumber( executionContext.Argument, number ) ) {
		return false;
	}
	number.Sub( CArbitraryInteger( 1 ) );
	setNumber( executionContext.Argument, number );
	return true;
}
开发者ID:Mazdaywik,项目名称:refal2-msu-iterpreter,代码行数:11,代码来源:EmbeddedFunctions.cpp

示例10: setNumber

void SudokuBox::undo() {
	auto it = m_vctOps.rbegin();
	if (it == m_vctOps.rend())
		return;

	setNumber(it->pos, it->oldValue);
	m_vctOps.pop_back();

	checkResult();
	refreshErrorTipsLayer();
}
开发者ID:gitter-badger,项目名称:kidsudoku,代码行数:11,代码来源:SudokuBox.cpp

示例11: checkzero

void BigInt::checkzero() {
	int check = 0, i;
	if (number[0] == '-')i = 1;
	else i = 0;
	for (; i < number.length(); i++) {
		if ((number[i] - '0') && !check) {
			check = 1; break;
		}
		else continue;
	}
	if (check)setNumber(number.substr(i));
}
开发者ID:changyuhang,项目名称:ntoucs2b,代码行数:12,代码来源:bigint.cpp

示例12: PropertyToolEditor

NumberPropertyToolEditor::NumberPropertyToolEditor(QObject *parent)
    : PropertyToolEditor(new NumberSelector(), parent)
{
    m_ns = static_cast<NumberSelector*>(widget());

    connect(m_ns, SIGNAL(numberChanged(int)),
            this, SLOT(changeNumber(int)));
    connect(this, SIGNAL(valueSet(QVariant)),
            this, SLOT(setNumber(QVariant)));

    m_ns->setNumber(1);
}
开发者ID:ItTakesTwo,项目名称:screencloud,代码行数:12,代码来源:numberpropertytooleditor.cpp

示例13: embeddedMul

static bool embeddedMul( CExecutionContext& executionContext )
{
	DEBUG_PRINT( __FUNCTION__ )
	CArbitraryInteger number1;
	CArbitraryInteger number2;
	if( !readTwoNumbers( executionContext.Argument, number1, number2 ) ) {
		return false;
	}
	number1.Mul( number2 );
	setNumber( executionContext.Argument, number1 );
	return true;
}
开发者ID:Mazdaywik,项目名称:refal2-msu-iterpreter,代码行数:12,代码来源:EmbeddedFunctions.cpp

示例14: setNumber

void DateTimeEditor::setDateTime(const QDateTime& dateTime)
{
  m_dateTime = dateTime;
  
  if (m_dateTime.isValid())
  {
    setNumber(YEAR,   m_dateTime.date().year());
    setNumber(MONTH,  m_dateTime.date().month());
    setNumber(DAY,    m_dateTime.date().day());
    setNumber(HOUR,   m_dateTime.time().hour());
    setNumber(MINUTE, m_dateTime.time().minute());
    setNumber(SECOND, m_dateTime.time().second());
  }
  else
  {
    for (CharacterInfo& c : m_characters)
    {
      if (c.isEditable())
      {
        c.m_character = m_groups[c.m_group].placeholder;
      }
    }
  }
  
  validate();
  update();
}
开发者ID:flopp,项目名称:QtDateTimeEditor,代码行数:27,代码来源:dateTimeEditor.cpp

示例15: populate

enum SetResponse creditMemo::set(const ParameterList &pParams)
{
  XWidget::set(pParams);
  QVariant param;
  bool     valid;

  param = pParams.value("cmhead_id", &valid);
  if (valid)
  {
    _cmheadid = param.toInt();
    populate();
  }

  param = pParams.value("mode", &valid);
  if (valid)
  {
    _mode = cNew;

    if (param.toString() == "new")
    {
      q.prepare("SELECT NEXTVAL('cmhead_cmhead_id_seq') AS cmhead_id;");
      q.exec();
      if (q.first())
        _cmheadid = q.value("cmhead_id").toInt();
      else if (q.lastError().type() != QSqlError::NoError)
      {
	systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
	return UndefinedError;
      }

      setNumber();
      _memoDate->setDate(omfgThis->dbDate(), true);

      q.prepare("INSERT INTO cmhead ("
		"    cmhead_id, cmhead_number, cmhead_docdate, cmhead_posted"
		") VALUES ("
		"    :cmhead_id, :cmhead_number, :cmhead_docdate, false"
		");");
      q.bindValue(":cmhead_id",		_cmheadid);
      q.bindValue(":cmhead_number",	(!_memoNumber->text().isEmpty() ? _memoNumber->text() : QString("tmp%1").arg(_cmheadid)));
      q.bindValue(":cmhead_docdate",	_memoDate->date());
      q.exec();
      if (q.lastError().type() != QSqlError::NoError)
      {
	systemError(this, q.lastError().databaseText(), __FILE__, __LINE__);
	return UndefinedError;
      }

      connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo()));
      connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool)));
    }
    else if (param.toString() == "edit")
开发者ID:Wushaowei001,项目名称:xtuple-1,代码行数:52,代码来源:creditMemo.cpp


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