35 static const int s_numMessagesPerBatch = 1000;
37 QQmlAbstractProfilerAdapter(QObject *parent =
nullptr) : QObject(parent) {}
38 ~QQmlAbstractProfilerAdapter() override
40 QThread *currentThread = QThread::currentThread();
41 QThread *mainThread = thread();
42 if (currentThread != mainThread) {
43 qFatal(
"Qml debugging framework was cleaned up from wrong thread. Did you leak your "
47 void setService(QQmlProfilerService *new_service) { service = new_service; }
49 virtual qint64 sendMessages(qint64 until, QList<QByteArray> &messages) = 0;
51 void startProfiling(quint64 features);
55 void reportData() { Q_EMIT dataRequested(); }
57 void stopWaiting() { waiting =
false; }
58 void startWaiting() { waiting =
true; }
60 bool isRunning()
const {
return running; }
61 quint64 features()
const {
return featuresEnabled; }
63 void synchronize(
const QElapsedTimer &t) { Q_EMIT referenceTimeKnown(t); }
66 void profilingEnabled(quint64 features);
67 void profilingEnabledWhileWaiting(quint64 features);
69 void profilingDisabled();
70 void profilingDisabledWhileWaiting();
73 void referenceTimeKnown(
const QElapsedTimer &timer);
76 QQmlProfilerService *service =
nullptr;
79 quint64 featuresEnabled = 0;