search

Home  >  Q&A  >  body text

c++ - 如何指定树莓派上QT图形输出的设备?

我想用一块tft屏幕连接在树莓派上显示一些运行相关的数据,目前会一些QT程序的开发。我想问下,在不跑桌面(startx,因为没有那么多资源给它用)的情况下能直接通过ssh启动程序使屏幕上直接显示qt的界面吗?
我在网上看到linux有个缓冲帧流fb*的东西,不知道能不能让qt直接把图形数据给他写入到那里边。。。。。

PHP中文网PHP中文网2784 days ago791

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 13:36:47

    Answer for yourself
    It has been solved. Qt supports direct output to the Framebuffer device. Just set it in the environment variable

    QT_QPA_PLATFORM=linuxfb:/dev/fb*

    That’s it, then just pay attention to the resolution when developing

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:36:47

    If you want to display the qt interface, you must have the x server. Without this startx, the graphical interface should not be displayed. .
    If it is a terminal, it is ok. As long as the system is started and the sshd service is started, the screen will be fine if it is not. Just connect directly with ssh. .

    reply
    0
  • Cancelreply