summaryrefslogtreecommitdiffstats
path: root/src/core/services/qservicelocator.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-06-29 20:32:37 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-06-29 20:32:37 +0200
commit57e982442a4df1fd3a4fd063964aeb3895ae3e12 (patch)
tree55ee517c952eb299c5f41baf629f62bf231ea3f1 /src/core/services/qservicelocator.cpp
parent8f58119cd18d69fac28528f0a7536cb9fccc15e3 (diff)
parentcdd39567c3b0bd0f9440dead548954d5230a611f (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: .qmake.conf src/render/defaults/qforwardrenderer.cpp src/render/doc/qt3drender.qdocconf Change-Id: I1c4a15d2b57980dca82fa420ab6ef8c48c049a2c
Diffstat (limited to 'src/core/services/qservicelocator.cpp')
-rw-r--r--src/core/services/qservicelocator.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/services/qservicelocator.cpp b/src/core/services/qservicelocator.cpp
index 3d7dfad4f..6436f7b72 100644
--- a/src/core/services/qservicelocator.cpp
+++ b/src/core/services/qservicelocator.cpp
@@ -37,6 +37,7 @@
#include "qservicelocator.h"
#include "qabstractserviceprovider_p.h"
#include "nullservices_p.h"
+#include "qtickclockservice.h"
#include <QHash>
QT_BEGIN_NAMESPACE
@@ -86,6 +87,7 @@ public:
NullSystemInformationService m_nullSystemInfo;
NullOpenGLInformationService m_nullOpenGLInfo;
+ QTickClockService m_defaultFrameAdvanceService;
int m_nonNullDefaultServices;
};
@@ -198,6 +200,17 @@ QOpenGLInformationService *QServiceLocator::openGLInformation()
}
/*!
+ Returns a pointer to a provider for the frame advance service. If no provider
+ has been explicitly registered for this service type, then a pointer to a simple timer-based
+ service is returned.
+*/
+QAbstractFrameAdvanceService *QServiceLocator::frameAdvanceService()
+{
+ Q_D(QServiceLocator);
+ return static_cast<QAbstractFrameAdvanceService *>(d->m_services.value(FrameAdvanceService, &d->m_defaultFrameAdvanceService));
+}
+
+/*!
\internal
*/
QAbstractServiceProvider *QServiceLocator::_q_getServiceHelper(int type)
@@ -208,7 +221,8 @@ QAbstractServiceProvider *QServiceLocator::_q_getServiceHelper(int type)
return systemInformation();
case OpenGLInformation:
return openGLInformation();
-
+ case FrameAdvanceService:
+ return frameAdvanceService();
default:
return d->m_services.value(type, Q_NULLPTR);
}