我使用official installation guide安装了Qt for Embedded Linux(Qt 4.8.5)。但是,当我在QtCreator 3.0.1中运行任何已安装的示例时,我收到以下错误:
QWSSocket::connectToLocalFile could not connect:: Connection refused
No Qt for Embedded Linux server appears to be running.
If you want to run this program as a server,
add the "-qws" command-line option.
如果我使用-qws
选项运行,我会得到:
QScreenLinuxFb::connect: Permission denied Error opening framebuffer
/dev/fb0 The program has unexpectedly finished.
从Google搜索结果中,我可以看到它与权限设置有关,可能与帧缓冲设备(/ dev / fb0)有关。以下是我的ubuntu 12.04 LTS系统上ls -al /dev/fb0
的输出:
$ ls -al /dev/fb0
crw-rw---- 1 root video 29, 0 Apr 21 22:43 /dev/fb0
我已将当前登录的用户添加到video
所属的/dev/fb0
组。我仍然收到permission denied
错误。
如果我使用/examples/qws/framebuffer
运行sudo
示例,我会得到以下输出:
The framebuffer device was opened successfully.
Fixed screen info:
id: inteldrmfb
smem_start: 0xc0073000
smem_len: 5763072
type: 0
type_aux: 0
visual: 2
xpanstep: 1
ypanstep: 1
ywrapstep: 0
line_length: 6400
mmio_start: 0x0
mmio_len: 0
accel: 0
The framebuffer device was mapped to memory successfully.
Was in graphics mode already. Skipping
Variable screen info:
xres: 1600
yres: 900
xres_virtual: 1600
yres_virtual: 900
yoffset: 0
xoffset: 0
bits_per_pixel: 32
grayscale: 0
red: offset: 16, length: 8, msb_right: 0
green: offset: 8, length: 8, msb_right: 0
blue: offset: 0, length: 8, msb_right: 0
transp: offset: 0, length: 0, msb_right: 0
nonstd: 0
activate: 0
height: -1
width: -1
accel_flags: 0x1
pixclock: 0
left_margin: 0
right_margin: 0
upper_margin: 0
lower_margin: 0
hsync_len: 0
vsync_len: 0
sync: 0
vmode: 0
Frame Buffer Performance test...
Average: 916 usecs
Bandwidth: 6000.102 MByte/Sec
Max. FPS: 1091.703 fps
Will draw 3 rectangles on the screen,
they should be colored red, green and blue (in that order).
Done.
但是,我在屏幕上看不到3个矩形。
有人可以帮助概述如何在Ubuntu桌面环境中运行这些Qt for Embedded Linux(Qt 4.8.5)示例吗?
答案 0 :(得分:0)
我也只使用12.04系统但使用Qt 4.6.1。 我遇到了和你一样的问题,发现当我从控制台(Ctrl + Alt + F1)终端运行-qws时,可以看到GUI。 当从GUI终端或Qt Creator运行时,虽然显示了窗口,但操作系统的GUI(X11)在屏幕刷新期间用其内容覆盖屏幕。
如果您希望能够从Qt Creator或GUI OS运行Qt GUI应用程序, qvfb 需要在后台运行。 此链接会提供以下信息:http://qt-project.org/doc/qt-4.8/qvfb.html
希望这有帮助!