本文整理汇总了C++中setPriority函数的典型用法代码示例。如果您正苦于以下问题:C++ setPriority函数的具体用法?C++ setPriority怎么用?C++ setPriority使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setPriority函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Q_UNUSED
Translator::Translator(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
{
Q_UNUSED(args);
setObjectName(QLatin1String("Translator"));
reloadConfiguration();
setHasRunOptions(true);
setIgnoredTypes(Plasma::RunnerContext::Directory |
Plasma::RunnerContext::File |
Plasma::RunnerContext::NetworkLocation);
setSpeed(AbstractRunner::SlowSpeed);
setPriority(HighestPriority);
setDefaultSyntax(Plasma::RunnerSyntax(QString::fromLatin1("%1:q:").arg(i18n("<language code>")),i18n("Translates the word(s) :q: into target language")));
setDefaultSyntax(Plasma::RunnerSyntax(QString::fromLatin1("%1:q:").arg(i18n("<source languagce>-<target languagce>")), i18n("Translates the word(s) :q: from the source into target language")));
}
开发者ID:naraesk,项目名称:krunner-translator,代码行数:16,代码来源:translator.cpp
示例2: tokenizer
void FilterChannel::setProperty(const std::string& name, const std::string& value)
{
if (name.compare(0, 7, "channel") == 0)
{
StringTokenizer tokenizer(value, ",;", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
for (StringTokenizer::Iterator it = tokenizer.begin(); it != tokenizer.end(); ++it)
{
addChannel(LoggingRegistry::defaultRegistry().channelForName(*it));
}
}
else if (name.compare(0, 5, "level") == 0)
{
setPriority(value);
}
else Channel::setProperty(name, value);
}
开发者ID:AlistairMills,项目名称:mantid,代码行数:16,代码来源:FilterChannel.cpp
示例3: setPriority
DECLARE_EXPORT int SetupMatrix::Rule::setattro(const Attribute& attr, const PythonObject& field)
{
if (attr.isA(Tags::tag_priority))
setPriority(field.getInt());
else if (attr.isA(Tags::tag_fromsetup))
setFromSetup(field.getString());
else if (attr.isA(Tags::tag_tosetup))
setToSetup(field.getString());
else if (attr.isA(Tags::tag_duration))
setDuration(field.getTimeperiod());
else if (attr.isA(Tags::tag_cost))
setCost(field.getDouble());
else
return -1; // Error
return 0; // OK
}
开发者ID:ConePerez,项目名称:frePPLe,代码行数:16,代码来源:setupmatrix.cpp
示例4: setSkill
DECLARE_EXPORT ResourceSkill::ResourceSkill(Skill* s, Resource* r, int u, DateRange e)
{
setSkill(s);
setResource(r);
setPriority(u);
setEffective(e);
initType(metadata);
try { validate(ADD); }
catch (...)
{
if (getSkill()) getSkill()->resources.erase(this);
if (getResource()) getResource()->skills.erase(this);
resetReferenceCount();
throw;
}
}
开发者ID:albertca,项目名称:frePPLe,代码行数:16,代码来源:resourceskill.cpp
示例5: throw
ObjectMemoryDeferFree::ObjectMemoryDeferFree (Memory& m) throw()
: ObjectMemoryBase (m),
Threading::Thread ("Memory Deferred Free Thread")
{
setPriority (0);
getMemory().resetUserData();
getMemory().resetFunctions();
AtomicOps::memoryBarrier();
queue = new LockFreeQueue<Element>;
AtomicOps::memoryBarrier();
getMemory().setUserData (this);
getMemory().setFunctions (staticAlloc, staticFree);
}
开发者ID:0x4d52,项目名称:pl-nk,代码行数:16,代码来源:plonk_ObjectMemoryDeferFree.cpp
示例6: setPriority
void
Daemon::onResourceInitialization(void)
{
try
{
setPriority(Concurrency::Scheduler::maximumPriority());
inf(DTR("daemon running with maximum priority: %d"), Concurrency::Scheduler::maximumPriority());
}
catch (...)
{
inf(DTR("daemon not running with maximum priority"));
}
m_ctx.mbus.resume();
m_tman->start();
m_periodic_counter.setTop(1.0);
setEntityState(IMC::EntityState::ESTA_NORMAL, Status::CODE_ACTIVE);
}
开发者ID:AndreGCGuerra,项目名称:dune,代码行数:18,代码来源:Daemon.cpp
示例7: QAbstractIpcInterface
/*!
Constructs a new QHardwareInterface object with interface type \a name,
identity \a id and operates in \a mode. The object is attached to
\a parent.
If \a id is empty the default accessory for \a name will be
automatically selected.
*/
QHardwareInterface::QHardwareInterface( const QString& name,
const QString& id,
QObject* parent,
QAbstractIpcInterface::Mode mode )
: QAbstractIpcInterface( HARDWAREINTERFACE_VALUEPATH,
name,
id,
parent,
mode )
{
if ( mode == QAbstractIpcInterface::Server ) {
QSettings defaults( "Trolltech", "HardwareAccessories" );
defaults.beginGroup( "Defaults" );
if ( defaults.value( name ) == id )
setPriority( 1 );
defaults.endGroup();
}
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:26,代码来源:qhardwareinterface.cpp
示例8: AuxNode
/** We can't create nodes separately, do it through newNode method of graph */
GNode::GNode( GGraph *graph_p, int _id):
AuxNode( ( AuxGraph *)graph_p, _id),
_doc( NULL),
ir_id( GRAPH_MAX_NODE_NUM),
text_shown( false),
_style( NULL)
{
item_p = new NodeItem( this);
graph()->view()->scene()->addItem( item_p);
setIRId( id());
graph()->invalidateRanking();
if ( graph()->view()->isContext())
{
item()->hide();
setForPlacement( false);
setPriority( 0);
}
}
开发者ID:MagicCancel,项目名称:showgraph,代码行数:19,代码来源:node_item.cpp
示例9: switch
bool Package::setData(int role, const QVariant &value) {
switch (role) {
case CategoryRole:
setCategory(value.toString());
return true;
case CreateSubfolderRole:
setCreateSubfolder(value.toBool());
return true;
case IdRole:
setId(value.toString());
return true;
case NameRole:
setName(value.toString());
return true;
case PriorityRole:
setPriority(TransferItem::Priority(value.toInt()));
return true;
case StatusRole:
switch (value.toInt()) {
case Queued:
queue();
return true;
case Downloading:
start();
return true;
case Paused:
pause();
return true;
case Canceled:
cancel();
return true;
case CanceledAndDeleted:
cancel(true);
return true;
default:
return TransferItem::setData(role, value);
}
case SuffixRole:
setSuffix(value.toString());
return true;
default:
return TransferItem::setData(role, value);
}
}
开发者ID:marxoft,项目名称:qdl2,代码行数:44,代码来源:package.cpp
示例10: setPriority
void Script::run()
{
setPriority(QThread::LowPriority);
// use 0 as parent, see Constructor.
m_p_action = new Kross::Action(0, m_fileName); //"ContentFetchScript");
// quit the exec() loop after get finish/abort signal from script
connect(m_p_kgetcore, SIGNAL(finished()), this, SLOT(quit()));
connect(m_p_kgetcore, SIGNAL(aborted(QString)), this, SLOT(quit()));
// add transfer
connect(m_p_kgetcore, SIGNAL(newTransfer(QString,QString)),
this, SIGNAL(newTransfer(QString,QString)));
// update status signal/slot
connect(m_p_kgetcore, SIGNAL(percentUpdated(int)),
this, SIGNAL(percentUpdated(int)));
connect(m_p_kgetcore, SIGNAL(textStatusUpdated(QString)),
this, SIGNAL(textStatusUpdated(QString)));
connect(m_p_kgetcore, SIGNAL(finished()), this, SIGNAL(finished()));
connect(m_p_kgetcore, SIGNAL(aborted(QString)), this, SIGNAL(aborted(QString)));
// main entry point
connect(this, SIGNAL(startDownload(QObject*)),
m_p_kgetcore, SIGNAL(startDownload(QObject*)));
m_p_action->setFile(m_fileName);
// TODO add check
kDebug(5002) << "KGetCore Added to script at ThreadId " << QThread::currentThreadId();
m_p_action->addObject(m_p_kgetcore, "kgetcore",
Kross::ChildrenInterface::AutoConnectSignals);
m_p_action->trigger();
ScriptConfigAdaptor config;
emit startDownload(&config);
//m_p_action->callFunction("startDownload", QVariantList());
kDebug(5002) << "Script Finished!" << QThread::currentThreadId();
//delete m_p_kgetcore;
//delete m_p_action;
if (m_p_action->hadError())
{
kDebug(5002) << "Error:" << m_p_action->errorMessage() << m_p_action->errorTrace();
}
else
{
exec();
}
}
开发者ID:KDE,项目名称:kget,代码行数:43,代码来源:script.cpp
示例11: _version
HTTPCookie::HTTPCookie(const NameValueCollection& nvc):
_version(0),
_secure(false),
_maxAge(-1),
_httpOnly(false)
{
for (NameValueCollection::ConstIterator it = nvc.begin(); it != nvc.end(); ++it) {
const std::string& name = it->first;
const std::string& value = it->second;
if (icompare(name, "comment") == 0) {
setComment(value);
}
else if (icompare(name, "domain") == 0) {
setDomain(value);
}
else if (icompare(name, "path") == 0) {
setPath(value);
}
else if (icompare(name, "priority") == 0) {
setPriority(value);
}
else if (icompare(name, "max-age") == 0) {
throw NotImplementedException("HTTPCookie::HTTPCookie max-age");
}
else if (icompare(name, "secure") == 0) {
setSecure(true);
}
else if (icompare(name, "expires") == 0) {
throw NotImplementedException("HTTPCookie::HTTPCookie expires");
}
else if (icompare(name, "version") == 0) {
throw NotImplementedException("HTTPCookie::HTTPCookie version");
}
else if (icompare(name, "HttpOnly") == 0) {
setHttpOnly(true);
}
else {
setName(name);
setValue(value);
}
}
}
开发者ID:liyustar,项目名称:liblyx,代码行数:43,代码来源:lyxHTTPCookie.cpp
示例12: main
void main()
{
int i=0;
char mymac[6]={0x74,0xf7,0x26,0x00,0x00,0x01};
unsigned char data[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x04,0x74,0xf7,0x26,0x00,0x00,0x01,0x65,0x00,0x00,0x0a,0x05,0x00,0x01,0x02,0x03,0x05,0x06,0x07,0x08,0x09};
bowler4_header bh;
for (i=0; i<sizeof(bowler4_header); i++) bh.bytes[i]=0;
bh.fields.version=0x04;
bh.fields.affect=setPriority(5,setState(setAsync(bh.fields.affect)));
bh.fields.payloadLength=10;
bh.fields.payloadType=0;
set_mac_address(mymac,&bh);
calculate_checksum(&bh);
printf("Verify?\t%d\n",verify_checksum(&bh));
printf("Verify?\t%d\n",verify_checksum(&bh));
printf("%X\n",check_mac_address(mymac,&bh) );
printHeader(bh);
V4MicroParser_state parser;
parser.state=align;
parser.macaddr=&mymac;
fifoInit(&parser.fifo);
fifoPrint(&parser.fifo);
for (i=0; i<sizeof(data); i++){
fifoPush(&parser.fifo,data[i]);
int delta=parser.fifo.inPointer;
printf("Pushing:\t%i\n",i);
/*fifoPrint(&parser.fifo);*/
runParserSM(&parser);
if (parser.fifo.inPointer!=delta) {printf("\nNew Contents of FIFO:");fifoPrint(&parser.fifo);}
printf("===================\n");
}
/* fifoPull(&fifo,15); */
/* fifoPrint(&fifo); */
}
开发者ID:acamilo,项目名称:TinyBowler4,代码行数:43,代码来源:main.c
示例13: LogicException
DECLARE_EXPORT void ResourceSkill::endElement (XMLInput& pIn, const Attribute& pAttr, const DataElement& pElement)
{
if (pAttr.isA (Tags::tag_resource))
{
Resource *r = dynamic_cast<Resource*>(pIn.getPreviousObject());
if (r) setResource(r);
else throw LogicException("Incorrect object type during read operation");
}
else if (pAttr.isA (Tags::tag_skill))
{
Skill *s = dynamic_cast<Skill*>(pIn.getPreviousObject());
if (s) setSkill(s);
else throw LogicException("Incorrect object type during read operation");
}
else if (pAttr.isA(Tags::tag_priority))
setPriority(pElement.getInt());
else if (pAttr.isA(Tags::tag_effective_end))
setEffectiveEnd(pElement.getDate());
else if (pAttr.isA(Tags::tag_effective_start))
setEffectiveStart(pElement.getDate());
else if (pAttr.isA(Tags::tag_action))
{
delete static_cast<Action*>(pIn.getUserArea());
pIn.setUserArea(
new Action(MetaClass::decodeAction(pElement.getString().c_str()))
);
}
else if (pIn.isObjectEnd())
{
// The resourceskill data is now all read in. See if it makes sense now...
Action a = pIn.getUserArea() ?
*static_cast<Action*>(pIn.getUserArea()) :
ADD_CHANGE;
delete static_cast<Action*>(pIn.getUserArea());
try { validate(a); }
catch (...)
{
delete this;
throw;
}
}
}
开发者ID:albertca,项目名称:frePPLe,代码行数:42,代码来源:resourceskill.cpp
示例14: HistogramInteractor
HistogramInteractorMetricMapping::HistogramInteractorMetricMapping(const PluginContext* ) : HistogramInteractor(":/i_histo_color_mapping.png", "Metric Mapping") {
setConfigurationWidgetText(QString ("<html><head><title></title></head><body>")
+"<h3>Metric mapping interactor</h3>"
+"<p>This interactor allows to perform a metric mapping on nodes colors, nodes borders colors, nodes sizes, nodes borders widths or nodes glyphs in a visual way.</p>"
+"<p>To select the mapping type, do a right click on the scale located at the left of the histogram vertical axis and pick the one wanted in the popup menu which appears.</p>"
+"<p>To configure the metric mapping, double click on the scale located at the left of the histogram vertical axis and use the dialog which appears.</p>"
+"<h4>Color mapping configuration</h4>"
+"<p>The configuration dialog for the color mapping is illustrated below.<br />"
+"<img src=\":/ColorScaleConfigDialog.png\" width=\"280\" height=\"260\" border=\"0\" alt=\"\"><br />"
+"The first tab of this dialog allows to manually define a color scale. To do so, start by picking the number of colors to use by using the spinbox located above the colors table. "
+"To select the colors to use, double click on the cells of the colors table and a color picker dialog will appear. A preview of the built color scale is displayed at the right of the color table.<br />"
+"The built color scale can be saved using the \"Save color scale\" button.<br /><br />"
+"<img src=\":/ColorScaleConfigDialog2.png\" width=\"280\" height=\"260\" border=\"0\" alt=\"\"><br />"
+"The second tab of the dialog allow to load a previously saved color scale and give also the possibility to load a color scale from an image file (the color scale must be defined in the vertical dimension of the image). "
+"Previously saved color scale can be reedit by double clicking on it. <br />"
+"Once the color scale to use has been selected or configured, press the \"Ok\" button.</p>"
+"<h4>Size mapping configuration</h4>"
+"<p>The configuration dialog for the size mapping is illustrated below.<br />"
+"<img src=\":/SizeScaleConfigDialog.png\" width=\"280\" height=\"280\" border=\"0\" alt=\"\"><br />"
+"The top part of the dialog allows to select on which size property the mapping has to be performed : <i>viewSize</i> or <i>viewBorderWidth</i>.<br />"
+"The middle part of the dialog aims to configure the minimum and maximum size to use for the mapping.<br />"
+"The bottom part of the dialog allows to select on which dimensions the size mapping has to be applied when it is performed on the viewSize property.<br />"
+"Once the wanted parameters have been set, press the \"OK\" button to apply them.</p>"
+"<h4>Glyph mapping configuration</h4>"
+"<p>The configuration dialog for the size mapping is illustrated below.<br />"
+"<img src=\":/GlyphScaleConfigDialog.png\" width=\"280\" height=\"280\" border=\"0\" alt=\"\"><br />"
+"Use the spin box located at the top of the dialog to define the number of nodes glyphs to use for the mapping. <br/>"
+"Select the glyphs to use by the help of the combo boxes contained in the cells of the table.<br />"
+"Press the \"OK\" button to apply the settings. </p>"
+"<h4>Metric mapping instructions</h4>"
+"<p>The metric mapping is done with the help of the editable curve drawn on top of the histogram. By double clicking on it, control points are created which allow to modify the curve shape (by drag and drop them) and so the metric mapping. The created control points can also be removed by double clicking on them. </p>"
+"<p>The mapping performed can be visually interpreted as followed. For each node of the graph, get the value of the metric property associated with the current displayed histogram. "
+"Take the line perpendicular to the horizontal axis of the histogram (the metric axis) which passes by the point on the metric axis associated with the node metric value. "
+"Then take the intersection point between this line and the curve controlling the mapping. The value of the metric is then mapped on the node visual property associated to the y coordinates of this intersection point according to the scale located at the left of the histogram vertical axis (which can be a color, a size or a glyph scale). <br />"
+"The corresponding mapping on the whole graph metric is materialized by the scale located under the histogram horizontal axis. "
+"For example, if the curve is a straight line between the bottom left corner and the top right corner of the histogram, a linear mapping is performed on the metric. "
+"More complex mapping can be performed like the color mapping illustrated below.<br />"
+"<img src=\":/HistoColorMapping.png\" width=\"280\" height=\"260\" border=\"0\" alt=\"\"><br />"
+"</p>"
+"</body></html>");
setPriority(StandardInteractorPriority::ViewInteractor1);
}
开发者ID:mneumann,项目名称:tulip,代码行数:42,代码来源:HistogramInteractors.cpp
示例15: clearLogId
int SpdyStream::init(uint32_t StreamID,
int Priority, SpdyConnection *pSpdyConn, uint8_t flags,
HioHandler *pHandler)
{
HioStream::reset(DateTime::s_curTime);
pHandler->attachStream(this);
clearLogId();
setState(HIOS_CONNECTED);
setFlag((flags & (SPDY_CTRL_FLAG_FIN | SPDY_CTRL_FLAG_UNIDIRECTIONAL)), 1);
m_bufIn.clear();
m_uiStreamID = StreamID;
m_iWindowOut = pSpdyConn->getStreamOutInitWindowSize();
m_iWindowIn = pSpdyConn->getStreamInInitWindowSize();
setPriority(Priority);
m_pSpdyConn = pSpdyConn;
LS_DBG_L(this, "SpdyStream::init(), id: %d. ", StreamID);
return 0;
}
开发者ID:creativeprogramming,项目名称:openlitespeed,代码行数:20,代码来源:spdystream.cpp
示例16: CException
AbstractThread::AbstractThread(const char *name, IThread::Priority priority)
{
if( AbstractThread::m_threadsAvailable == 0 )
{
// no threads were started before - initialise thread subsystem
#ifdef _WIN32
if( CoInitializeEx(NULL, COINIT_MULTITHREADED) != S_OK )
{
throw CException(LOGL_FATAL, 0, "OLE is not available, threading model unimplementable");
}
#endif
AbstractThread::m_threadsAvailable++;
}
m_id = 0;
m_name = name;
m_handle = 0;
m_hangCheck = 0;
m_terminateRequested = true;
setPriority(priority);
}
开发者ID:DarkLotus,项目名称:Source,代码行数:20,代码来源:threads.cpp
示例17: CreateThread
void Thread::start()
{
#ifdef WIN32
LPDWORD threadID = 0;
handle = CreateThread(NULL, // Security attributes
0, // Stack size
threadFunc, // Thread function
(Thread*)this, // Parameter
0, // Flags
threadID // Thread ID
);
assert(handle); // Failed to create thread
setPriority(THREAD_PRIORITY_NORMAL);
#else
if (pthread_create(&handle, NULL, threadFunc, this) != 0)
{
// // Loggerabort("Could not create thread: %s", strerror(errno));
}
#endif // !WIN32
}
开发者ID:KRSSG,项目名称:Simurosot,代码行数:20,代码来源:thread.cpp
示例18: setName
void StatusPreset::fromXml(const QDomElement &el)
{
// FIXME: This is the old format. Should be removed in the future
if (el.tagName() == "item") {
setName(el.attribute("name"));
setMessage(el.text());
return;
}
if (el.isNull() || el.tagName() != "preset")
return;
setName(el.attribute("name"));
setMessage(el.text());
if (el.hasAttribute("priority"))
setPriority(el.attribute("priority").toInt());
XMPP::Status status;
status.setType(el.attribute("status", "away"));
setStatus(status.type());
}
开发者ID:psi-im,项目名称:psi,代码行数:21,代码来源:statuspreset.cpp
示例19: setObjectName
SessionRunner::SessionRunner(QObject *parent, const QVariantList &args)
: Plasma::AbstractRunner(parent, args)
{
setObjectName( QLatin1String("Sessions" ));
setPriority(LowPriority);
setIgnoredTypes(Plasma::RunnerContext::Directory | Plasma::RunnerContext::File |
Plasma::RunnerContext::NetworkLocation);
m_canLogout = KAuthorized::authorizeAction(QStringLiteral("logout")) && KAuthorized::authorize(QStringLiteral("logout"));
if (m_canLogout) {
addSyntax(Plasma::RunnerSyntax(i18nc("log out command", "logout"),
i18n("Logs out, exiting the current desktop session")));
addSyntax(Plasma::RunnerSyntax(i18nc("shutdown computer command", "shutdown"),
i18n("Turns off the computer")));
}
if (KAuthorized::authorizeAction(QStringLiteral("lock_screen")) && m_canLogout) {
addSyntax(Plasma::RunnerSyntax(i18nc("lock screen command", "lock"),
i18n("Locks the current sessions and starts the screen saver")));
}
Plasma::RunnerSyntax rebootSyntax(i18nc("restart computer command", "restart"), i18n("Reboots the computer"));
rebootSyntax.addExampleQuery(i18nc("restart computer command", "reboot"));
addSyntax(rebootSyntax);
m_triggerWord = i18nc("switch user command", "switch");
addSyntax(Plasma::RunnerSyntax(i18nc("switch user command", "switch :q:"),
i18n("Switches to the active session for the user :q:, "
"or lists all active sessions if :q: is not provided")));
Plasma::RunnerSyntax fastUserSwitchSyntax(i18n("switch user"),
i18n("Starts a new session as a different user"));
fastUserSwitchSyntax.addExampleQuery(i18n("new session"));
addSyntax(fastUserSwitchSyntax);
//"SESSIONS" should not be translated; it's used programmaticaly
setDefaultSyntax(Plasma::RunnerSyntax(QStringLiteral("SESSIONS"), i18n("Lists all sessions")));
}
开发者ID:KDE,项目名称:plasma-workspace,代码行数:39,代码来源:sessionrunner.cpp
示例20: initializeSecond
virtual void initializeSecond()
{
SpatiocyteProcess::initializeSecond();
for(unsigned int i(0); i != theProcessSpecies.size(); ++i)
{
if(InContact)
{
theProcessSpecies[i]->setIsInContact();
}
if(Centered)
{
theProcessSpecies[i]->setIsCentered();
}
}
timePointCnt = 0;
logCnt = 0;
exposureCnt = 0;
if(!getPriority())
{
setPriority(-10);
}
}
开发者ID:ecell,项目名称:spatiocyte,代码行数:22,代码来源:IteratingLogProcess.hpp
注:本文中的setPriority函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论