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


C++ Doc类代码示例

本文整理汇总了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);
}
开发者ID:bekiS,项目名称:qlcplus,代码行数:12,代码来源:collection.cpp

示例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();
}
开发者ID:exmatrikulator,项目名称:qlcplus,代码行数:52,代码来源:mastertimer.cpp

示例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;
}
开发者ID:KDE,项目名称:calligra-history,代码行数:13,代码来源:Factory.cpp

示例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);
}
开发者ID:speakman,项目名称:qlc,代码行数:13,代码来源:chaser.cpp

示例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();
}
开发者ID:DDMAL,项目名称:verovio,代码行数:13,代码来源:page.cpp

示例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));
}
开发者ID:Jens1970,项目名称:sumatrapdf,代码行数:14,代码来源:EbookController.cpp

示例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);
  }
}
开发者ID:imeteora,项目名称:aseprite,代码行数:14,代码来源:set_mask.cpp

示例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();
    }
}
开发者ID:bekiS,项目名称:qlcplus,代码行数:15,代码来源:collection.cpp

示例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();
}
开发者ID:Unknownly,项目名称:qlcplus,代码行数:15,代码来源:mastertimer.cpp

示例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);
}
开发者ID:bertilxi,项目名称:Pegaso,代码行数:19,代码来源:GestorUsuarios.cpp

示例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;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:16,代码来源:chaser.cpp

示例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);
}
开发者ID:imeteora,项目名称:aseprite,代码行数:16,代码来源:set_pixel_format.cpp

示例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));
}
开发者ID:Erls-Corporation,项目名称:SumatraPDF-2.2.1,代码行数:16,代码来源:EbookController.cpp

示例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));
   });
 }
开发者ID:milchakov,项目名称:omim,代码行数:7,代码来源:mem_search_index.hpp

示例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;
  }
开发者ID:jiyfeng,项目名称:drlm,代码行数:37,代码来源:hidden.hpp


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