Skip to content

Commit

Permalink
[Sizing] Try to use phisical size from QScreen if we not use enveroment
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Dec 16, 2019
1 parent d64f1e8 commit ed57c9e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/controls/sizing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ Sizing::Sizing(QObject *parent) : QObject(parent)

QScreen *screen = QGuiApplication::primaryScreen();

/*If we dont have everoment of physical size try get it from screen*/
if(m_p_height == 0 || m_p_width == 0) {
qWarning("QT_QPA_EGLFS_PHYSICAL_WIDTH or QT_QPA_EGLFS_PHYSICAL_HEIGHT is not set! \n"
"Trying to use QScreenSize");
QSizeF p_size = screen->physicalSize();
m_p_height = p_size.height();
m_p_width = p_size.width();
qInfo() << "Set size to " << m_p_height << " x " << m_p_width;
}

m_height = qMax(screen->size().width(), screen->size().height());
m_width = qMin(screen->size().width(), screen->size().height());
Expand Down

0 comments on commit ed57c9e

Please sign in to comment.