34 static const int s_numMessagesPerBatch = 1000;
36 QQmlAbstractProfilerAdapter(QObject *parent =
nullptr) : QObject(parent) {}
37 ~QQmlAbstractProfilerAdapter() override
39 QThread *currentThread = QThread::currentThread();
40 QThread *mainThread = thread();
41 if (currentThread != mainThread) {
42 qFatal(
"Qml debugging framework was cleaned up from wrong thread. Did you leak your "
46 void setService(QQmlProfilerService *new_service) { service = new_service; }
48 virtual qint64 sendMessages(qint64 until, QList<QByteArray> &messages) = 0;
50 void startProfiling(quint64 features);
54 void reportData() { Q_EMIT dataRequested(); }
56 void stopWaiting() { waiting =
false; }
57 void startWaiting() { waiting =
true; }
59 bool isRunning()
const {
return running; }
60 quint64 features()
const {
return featuresEnabled; }
62 void synchronize(
const QElapsedTimer &t) { Q_EMIT referenceTimeKnown(t); }
65 void profilingEnabled(quint64 features);
66 void profilingEnabledWhileWaiting(quint64 features);
68 void profilingDisabled();
69 void profilingDisabledWhileWaiting();
72 void referenceTimeKnown(
const QElapsedTimer &timer);
75 QQmlProfilerService *service =
nullptr;
78 quint64 featuresEnabled = 0;