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


C++ QElapsedTimer::invalidate方法代码示例

本文整理汇总了C++中QElapsedTimer::invalidate方法的典型用法代码示例。如果您正苦于以下问题:C++ QElapsedTimer::invalidate方法的具体用法?C++ QElapsedTimer::invalidate怎么用?C++ QElapsedTimer::invalidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QElapsedTimer的用法示例。


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

示例1: validity

void tst_QElapsedTimer::validity()
{
    QElapsedTimer t;

    QVERIFY(!t.isValid()); // non-POD now, it should always start invalid

    t.start();
    QVERIFY(t.isValid());

    t.invalidate();
    QVERIFY(!t.isValid());
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:12,代码来源:tst_qelapsedtimer.cpp

示例2: AppModelPrivate

 AppModelPrivate() :
         src(NULL),
         nam(NULL),
         ns(NULL),
         fcProp(NULL),
         ready(false),
         useGps(true),
         nErrors(0),
         minMsBeforeNewRequest(baseMsBeforeNewRequest)
 {
     delayedCityRequestTimer.setSingleShot(true);
     delayedCityRequestTimer.setInterval(1000); // 1 s
     requestNewWeatherTimer.setSingleShot(false);
     requestNewWeatherTimer.setInterval(20*60*1000); // 20 min
     throttle.invalidate();
 }
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:16,代码来源:appmodel.cpp

示例3: render

void QSGDefaultRenderer::render()
{
#if defined (QML_RUNTIME_TESTING)
    static bool dumpTree = qApp->arguments().contains(QLatin1String("--dump-tree"));
    if (dumpTree) {
        printf("\n\n");
        QSGNodeDumper::dump(rootNode());
    }
#endif

#ifdef RENDERER_DEBUG
    debugTimer.invalidate();
    debugTimer.start();
    geometryNodesDrawn = 0;
    materialChanges = 0;
#endif

    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    glDisable(GL_BLEND);

    glFrontFace(isMirrored() ? GL_CW : GL_CCW);
    glDisable(GL_CULL_FACE);

    glEnable(GL_DEPTH_TEST);
    glDepthMask(true);
    glDepthFunc(GL_GREATER);
#if defined(QT_OPENGL_ES)
    glClearDepthf(0);
#else
    glClearDepth(0);
#endif

    glDisable(GL_SCISSOR_TEST);
    glClearColor(m_clear_color.redF(), m_clear_color.greenF(), m_clear_color.blueF(), m_clear_color.alphaF());

#ifdef RENDERER_DEBUG
    int debugtimeSetup = debugTimer.elapsed();
#endif

    bindable()->clear(clearMode());

#ifdef RENDERER_DEBUG
    int debugtimeClear = debugTimer.elapsed();
#endif

    QRect r = viewportRect();
    glViewport(r.x(), deviceRect().bottom() - r.bottom(), r.width(), r.height());
    m_current_projection_matrix = projectionMatrix();
    m_current_model_view_matrix.setToIdentity();

    m_currentClip = 0;
    glDisable(GL_STENCIL_TEST);

    m_currentMaterial = 0;
    m_currentProgram = 0;
    m_currentMatrix = 0;

    if (m_rebuild_lists) {
        m_opaqueNodes.reset();
        m_transparentNodes.reset();
        m_currentRenderOrder = 1;
        buildLists(rootNode());
        m_rebuild_lists = false;
    }

#ifdef RENDERER_DEBUG
    int debugtimeLists = debugTimer.elapsed();
#endif


    if (m_needs_sorting) {
        if (!m_opaqueNodes.isEmpty()) {
            qSort(&m_opaqueNodes.first(), &m_opaqueNodes.first() + m_opaqueNodes.size(),
                  m_sort_front_to_back
                  ? nodeLessThanWithRenderOrder
                  : nodeLessThan);
        }
        m_needs_sorting = false;
    }

#ifdef RENDERER_DEBUG
    int debugtimeSorting = debugTimer.elapsed();
#endif

    m_renderOrderMatrix.setToIdentity();
    m_renderOrderMatrix.scale(1, 1, qreal(1) / m_currentRenderOrder);

    glDisable(GL_BLEND);
    glDepthMask(true);
#ifdef QML_RUNTIME_TESTING
    if (m_render_opaque_nodes)
#endif
    {
#if defined (QML_RUNTIME_TESTING)
        if (dumpTree)
            qDebug() << "Opaque Nodes:";
#endif
        renderNodes(m_opaqueNodes);
    }

//.........这里部分代码省略.........
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:101,代码来源:qsgdefaultrenderer.cpp

示例4: doInit


//.........这里部分代码省略.........
			
		const QByteArray toolHash(checksum.toLatin1());
		if(toolHash.size() != 96)
		{
			qFatal("The checksum for \"%s\" has an invalid size!", MUTILS_UTF8(toolName));
			return -1.0;
		}
			
		QResource *resource = new QResource(QString(":/tools/%1").arg(toolName));
		if(!(resource->isValid() && resource->data()))
		{
			MUTILS_DELETE(resource);
			qFatal("The resource for \"%s\" could not be found!", MUTILS_UTF8(toolName));
			return -1.0;
		}
			
		if(cpuType & cpuSupport)
		{
			pool->start(new ExtractorTask(resource, appDir, toolName, toolHash, version, versInfo));
			continue;
		}

		MUTILS_DELETE(resource);
	}

	//Sanity Check
	if(!(queueToolName.isEmpty() && queueChecksum.isEmpty() && queueVersInfo.isEmpty() && queueCpuTypes.isEmpty() && queueVersions.isEmpty()))
	{
		qFatal("Checksum queues *not* empty fater verification completed. Take care!");
	}

	//Wait for extrator threads to finish
	pool->waitForDone();

	//Performance measure
	const double delayExtract = double(timeExtractStart.elapsed()) / 1000.0;
	timeExtractStart.invalidate();

	//Make sure all files were extracted correctly
	if(ExtractorTask::getExcept())
	{
		char errorMsg[BUFF_SIZE];
		if(ExtractorTask::getErrMsg(errorMsg, BUFF_SIZE))
		{
			qFatal("At least one of the required tools could not be initialized:\n%s", errorMsg);
			return -1.0;
		}
		qFatal("At least one of the required tools could not be initialized!");
		return -1.0;
	}

	qDebug("All extracted.\n");

	//Using any custom tools?
	if(ExtractorTask::getCustom())
	{
		qWarning("Warning: Using custom tools, you might encounter unexpected problems!\n");
	}

	//Check delay
	if(delayExtract > g_allowedExtractDelay)
	{
		m_slowIndicator = true;
		qWarning("Extracting tools took %.3f seconds -> probably slow realtime virus scanner.", delayExtract);
		qWarning("Please report performance problems to your anti-virus developer !!!\n");
	}
	else
	{
		qDebug("Extracting the tools took %.3f seconds (OK).\n", delayExtract);
	}

	//Register all translations
	initTranslations();

	//Look for AAC encoders
	InitAacEncTask::clearFlags();
	for(size_t i = 0; g_lamexp_aacenc[i].toolName; i++)
	{
		pool->start(new InitAacEncTask(&(g_lamexp_aacenc[i])));
	}
	pool->waitForDone();

	//Make sure initialization finished correctly
	if(InitAacEncTask::getExcept())
	{
		char errorMsg[BUFF_SIZE];
		if(InitAacEncTask::getErrMsg(errorMsg, BUFF_SIZE))
		{
			qFatal("At least one optional component failed to initialize:\n%s", errorMsg);
			return -1.0;
		}
		qFatal("At least one optional component failed to initialize!");
		return -1.0;
	}

	m_bSuccess = true;
	delay();

	return delayExtract;
}
开发者ID:wyrover,项目名称:LameXP,代码行数:101,代码来源:Thread_Initialization.cpp


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