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

C++ setNumber函数代码示例

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

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



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


示例16: setNumber

void Weather::load(const std::string& wSprite, int number, int distance, int intensityX, int intensityY, int alpha) {
	m_distance = distance;
	m_intensityX = intensityX;
	m_intensityY = intensityY;
	setNumber(number);
	m_active = true;

	if (!wSprite.empty()) {
		m_weather = std::make_unique<ska::Texture>(wSprite, ska::Texture::DEFAULT_T_RED, ska::Texture::DEFAULT_T_GREEN, ska::Texture::DEFAULT_T_BLUE, alpha);
	}

	resetRandomPos();
}
开发者ID:Scorbutics,项目名称:SmashAndDash,代码行数:13,代码来源:Weather.cpp


示例17: appLoop_WriteTask

/* The write task writes number into the queue in series of 8, as long as
 * space allows for. The numbers written are displayed. When the queue
 * cannot be obtained, a wait led starts flashing until a new attempt is
 * done. */
void appLoop_WriteTask(void)
{ Tuint08 count = 0;
  while (true)
  { if (taskQueuWriteRequestOnName(ThePipe,8,800))
    { for (count=0; count<8; count++)
      { genQueuWriteOnName(ThePipe,count);
        setNumber(0xF0,count);
        taskDelayFromNow(600); }
      taskQueuReleaseOnName(ThePipe); }
    else
    { for (count=0; count<10; count++)
      { invLed(3);
        taskDelayFromNow(80); } } } }
开发者ID:RoostTech,项目名称:FemtoOS,代码行数:17,代码来源:code_TestQueus.c


示例18: parent

HeightPoint::HeightPoint(HeightProfile* parent, Waypoint* wp, QColor color, int listindex)
    :  parent(parent),
       wp(wp),
       color(color),
       oldMousePos(0,0)
{
    elevationPoint = new ElevationPoint(parent,Qt::red);
    setNumber(listindex);
    setFlag(ItemIsMovable);
    refreshToolTip();

    connect(wp, SIGNAL(changed(Waypoint*)), this, SLOT(updateHeightPoint(Waypoint*)));
}
开发者ID:skye-AL,项目名称:qgroundcontrol-1,代码行数:13,代码来源:HeightPoint.cpp


示例19: testGutterLines_appendLine_setsNextLineNumber

    void testGutterLines_appendLine_setsNextLineNumber()
    {
        auto expected = new NiceMock<LineMock>();
        EXPECT_CALL(*expected, setNumber(1)).Times(1);

        FakeFactory factory;
        EXPECT_CALL(factory, createLeftGutterLine()).Times(1).
                WillOnce(Return(expected));

        RZQtIDELeftGutterWidgetLines lines(factory);

        lines.append();
    }
开发者ID:rozetti,项目名称:0x0C0DE7AB,代码行数:13,代码来源:RZQtIDELeftGutterWidgetLinesTests.cpp


示例20: embeddedCvb

static bool embeddedCvb( CExecutionContext& executionContext )
{
	DEBUG_PRINT( __FUNCTION__ )
	std::string text;
	CArbitraryInteger number;
	if( !readText( executionContext.Argument, text, true /* textCanBeEmpty */ )
		|| !number.SetValueByText( text ) )
	{
		return false;
	}
	setNumber( executionContext.Argument, number );
	return true;
}
开发者ID:Mazdaywik,项目名称:refal2-msu-iterpreter,代码行数:13,代码来源:EmbeddedFunctions.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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