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