简体   繁体   English

从Ubuntu 12.04上的源代码构建的Qt 4.8.4无法正常工作

[英]Qt 4.8.4 built from source on Ubuntu 12.04 not working properly

I have tried for some time now to build Qt example systray . 我已经尝试了一段时间来构建Qt示例systray Everything works fine if I build it with Qt from official ubuntu repositoy. 如果我使用官方ubuntu存储库中的Qt进行构建,那么一切都会很好。

Now I'm trying to build it using Qt 4.8.4 which is built from source. 现在,我正在尝试使用从源代码构建的Qt 4.8.4来构建它。 In this case, tray icons wont appear in system tray. 在这种情况下,托盘图标不会出现在系统托盘中。

I have followed instructions on official Qt pages (requirements for X11 platforms, installation instructions), looked for possible solutions on qt web pages, ubuntu forums, stackoverflow, etc. but with no luck. 我已经按照官方Qt页面上的说明进行操作(对X11平台的要求,安装说明),在qt网页,ubuntu论坛,stackoverflow等上寻找可能的解决方案,但是没有运气。

To compile and install Qt I made following steps: 1) installed suggested required packages 2) downloaded Qt 4.8.4 from offiacial web 3) configured with 要编译和安装Qt,我执行了以下步骤:1)安装了建议的必需软件包2)从官方Web下载了Qt 4.8.4 3)配置了

./configure -release -nomake demos,examples,docs -no-webkit -no-script -no-scripttools -no-qt3support

4) installed with 4)安装

make
sudo make install

5) added bin dir to PATH 5)将bin目录添加到PATH

Problem probably is not in built libs because if I copy them to another Ubuntu PC (not virtual machine) the example program works. 问题可能不在内置库中,因为如果我将它们复制到另一台Ubuntu PC(不是虚拟机),则示例程序可以运行。 I have only tried this with one non-virtual machine so I cant confirm if this may be the cause of problem. 我仅在一台非虚拟机上尝试过此操作,因此我无法确认这是否可能是问题的原因。

I have tried this procedure on several virtual machines but with no luck. 我已经在几个虚拟机上尝试了此过程,但是没有运气。 Am I missing something? 我想念什么吗?

Ubuntu provides sni-qt package and patched Qt so you can use QSystemTrayIcon class from Qt with notification area in Unity (see http://bazaar.launchpad.net/~indicator-applet-developers/sni-qt/trunk.13.04/view/head:/README ). Ubuntu提供了sni-qt软件包和修补过的Qt,因此您可以将Qt中的QSystemTrayIcon类与Unity中的通知区域一起使用(请参阅http://bazaar.launchpad.net/~indicator-applet-developers/sni-qt/trunk.13.04/view / head:/ README )。

You'll need to patch Qt source code before building it or use other desktop environment -- possibly you could just use other panel that provides classic tray area. 在构建Qt源代码或使用其他桌面环境之前,您需要先修补Qt源代码-可能只需要使用提供经典托盘区域的其他面板即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM