在Ubuntu系统上禁用Qt跟踪

时间:2013-09-10 21:12:50

标签: c++ qt ubuntu

出于某种原因,无论我从终端启动的基于Qt的应用程序发出了一些我想要禁用的跟踪。

示例:

$> qtcreator
Got bus address:  "unix:abstract=/tmp/dbus-vDsC42Ojkq,guid=dc44d5a0e955ae51a4dbbdc100001ce3" 
Connected to accessibility bus at:  "unix:abstract=/tmp/dbus-vDsC42Ojkq,guid=dc44d5a0e955ae51a4dbbdc100001ce3" 
Registered DEC:  true 
Registered event listener change listener:  true
...
...

有谁知道如何摆脱这些消息? 感谢。

3 个答案:

答案 0 :(得分:2)

感谢Laszlo Papp的评论,我看了一下qt-at-spi设置......

$> locate qt-at-spi
/usr/share/doc/qt-at-spi
/usr/share/doc/qt-at-spi/README
/usr/share/doc/qt-at-spi/changelog.Debian.gz
/usr/share/doc/qt-at-spi/copyright
/var/lib/dpkg/info/qt-at-spi:amd64.list
/var/lib/dpkg/info/qt-at-spi:amd64.md5sums

让我们看一下README文件所说的内容:

$> more /usr/share/doc/qt-at-spi/README
Qt AT-SPI2 bridge
=================

This is a Qt plugin that bridges Qt's accessibility API to AT-SPI2.
With recent versions of AT-SPI2 this should make Qt applications accessible
with the help of tools such as Gnome's Orca screen-reader.

Switch gnome to use at-spi2:
gconftool-2 --set /desktop/gnome/interface/at-spi-dbus --type bool true
gconftool-2 --set /desktop/gnome/interface/at-spi-corba --type bool false

To run gnome apps with at-spi2 in a non-gnome session:
export GTK_MODULES=gail:atk-bridge

Qt will only load this plugin when the environment variable
QT_ACCESSIBILITY is set to 1.

和README说的一样,我的机器上的QT_ACCESSIBILITY环境变量设置为1。

所以解决方案是

  • 删除qt-at-spi模块
    sudo dpkg --purge qt-at-spi
  • 或取消设置此变量,在/etc/X11/Xsession.d/90qt-a11y脚本中设置快速研究后,基于gnome设置
    gsettings set org.gnome.desktop.interface toolkit-accessibility false

谢谢Laszlo!

答案 1 :(得分:1)

我通常会重定向从终端开始的所有GUI应用输出:

$> qtcreator >/dev/null &

答案 2 :(得分:0)

您需要删除qt-at-spi包或使用QT_ACCESSIBILITY=0 qtcreator

在这里您可以找到KDE保护伞下的官方README以获取详细信息:

https://projects.kde.org/projects/playground/accessibility/qtatspi/repository/revisions/master/entry/README