33DeviceIntegration::DeviceIntegration()
34 : m_integration(
nullptr)
36 QStringList pluginKeys = QEglFSDeviceIntegrationFactory::keys();
37 if (!pluginKeys.isEmpty()) {
39 if (qEnvironmentVariableIsSet(
"DISPLAY")) {
40 const QString x11key = QStringLiteral(
"eglfs_x11");
41 if (pluginKeys.contains(x11key)) {
42 pluginKeys.removeOne(x11key);
43 pluginKeys.prepend(x11key);
46 const QString kmskey = QStringLiteral(
"eglfs_kms");
47 if (pluginKeys.contains(kmskey)) {
48 pluginKeys.removeOne(kmskey);
49 pluginKeys.prepend(kmskey);
54 QString requested = qEnvironmentVariable(
"QT_QPA_EGLFS_INTEGRATION");
55 if (requested.isNull()) {
57#ifdef EGLFS_PREFERRED_PLUGIN
58#define DEFAULT_PLUGIN EGLFS_PREFERRED_PLUGIN
61 requested = QStringLiteral(STRQ(DEFAULT_PLUGIN));
68 if (requested != QStringLiteral(
"none")) {
69 if (!requested.isEmpty()) {
70 pluginKeys.removeOne(requested);
71 pluginKeys.prepend(requested);
73 qCDebug(qLcEglDevDebug) <<
"EGL device integration plugin keys (sorted):" << pluginKeys;
74 while (!m_integration && !pluginKeys.isEmpty()) {
75 QString key = pluginKeys.takeFirst();
76 qCDebug(qLcEglDevDebug) <<
"Trying to load device EGL integration" << key;
77 m_integration = QEglFSDeviceIntegrationFactory::create(key);
85 qCDebug(qLcEglDevDebug) <<
"Using base device integration";
86 m_integration =
new QEglFSDeviceIntegration;