  
  static QTreeWidgetItem *get_gl_info_egl_qt(QTreeWidgetItem *l1, QTreeWidgetItem *after, QSurfaceFormat::OpenGLContextProfile profile, const QString &title)
  {
-@@ -894,7 +899,9 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
+@@ -899,7 +904,9 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
  {
-     QTreeWidgetItem *l1, *l2 = NULL;
+     QTreeWidgetItem *l1, *l2 = nullptr;
  
 +#if HAVE_X11
      static bool isX11 = QGuiApplication::platformName() == QStringLiteral("xcb");

 static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetItem *l1, QTreeWidgetItem *after)
 {
    Window win;
@@ -847,6 +851,7 @@ static QTreeWidgetItem *get_gl_info_egl(Display *dpy, int scrnum, QTreeWidgetIte
    return result;
 
 }

     static bool isWayland = QGuiApplication::platformName().contains(QStringLiteral("wayland"));
 
     QTreeWidgetItem *header = new QTreeWidgetItem();
@@ -911,6 +918,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
 
     l1 = new QTreeWidgetItem(treeWidget);
 
+#if HAVE_X11
     if (isX11) {
         char *displayName = nullptr;
         Display *dpy;
@@ -939,7 +947,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
             l2 = get_gl_info_glx(dpy, scrnum, true, l1, l2);
             if (l2) l2->setExpanded(true);
 #endif
-#if KCM_HAVE_EGL
+#if KCM_HAVE_EGL && HAVE_X11
             l2 = get_gl_info_egl(dpy, scrnum, l1, l2);
             if (l2)
                 l2->setExpanded(true);
@@ -956,6 +964,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
 #endif
         XCloseDisplay(dpy);
     }
