本文整理汇总了C++中Doc类的典型用法代码示例。如果您正苦于以下问题:C++ Doc类的具体用法?C++ Doc怎么用?C++ Doc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Doc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotChildStopped
void Collection::slotChildStopped(quint32 fid)
{
Doc* doc = qobject_cast <Doc*> (parent());
Q_ASSERT(doc != NULL);
Function* function = doc->function(fid);
disconnect(function, SIGNAL(stopped(quint32)),
this, SLOT(slotChildStopped(quint32)));
QMutexLocker locker(&m_functionListMutex);
m_runningChildren.remove(fid);
}
示例2: timerTick
void MasterTimer::timerTick()
{
Doc *doc = qobject_cast<Doc*> (parent());
Q_ASSERT(doc != NULL);
#ifdef DEBUG_MASTERTIMER
qDebug() << "[MasterTimer] *********** tick:" << ticksCount++ << "**********";
#endif
switch (m_beatSourceType)
{
case Internal:
{
int elapsedTime = qRound((double)m_beatTimer->nsecsElapsed() / 1000000) + m_lastBeatOffset;
//qDebug() << "Elapsed beat:" << elapsedTime;
if (elapsedTime >= m_beatTimeDuration)
{
// it's time to fire a beat
m_beatRequested = true;
// restart the time for the next beat, starting at a delta
// milliseconds, otherwise it will generate an unpleasant drift
//qDebug() << "Elapsed:" << elapsedTime << ", delta:" << elapsedTime - m_beatTimeDuration;
m_lastBeatOffset = elapsedTime - m_beatTimeDuration;
m_beatTimer->restart();
// inform the listening classes that a beat is happening
emit beat();
}
}
break;
case External:
break;
case None:
default:
m_beatRequested = false;
break;
}
QList<Universe *> universes = doc->inputOutputMap()->claimUniverses();
timerTickFunctions(universes);
timerTickDMXSources(universes);
doc->inputOutputMap()->releaseUniverses();
m_beatRequested = false;
//qDebug() << ">>>>>>>> MASTERTIMER TICK";
emit tickReady();
}
示例3: Q_UNUSED
QObject* Factory::create(const char* iface, QWidget* parentWidget, QObject *parent, const QVariantList& args, const QString& keyword)
{
Q_UNUSED(args);
Q_UNUSED(keyword);
bool bWantKoDocument = (strcmp(iface, "KoDocument") == 0);
Doc *doc = new Doc(parentWidget, parent, !bWantKoDocument);
if (!bWantKoDocument)
doc->setReadWrite(false);
return doc;
}
示例4: stopMemberAt
void Chaser::stopMemberAt(int index)
{
Doc* doc = qobject_cast <Doc*> (parent());
Q_ASSERT(doc != NULL);
t_function_id fid = m_steps.at(index);
Q_ASSERT(fid != Function::invalidId());
Function* function = doc->function(fid);
Q_ASSERT(function != NULL);
function->stop(m_masterTimer);
}
示例5: assert
int Page::GetContentHeight() const
{
Doc *doc = dynamic_cast<Doc *>(GetParent());
assert(doc);
// Doc::SetDrawingPage should have been called before
// Make sure we have the correct page
assert(this == doc->GetDrawingPage());
System *last = dynamic_cast<System *>(m_children.back());
assert(last);
return doc->m_drawingPageHeight - doc->m_drawingPageTopMar - last->GetDrawingYRel() + last->GetHeight();
}
示例6: t
void ThreadLoadEbook::Run()
{
//lf(L"ThreadLoadEbook::Run(%s)", fileName);
Timer t(true);
Doc doc = Doc::CreateFromFile(fileName);
double loadingTimeMs = t.GetTimeInMs();
//lf(L"Loaded %s in %.2f ms", fileName, t.GetTimeInMs());
// don't load PalmDoc, etc. files as long as they're not correctly formatted
if (doc.AsMobi() && Pdb_Mobipocket != doc.AsMobi()->GetDocType())
doc.Delete();
uitask::Post(new FinishedEbookLoadingTask(win, doc));
}
示例7: document
void SetMask::setMask(Mask* mask)
{
Doc* doc = document();
if (mask) {
doc->setMask(mask);
doc->setMaskVisible(!mask->isEmpty());
}
else {
Mask empty;
doc->setMask(&empty);
doc->setMaskVisible(false);
}
}
示例8: postLoad
void Collection::postLoad()
{
Doc* doc = qobject_cast <Doc*> (parent());
Q_ASSERT(doc != NULL);
/* Check that all member functions exist (nonexistent functions can
be present only when a corrupted file has been loaded) */
QMutableListIterator<quint32> it(m_functions);
while (it.hasNext() == true)
{
/* Remove any nonexistent member functions */
if (doc->function(it.next()) == NULL)
it.remove();
}
}
示例9: timerTick
void MasterTimer::timerTick()
{
Doc* doc = qobject_cast<Doc*> (parent());
Q_ASSERT(doc != NULL);
UniverseArray* universes = doc->outputMap()->claimUniverses();
universes->zeroIntensityChannels();
timerTickFunctions(universes);
timerTickDMXSources(universes);
timerTickFader(universes);
doc->outputMap()->releaseUniverses();
doc->outputMap()->dumpUniverses();
}
示例10: Doc
/**
* @param usuario
* @param datos
*/
void GestorUsuarios::modUsuario(Usuario *usuario, DtoUsuario *datos) {
usuario->setNombre(datos->nombre);
usuario->setApellido(datos->apellido);
Doc* doc = new Doc();
doc->setTipo(datos->tipoDni);
usuario->setDoc(doc);
usuario->setNro_doc(datos->numeroDni);
Localidad* localidad = new Localidad();
localidad->setNombre(datos->localidad);
usuario->setLocalidad(localidad);
//El caso de uso no contempla la posibilidad de modificar la contraseña
//Guardo los cambios
gestorDB->saveUsuario(usuario);
}
示例11: it
QList <Function*> Chaser::stepFunctions() const
{
Doc* doc = qobject_cast<Doc*> (parent());
Q_ASSERT(doc != NULL);
QList <Function*> list;
QListIterator <t_function_id> it(m_steps);
while (it.hasNext() == true)
{
Function* function = doc->function(it.next());
if (function != NULL)
list << function;
}
return list;
}
示例12: ev
void SetPixelFormat::setFormat(PixelFormat format)
{
Sprite* sprite = this->sprite();
sprite->setPixelFormat(format);
sprite->incrementVersion();
// Regenerate extras
Doc* doc = static_cast<Doc*>(sprite->document());
doc->setExtraCel(ExtraCelRef(nullptr));
// Generate notification
DocEvent ev(doc);
ev.sprite(sprite);
doc->notify_observers<DocEvent&>(&DocObserver::onPixelFormatChanged, ev);
}
示例13: t
void ThreadLoadEbook::Run()
{
//lf(L"ThreadLoadEbook::Run(%s)", fileName);
Timer t(true);
Doc doc = Doc::CreateFromFile(fileName);
// TODO: even under heavy load, Doc::CreateFromFile doesn't take more
// than 50ms - any reason not to synchronously load ebooks?
double loadingTimeMs = t.GetTimeInMs();
lf(L"Loaded %s in %.2f ms", fileName, loadingTimeMs);
// don't load PalmDoc, etc. files as long as they're not correctly formatted
if (doc.AsMobi() && Pdb_Mobipocket != doc.AsMobi()->GetDocType())
doc.Delete();
uitask::Post(new FinishedEbookLoadingTask(win, doc));
}
示例14: ForEachToken
void ForEachToken(Id const & id, Doc const & doc, Fn && fn)
{
doc.ForEachToken([&](int8_t lang, Token const & token) {
if (lang >= 0)
fn(AddLang(lang, token));
});
}
示例15: DecodeGraph
/*********************************************
* Sample particles for a given document
*
* doc:
*********************************************/
LatentSeq DecodeGraph(const Doc doc){
// ----------------------------------------
// init
int nsent = doc.size();
LatentSeq latseq;
// ----------------------------------------
// for each sentence in doc, each latval, compute
// the posterior prob p(R|cvec, sent)
vector<float> U;
for (unsigned sidx = 0; sidx < nsent; sidx ++){
final_hlist.clear();
for (int val = 0; val < nlatvar; val ++){
ComputationGraph cg;
BuildSentGraph(doc[sidx], sidx, cg, val);
float prob = as_scalar(cg.forward());
U.push_back(prob);
cg.clear();
}
// normalize and get the argmax
log_normalize(U);
// greedy decoding
int max_idx = argmax(U);
// get the corresponding context vector
final_h = final_hlist[max_idx];
//
U.clear();
// cerr << "max_latval = " << max_idx << endl;
latseq.push_back(max_idx);
}
// cerr << "====" << endl;
return latseq;
}