Qt 4.8
Public Functions | Static Private Functions | List of all members
QWaylandNativeInterface Class Reference

#include <qwaylandnativeinterface.h>

Inheritance diagram for QWaylandNativeInterface:
QPlatformNativeInterface

Public Functions

void * nativeResourceForWidget (const QByteArray &resourceString, QWidget *widget)
 

Static Private Functions

static QWaylandScreenqPlatformScreenForWidget (QWidget *widget)
 

Detailed Description

Definition at line 49 of file qwaylandnativeinterface.h.

Functions

◆ nativeResourceForWidget()

void * QWaylandNativeInterface::nativeResourceForWidget ( const QByteArray resourceString,
QWidget widget 
)
virtual

Reimplemented from QPlatformNativeInterface.

Definition at line 48 of file qwaylandnativeinterface.cpp.

49 {
50  QByteArray lowerCaseResource = resourceString.toLower();
51 
52  if (lowerCaseResource == "display")
53  return qPlatformScreenForWidget(widget)->display()->wl_display();
54  if (lowerCaseResource == "surface") {
55  return ((QWaylandWindow *) widget->platformWindow())->wl_surface();
56  }
57 
58  return NULL;
59 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QByteArray toLower() const
Returns a lowercase copy of the byte array.
QWaylandDisplay * display() const
static QWaylandScreen * qPlatformScreenForWidget(QWidget *widget)
struct wl_display * wl_display() const

◆ qPlatformScreenForWidget()

QWaylandScreen * QWaylandNativeInterface::qPlatformScreenForWidget ( QWidget widget)
staticprivate

Definition at line 62 of file qwaylandnativeinterface.cpp.

Referenced by nativeResourceForWidget().

63 {
64  QWaylandScreen *screen;
65 
66  if (widget) {
67  screen = static_cast<QWaylandScreen *>(QPlatformScreen::platformScreenForWidget(widget));
68  } else {
69  screen = static_cast<QWaylandScreen *>(QApplicationPrivate::platformIntegration()->screens()[0]);
70  }
71  return screen;
72 }
static QPlatformScreen * platformScreenForWidget(const QWidget *widget)

The documentation for this class was generated from the following files: