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

C++ setRunning函数代码示例

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

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



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

示例1: setRunning

void KviThread::internalThreadRun_doNotTouchThis()
{
	// we're on the slave thread here!
	//qDebug(">> KviThread::internalRun (this=%d)",this);
	setRunning(true);
	setStartingUp(false);
	kvi_threadInitialize();
	run();
	setRunning(false);
	//qDebug("<< KviThread::internalRun (this=%d",this);
}
开发者ID:CardinalSins,项目名称:KVIrc,代码行数:11,代码来源:KviThread.cpp


示例2: setNotRunning

void ItemUser::updateValues( af::Node *node, int type)
{
   af::User * user = (af::User*)node;

   permanent = user->isPermanent();
   if( numrunningtasks ) setRunning();
   else        setNotRunning();

   priority             = user->getPriority();
   annotation           = afqt::stoq( user->getAnnontation());
   hostname             = afqt::stoq( user->getHostName());
   numjobs              = user->getNumJobs();
   numrunningtasks      = user->getRunningTasksNumber();
   maxrunningtasks      = user->getMaxRunningTasks();
   hostsmask            = afqt::stoq( user->getHostsMask());
   hostsmask_exclude    = afqt::stoq( user->getHostsMaskExclude());
   errors_avoidhost     = user->getErrorsAvoidHost();
   errors_tasksamehost  = user->getErrorsTaskSameHost();
   errors_retries       = user->getErrorsRetries();
   errors_forgivetime   = user->getErrorsForgiveTime();
   jobs_lifetime        = user->getJobsLifeTime();

   if( numrunningtasks ) setRunning();
   else                  setNotRunning();

   strLeftTop = QString("%1-%2").arg(name).arg( priority);
   if( false == permanent ) strLeftTop = QString("(%1)").arg( strLeftTop);
   if( isLocked()) strLeftTop = "(LOCK) " + strLeftTop;

   strLeftBottom  = 'j' + QString::number( numjobs) + '/' + QString::number( user->getNumRunningJobs());

   strHCenterTop.clear();
   if( maxrunningtasks != -1) strHCenterTop  = QString("m%1").arg( maxrunningtasks );
   if( false == hostsmask.isEmpty()       )  strHCenterTop += QString(" H(%1)").arg( hostsmask         );
   if( false == hostsmask_exclude.isEmpty()) strHCenterTop += QString(" E(%1)").arg( hostsmask_exclude );
   strHCenterTop += QString(" %1").arg( user->generateErrorsSolvingString().c_str());
   if( jobs_lifetime > 0 ) strHCenterTop += QString(" L%1").arg( af::time2strHMS( jobs_lifetime, true).c_str());

   strRightTop = hostname;

    if( user->solveJobsParallel())
    {
        strRightBottom = "Par";
    }
    else
    {
        strRightBottom = "Ord";
    }

   tooltip = user->generateInfoString( true).c_str();

   calcHeight();
}
开发者ID:Spudster3,项目名称:cgru,代码行数:53,代码来源:itemuser.cpp


示例3: stop

                        bool BtDeviceController::start(){
                            stop();

                            setRunning(true);

                            if (pthread_create(&thread, NULL, run, this) != 0) {
                                setRunning(false);
                            }
                            pthread_detach(thread);

                            return isRunning();
                        }
开发者ID:lince,项目名称:ginga-hones,代码行数:12,代码来源:BtDeviceController.cpp


示例4: setRunning

MyWindow::MyWindow(const char *title, int width, int height)
{
	window = NULL;
	renderer = NULL;
	setRunning(false);

	window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_SHOWN);
	if (window != NULL) {
		renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
		setRunning(true);
	}
}
开发者ID:nguyenchiemminhvu,项目名称:OpenGL_Learning,代码行数:12,代码来源:MyWindow.cpp


示例5: setRunning

void QFEFCSSimScriptTab::cancelExecution()
{
    if (!isRunning()) {
        setRunning(false);
        return;
    }
    if (proc ) {
        proc->close();
        proc->deleteLater();
    }
    setRunning(false);

}
开发者ID:jkriege2,项目名称:QuickFit3,代码行数:13,代码来源:qfefcssimscripttab.cpp


示例6: KviMutex

KviThread::KviThread()
{
	g_pThreadManager->registerSlaveThread(this);
	m_pRunningMutex = new KviMutex();
	setRunning(false);
	setStartingUp(false);
}
开发者ID:CardinalSins,项目名称:KVIrc,代码行数:7,代码来源:KviThread.cpp


示例7: OTSYS_TIME

void Raids::checkRaids()
{
	if(!getRunning()){
		uint64_t now = OTSYS_TIME();
		for(RaidList::iterator it = raidList.begin(); it != raidList.end(); ++it){
			if(now >= (getLastRaidEnd() + (*it)->getMargin())){
				if(MAX_RAND_RANGE*CHECK_RAIDS_INTERVAL/(*it)->getInterval() >= (uint32_t)random_range(0, MAX_RAND_RANGE)){
#ifdef __DEBUG_RAID__
					char buffer[32];
					time_t tmp = time(NULL);
					formatDate(tmp, buffer);
					std::cout << buffer << " [Notice] Raids: Starting raid " << (*it)->getName() << std::endl;
#endif
					setRunning(*it);
					(*it)->startRaid();
					break;
				}
			}

		}
	}

	 checkRaidsEvent = Scheduler::getScheduler().addEvent(createSchedulerTask(CHECK_RAIDS_INTERVAL*1000, 
	     boost::bind(&Raids::checkRaids, this)));
}
开发者ID:ChubNtuck,项目名称:avesta74,代码行数:25,代码来源:raids.cpp


示例8: while

void Server::start()
{
    int findingPort = 50;
    while (findingPort) {
        try {
            startServer();
            setRunning(true);
            findingPort = 0;
            qDebug() << "Connected to port" << m_port;
            if (m_mainWindow) {
                m_mainWindow->notify("Server Started", "Port set to " + QString::number(m_port));
            }
        }
        catch (const nzmqt::ZMQException& ex) {
            if (ex.num() == 48) {
                findingPort--;
                setPort(m_port + 1);
            } else {
                qWarning() << Q_FUNC_INFO << "Exception:" << ex.num() << ex.what();
                findingPort = 0;
                emit failure(ex.what());
                emit finished();
            }
        }
    }
}
开发者ID:fagg,项目名称:nutmeg,代码行数:26,代码来源:server.cpp


示例9: setRunning

void ScriptEditorWidget::onScriptFinished(const QString& scriptPath) {
    _scriptEngine = NULL;
    if (_isRestarting) {
        _isRestarting = false;
        setRunning(true);
    }
}
开发者ID:Adrianl3d,项目名称:hifi,代码行数:7,代码来源:ScriptEditorWidget.cpp


示例10: tr

void ScriptEditorWidget::onWindowActivated() {
    if (!_isReloading) {
        _isReloading = true;
        
        if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) {
            if (static_cast<ScriptEditorWindow*>(this->parent()->parent()->parent())->autoReloadScripts()
                || QMessageBox::warning(this, _currentScript,
                    tr("This file has been modified outside of the Interface editor.") + "\n\n"
                        + (isModified()
                        ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?")
                        : tr("Do you want to reload it?")),
                    QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
                loadFile(_currentScript);
                if (_scriptEditorWidgetUI->onTheFlyCheckBox->isChecked() && isRunning()) {
                    _isRestarting = true;
                    setRunning(false);
                    // Script is restarted once current script instance finishes.
                }

            }
        }

        _isReloading = false;
    }
}
开发者ID:Adrianl3d,项目名称:hifi,代码行数:25,代码来源:ScriptEditorWidget.cpp


示例11: qDebug

void UsbWidget::deviceError() {
    qDebug("[usb] %s",usb_strerror());
    usb_close(handle);
    handle = NULL;

    setRunning( false );
}
开发者ID:elcerdo,项目名称:avr,代码行数:7,代码来源:UsbWidget.cpp


示例12: QDialog

FingerprinterProgressBar::FingerprinterProgressBar( QWidget* parent, Qt::WindowFlags f )
        : QDialog( parent, f | Qt::Sheet ),
          m_stopped( false )
{
    ui.setupUi( this );
    setModal( true );
    setRunning( false );
    
    m_totalTracks = m_tracksFingerprinted = m_tracksSkipped = m_tracksWithErrors = 0;
    
    m_timer.setInterval( 1000 );
    connect(&m_timer, SIGNAL(timeout()), this, SLOT(update()));
    connect(ui.fingerprintProgressBar, SIGNAL( valueChanged( int ) ), this, SLOT( progressBarChanged( int ) ) );   
 
    m_timeElapsed = m_etaCounter = m_timeRemaining = 0;
    
    setFixedHeight( sizeHint().height() );

    ui.okButton->setVisible( false );

    connect( ui.okButton, SIGNAL( clicked() ),
             this, SLOT( onOkClicked() ) );
    connect( ui.stopButton, SIGNAL( clicked() ),
             this, SLOT( onCancelClicked() ) );
}
开发者ID:RJ,项目名称:lastfm-desktop,代码行数:25,代码来源:FingerprinterProgressBar.cpp


示例13: satellitesInViewUpdated

void SatelliteModel::updateDemoData()
{
    static bool flag = true;
    QList<QGeoSatelliteInfo> satellites;
    if (flag) {
        for (int i = 0; i<5; i++) {
            QGeoSatelliteInfo info;
            info.setSatelliteIdentifier(i);
            info.setSignalStrength(20 + 20*i);
            satellites.append(info);
        }
    } else {
        for (int i = 0; i<9; i++) {
            QGeoSatelliteInfo info;
            info.setSatelliteIdentifier(i*2);
            info.setSignalStrength(20 + 10*i);
            satellites.append(info);
        }
    }


    satellitesInViewUpdated(satellites);
    flag ? satellitesInUseUpdated(QList<QGeoSatelliteInfo>() << satellites.at(2))
         : satellitesInUseUpdated(QList<QGeoSatelliteInfo>() << satellites.at(3));
    flag = !flag;

    emit errorFound(flag);

    if (isSingleRequest() && !singleRequestServed) {
        singleRequestServed = true;
        setRunning(false);
    }
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:33,代码来源:satellitemodel.cpp


示例14: QSF_TRANSLATE_CONTEXTSTRING

	//[-------------------------------------------------------]
	//[ Public virtual em5::FreeplayEvent methods             ]
	//[-------------------------------------------------------]
	bool BMAFireEvent::onStartup()
	{
		BMAComponent* bma = mTargetBMA->getComponent<flo11::BMAComponent>();
		//No nullptr check, EventFactory did that already
		qsf::Entity* targetEntity = QSF_MAINMAP.getEntityById(bma->getTargetId());
		if (targetEntity != nullptr) {
			// Mark the entity so it wont get effected by other events
			em5::EventIdComponent& eventIdComponent = targetEntity->getOrCreateComponentSafe<em5::EventIdComponent>();
			eventIdComponent.setEvent(*this, em5::eventspreadreason::NO_REASON);
		}
		
		std::string eventName = QSF_TRANSLATE_CONTEXTSTRING("flo11::BMAFireEvent", "ID_BMA_FIRE_EVENT_NAME");
		eventName.append(": ");
		eventName.append(bma->getName());

		this->setEventName(eventName);
		this->setNormalPointGain(500);

		bma->detectFire(); //BMA AUslösen

		mMessageProxy.registerAt(qsf::MessageConfiguration("flo11::BMAResetActionFinished"), boost::bind(&BMAFireEvent::onResetBMAFinished, this, _1));
		mTargetBurningMessageProxy.registerAt(qsf::MessageConfiguration(em5::Messages::EM5_OBJECT_STOP_BURNING, bma->getTargetId()), boost::bind(&BMAFireEvent::onTargetStopBurning, this, _1));
		mInvestigatingMessageProxy.registerAt(qsf::MessageConfiguration("flo11::BMAInvestigationFinished", bma->getEntityId()), boost::bind(&BMAFireEvent::onInvestigationFinished, this, _1));

		setRunning();
		// Done
		return true;
	}
开发者ID:thetodd,项目名称:em5_bma,代码行数:31,代码来源:BMAFireEvent.cpp


示例15: NetworkException

void NetworkService::stop() { //throw (NetworkException*) {
	if (_log->isInfo()) _log->info("Shutting down the network service");
	if (!_running) {
		throw new NetworkException(new string("The network service is not running. Try starting it first"));
	}
	if (processing > 0) {
		cout << "Stop requested but still working" << endl;
	}
	int i = 0;
	while (processing > 0) {
		Thread::sleep(1000);
		i++;
		// if the time exceeded then shutdown anyway
		if (i > 10) {
			break;
		}
	}
	delete _transactionManager;
	delete _baseTransaction;
	__dbController->shutdown();
	setRunning(false);
	_ntserver->stop();

	delete __dbController;
}
开发者ID:FikiHafana,项目名称:djondb,代码行数:25,代码来源:networkservice.cpp


示例16: deleteLater

void KWin::Script::slotScriptLoadedFromFile()
{
    QFutureWatcher<QByteArray> *watcher = dynamic_cast< QFutureWatcher< QByteArray>* >(sender());
    if (!watcher) {
        // not invoked from a QFutureWatcher
        return;
    }
    if (watcher->result().isNull()) {
        // do not load empty script
        deleteLater();
        watcher->deleteLater();
        return;
    }
    QScriptValue optionsValue = m_engine->newQObject(options, QScriptEngine::QtOwnership,
                            QScriptEngine::ExcludeSuperClassContents | QScriptEngine::ExcludeDeleteLater);
    m_engine->globalObject().setProperty(QStringLiteral("options"), optionsValue, QScriptValue::Undeletable);
    m_engine->globalObject().setProperty(QStringLiteral("QTimer"), constructTimerClass(m_engine));
    QObject::connect(m_engine, SIGNAL(signalHandlerException(QScriptValue)), this, SLOT(sigException(QScriptValue)));
    KWin::MetaScripting::supplyConfig(m_engine);
    installScriptFunctions(m_engine);

    QScriptValue ret = m_engine->evaluate(QString::fromUtf8(watcher->result()));

    if (ret.isError()) {
        sigException(ret);
        deleteLater();
    }

    watcher->deleteLater();
    setRunning(true);
    m_starting = false;
}
开发者ID:8l,项目名称:kwin,代码行数:32,代码来源:scripting.cpp


示例17: NetworkException

void NetworkService::stop() { //throw (NetworkException*) {
	if (log->isInfo()) log->info("Shutting down the network service");
	if (!_running) {
		throw new NetworkException(new string("The network service is not running. Try starting it first"));
	}
	if (processing > 0) {
		cout << "Stop requested but still working" << endl;
	}
	int i = 0;
	while (processing > 0) {
		Thread::sleep(1000);
		i++;
		// if the time exceeded then shutdown anyway
		if (i > 10) {
			break;
		}
	}
	__dbController->shutdown();
	setRunning(false);
#ifndef WINDOWS
	int res = close(sock);
#else
	int res = closesocket(sock);
#endif
	if (res != 0) {
		log->error("The close method returned: " + toString(res));
	}

	m_thread->join();

	if (m_thread) delete(m_thread);
}
开发者ID:hecogo,项目名称:djondb,代码行数:32,代码来源:networkservice.cpp


示例18: QWidget

UsbWidget::UsbWidget(QWidget *parent,bool autostart) : QWidget(parent), handle(NULL), old_buffer(NULL) {
    QSettings settings;
    usb_init();

    setLayout(new QVBoxLayout(this));

    button = new QPushButton("Start Device",this);
    button->setCheckable(true);
    connect(button,SIGNAL( clicked(bool) ),this,SLOT( setRunning(bool) )); 
    layout()->addWidget(button);

    intensity = new QSlider(Qt::Horizontal,this);
    intensity->setRange(0,0x0f);
    intensity->setValue(settings.value("usb/intensity",7).toInt());
    connect(intensity,SIGNAL( valueChanged(int) ),this,SLOT( setIntensity(int) ));
    connect(button,SIGNAL( clicked(bool) ),intensity,SLOT( setEnabled(bool) ));
    layout()->addWidget(intensity);

    status = new QLabel("Device status",this);
    layout()->addWidget(status);

    pool_timer = new QTimer(this);
    connect(pool_timer,SIGNAL( timeout() ),this,SLOT( update() ));
    pool_timer->setInterval( 10 );

    dynamic_cast<QBoxLayout*>(layout())->addStretch(1);

    old_buffer = new unsigned char[8];
    for (int k=0; k<8; k++) old_buffer[k] = 0;

    if ( autostart ) {
        button->setChecked(true);
        setRunning(true);
    }
}
开发者ID:elcerdo,项目名称:avr,代码行数:35,代码来源:UsbWidget.cpp


示例19: doSave

        void SettingsMenu::doSave()
        {
            auto settings = Game::getInstance()->settings();
            settings->setCombatDifficulty(((UI::MultistateImageButton*)getUI("combat_difficulty"))->state());
            settings->setGameDifficulty(((UI::MultistateImageButton*)getUI("game_difficulty"))->state());
            settings->setViolenceLevel(((UI::MultistateImageButton*)getUI("violence_level"))->state());
            settings->setTargetHighlight(((UI::MultistateImageButton*)getUI("target_highlight"))->state());
            settings->setCombatLooks(((UI::MultistateImageButton*)getUI("combat_looks"))->state());
            settings->setCombatMessages(((UI::MultistateImageButton*)getUI("combat_messages"))->state());
            settings->setCombatTaunts(((UI::MultistateImageButton*)getUI("combat_taunts"))->state());
            settings->setLanguageFilter(((UI::MultistateImageButton*)getUI("language_filter"))->state());
            settings->setRunning(((UI::MultistateImageButton*)getUI("running"))->state());
            settings->setSubtitles(((UI::MultistateImageButton*)getUI("subtitles"))->state());
            settings->setItemHighlight(((UI::MultistateImageButton*)getUI("item_highlight"))->state());

            settings->setMasterVolume(((UI::Slider*)getUI("master_volume"))->value());
            settings->setMusicVolume(((UI::Slider*)getUI("music_volume"))->value());
            settings->setVoiceVolume(((UI::Slider*)getUI("voice_volume"))->value());
            settings->setSfxVolume(((UI::Slider*)getUI("sfx_volume"))->value());

            settings->setTextDelay(((UI::Slider*)getUI("text_delay"))->value());
            settings->setCombatSpeed(((UI::Slider*)getUI("combat_speed"))->value());
            settings->setBrightness(((UI::Slider*)getUI("brightness"))->value());
            settings->setMouseSensitivity(((UI::Slider*)getUI("mouse_sensitivity"))->value());

            settings->setPlayerSpeedup(((UI::ImageButton*)getUI("player_speedup"))->checked());

            settings->save();
            Game::getInstance()->popState();
        }
开发者ID:CynicRus,项目名称:falltergeist,代码行数:30,代码来源:SettingsMenu.cpp


示例20: setWindow

Level::Level() {
	setWindow();
	setRenderer();
	setRunning();
	initObjects();
	setObjects();
}
开发者ID:muhdmirzamz,项目名称:Creque,代码行数:7,代码来源:Level.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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