[solved] Qt5 linuxfb screen resolution



  • Hi,

    I use a Qt5 application with linuxfb. While fbset shows 1366x768, the size of window seems to be 640x480.

    fbset shows:

    mode "1366x768"
    geometry 1366 768 1366 768 32
    timings 0 0 0 0 0 0 0
    accel true
    rgba 8/16,8/8,8/0,0/0
    endmode

    The application is build from:

    main.cpp:
    @
    #include <QtGui>
    #include <QApplication>
    #include <QPushButton>
    #include "MainWindow.h"

    int main(int argc, char **argv) {

    QApplication app(argc,argv);

    MainWindow mwin;
    mwin.show();

    return app.exec();
    }
    @

    MainWindow.h:
    @
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>
    #include <QPushButton>

    class MainWindow : public QMainWindow {

    Q_OBJECT

    public:
    MainWindow();

    public slots:
    void test();

    private:
    QPushButton *but=0;
    };

    #endif
    @

    MainWindow.cpp:
    @
    #include <iostream>
    #include <QDebug>
    #include <QScreen>
    #include <QVBoxLayout>
    #include "MainWindow.h"

    MainWindow::MainWindow() {

        but = new QPushButton("Test");
        connect(but,SIGNAL(clicked()),this,SLOT(close()));
        connect(but,SIGNAL(clicked()),this,SLOT(test()));
    
        setCentralWidget(but);
    
    
        setFixedSize(1366,768);
    
        showFullScreen();       
    

    }

    void MainWindow::test() {

        QRect r = geometry();
        std::cout << r.x() << std::endl;
        std::cout << r.y() << std::endl;
        std::cout << r.width() << std::endl;
        std::cout << r.height() << std::endl;
    
        std::cout << "test2" << std::endl;
    

    }
    @

    and run with:

    @
    ./qttest -platform linuxfb:fb=/dev/fb0:size=1366x768 -plugin evdevkeyboard -plugin evdevmouse -plugin evdevtouch
    @

    The application runs in fullscreen (fills the whole screen) but,
    result of cout is:
    0
    0
    640
    480

    I would expect 1366x768...

    Thanks for help and hints.


    Strange ... works now...

    [edit: added missing coding tags @ SGaist]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.