[英]bitbake meta-toolchain-qt5 failed, cannot satisfy x11 although feature was removed
[英]How to get Screens DPI by Qt application in Linux framebuffer mode(without X11)
目前我正在使用 buildroot 構建的嵌入式 Linux 中運行 Qt 和 QML 應用程序。 GUI 在屏幕上顯示良好。 應用程序以幀緩沖模式運行,Linux 中不存在 X11。
我想知道應用程序中屏幕的 DPI。
我使用下面的 Qt API 來獲取 DPI
qreal screenDPI = QApplication::primaryScreen()->physicalDotsPerInch();
qDebug() << "***************screenDPI***************" << screenDPI;
上面的輸出是
***************screenDPI***************inf
它沒有獲取所需的 DPI 值。
屏幕尺寸 800*480。
相同的 API 在 Ubuntu Linux 18.04 和 Windows 中運行良好。
physicalDotsPerInch未按預期工作。
是否有任何替代 API 可用於在以幀緩沖模式運行的嵌入式 Linux 中獲取屏幕的 DPI。
是否有可能獲得 QApplication::primaryScreen()->physicalSize? 如果是這樣,您可以使用窗口的幾何形狀自己計算 DPI。
你在使用什么設備? 輸出是什么:制造商型號名稱
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.