72 const int result = screen_get_display_property_iv(
display, SCREEN_PROPERTY_PHYSICAL_SIZE, val);
74 qFatal(
"QBBScreen: failed to query display physical size, errno=%d",
errno);
75 return QSize(150, 90);
78 if (val[0] > 0 && val[1] > 0)
79 return QSize(val[0], val[1]);
81 qWarning(
"QBBScreen: screen_get_display_property_iv() reported an invalid physical screen size (%dx%d). Falling back to QBB_PHYSICAL_SCREEN_SIZE environment variable.", val[0], val[1]);
86 const int envWidth = envPhySizeStrList.
size() == 2 ? envPhySizeStrList[0].toInt() : -1;
87 const int envHeight = envPhySizeStrList.
size() == 2 ? envPhySizeStrList[1].toInt() : -1;
89 if (envWidth <= 0 || envHeight <= 0) {
90 qFatal(
"QBBScreen: The value of QBB_PHYSICAL_SCREEN_SIZE must be in the format \"width,height\" in mm, with width, height > 0. Example: QBB_PHYSICAL_SCREEN_SIZE=150,90");
91 return QSize(150, 90);
94 return QSize(envWidth, envHeight);
97 #if defined(QBB_PHYSICAL_SCREEN_SIZE_DEFINED) 98 const QSize defSize(QBB_PHYSICAL_SCREEN_WIDTH, QBB_PHYSICAL_SCREEN_HEIGHT);
99 qWarning(
"QBBScreen: QBB_PHYSICAL_SCREEN_SIZE variable not set. Falling back to defines QBB_PHYSICAL_SCREEN_WIDTH/QBB_PHYSICAL_SCREEN_HEIGHT (%dx%d)", defSize.width(), defSize.height());
103 qFatal(
"QBBScreen: QBB_PHYSICAL_SCREEN_SIZE variable not set. Could not determine physical screen size.");
104 return QSize(150, 90);
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QString class provides a Unicode character string.
Q_GUI_EXPORT EGLDisplay display()
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStringList class provides a list of strings.
Q_CORE_EXPORT void qWarning(const char *,...)
Q_CORE_EXPORT void qFatal(const char *,...)
int size() const
Returns the number of items in the list.
The QSize class defines the size of a two-dimensional object using integer point precision.
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.