<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[solved] Qt5 linuxfb screen resolution]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I use a Qt5 application with linuxfb. While fbset shows 1366x768, the size of window seems to be 640x480.</p>
<p dir="auto">fbset shows:</p>
<p dir="auto">mode "1366x768"<br />
geometry 1366 768 1366 768 32<br />
timings 0 0 0 0 0 0 0<br />
accel true<br />
rgba 8/16,8/8,8/0,0/0<br />
endmode</p>
<p dir="auto">The application is build from:</p>
<p dir="auto">main.cpp:<br />
@<br />
#include &lt;QtGui&gt;<br />
#include &lt;QApplication&gt;<br />
#include &lt;QPushButton&gt;<br />
#include "MainWindow.h"</p>
<p dir="auto">int main(int argc, char **argv) {</p>
<p dir="auto">QApplication app(argc,argv);</p>
<p dir="auto">MainWindow mwin;<br />
mwin.show();</p>
<p dir="auto">return app.exec();<br />
}<br />
@</p>
<p dir="auto">MainWindow.h:<br />
@<br />
#ifndef MAINWINDOW_H<br />
#define MAINWINDOW_H</p>
<p dir="auto">#include &lt;QMainWindow&gt;<br />
#include &lt;QPushButton&gt;</p>
<p dir="auto">class MainWindow : public QMainWindow {</p>
<p dir="auto">Q_OBJECT</p>
<p dir="auto">public:<br />
MainWindow();</p>
<p dir="auto">public slots:<br />
void test();</p>
<p dir="auto">private:<br />
QPushButton *but=0;<br />
};</p>
<p dir="auto">#endif<br />
@</p>
<p dir="auto">MainWindow.cpp:<br />
@<br />
#include &lt;iostream&gt;<br />
#include &lt;QDebug&gt;<br />
#include &lt;QScreen&gt;<br />
#include &lt;QVBoxLayout&gt;<br />
#include "MainWindow.h"</p>
<p dir="auto">MainWindow::MainWindow() {</p>
<pre><code>    but = new QPushButton("Test");
    connect(but,SIGNAL(clicked()),this,SLOT(close()));
    connect(but,SIGNAL(clicked()),this,SLOT(test()));

    setCentralWidget(but);


    setFixedSize(1366,768);

    showFullScreen();       
</code></pre>
<p dir="auto">}</p>
<p dir="auto">void MainWindow::test() {</p>
<pre><code>    QRect r = geometry();
    std::cout &lt;&lt; r.x() &lt;&lt; std::endl;
    std::cout &lt;&lt; r.y() &lt;&lt; std::endl;
    std::cout &lt;&lt; r.width() &lt;&lt; std::endl;
    std::cout &lt;&lt; r.height() &lt;&lt; std::endl;

    std::cout &lt;&lt; "test2" &lt;&lt; std::endl;
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">and run with:</p>
<p dir="auto">@<br />
./qttest -platform linuxfb:fb=/dev/fb0:size=1366x768 -plugin evdevkeyboard -plugin evdevmouse -plugin evdevtouch<br />
@</p>
<p dir="auto">The application runs in fullscreen (fills the whole screen) but,<br />
result of cout is:<br />
0<br />
0<br />
640<br />
480</p>
<p dir="auto">I would expect 1366x768...</p>
<p dir="auto">Thanks for help and hints.</p>
<hr />
<p dir="auto">Strange ... works now...</p>
<p dir="auto"><em>[edit: added missing coding tags @ SGaist]</em></p>
]]></description><link>https://forum.qt.io/topic/45616/solved-qt5-linuxfb-screen-resolution</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 16:59:59 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/45616.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Sep 2014 17:48:25 GMT</pubDate><ttl>60</ttl></channel></rss>