简体   繁体   English

我可以在Ubuntu中使用Qt 4.8.1和Qt 5.2.1 IDE吗?

[英]Can I have Qt 4.8.1 and Qt 5.2.1 IDE's in Ubuntu?

I have Ubuntu 12.04 LTS, with Qt4, version 4.8.1. 我有Ubuntu 12.04 LTS,带有Qt4,版本4.8.1。 It's installed from official repositories with all its associated environments (Qt Creator 2.5.2, and Qt Assistant + Qt Linguist + Qt Designer). 它是从官方存储库及其所有关联环境(Qt Creator 2.5.2和Qt Assistant + Qt Linguist + Qt Designer)安装的。

I would like to install and begin to work with Qt 5.2 (preferably the new 5.2.1 that it's about to be released these days), with new environments (Qt Creator 3.0, and everything else). 我想安装并开始使用Qt 5.2(最好是这些天将要发布的新5.2.1),新环境(Qt Creator 3.0以及其他所有功能)。

But I have several works in progress (specially an important one) in 4.8.1. 但是我在4.8.1中有几项正在进行中的工作(特别是重要的一项)。

Can I have both versions installed? 我可以同时安装两个版本吗? Or, it would be better to have only one IDE but allowing to develop in both versions? 或者,最好只拥有一个IDE但允许同时在两个版本中进行开发?

What would be the best way to proceed (as far as I have seen, briefly)? 最好的方法是什么(据我所知,简而言之)?

  1. Download installer from Qt's official site and install (preferably offline installer) 从Qt的官方站点下载安装程序并进行安装(最好是离线安装程序)
  2. Download package and make + make install 下载软件包并make + make install
  3. Terminal: 终奌站:

     sudo apt-add-repository ppa:ubuntu-sdk-team/ppa sudo apt-get update sudo apt-get install qt-sdk 

And, what about to maintain that updated? 而且,如何保持更新?

Yes you can have as many qt version as you want. 是的,您可以根据需要拥有任意数量的qt版本。 You can install it in separate directory (in home) and configure Qt Creator to see all version you have. 您可以将其安装在单独的目录中(在主目录中),并配置Qt Creator以查看您拥有的所有版本。 Just download qt-sdk and run it (without sudo), it is quite easy. 只需下载qt-sdk并运行它(无需sudo),这非常容易。 I recommend to use newer version of Qt creator (has nice new features) and it will automatically configure it self to use system qt and qt shipped with Qt Creator. 我建议使用更高版本的Qt Creator(具有不错的新功能),它将自动对其进行自我配置,以使用Qt Creator随附的系统qt和qt。

System wide you can install both qt4 and qt5 since they use different library names. 在系统范围内,您可以同时安装qt4和qt5,因为它们使用不同的库名。 Only problem can be with qmake which has same name in both versions. 唯一的问题可能是在两个版本中具有相同名称的qmake。

Well, I finally decided to try to install Qt5. 好吧,我最终决定尝试安装Qt5。 I stumbled into a nightmare of faulting dependencies, requests to uninstall some important (for my projects: PCL 1.6, VTK 5.8, and so on) libraries, and restoring my system to its previous state. 我陷入了错误的依赖关系的噩梦,要求卸载一些重要的(对于我的项目:PCL 1.6,VTK 5.8等)库,并将系统还原到以前的状态。 7 hours of work and stress. 7个小时的工作和压力。

I decided to follow these steps: 我决定按照以下步骤操作:

@sudo add-apt-repository ppa:ubuntu-sdk-team/ppa sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install ubuntu-sdk @ @sudo add-apt-repository ppa:ubuntu-sdk-team / ppa sudo apt-get更新sudo apt-dist升级sudo apt-get install ubuntu-sdk @

This went OK... but I saw that some Qt5 components were not installed. 一切正常...但是我看到未安装某些Qt5组件。 Started Qt Creator, and it was still 2.5.2, not the newer 3.0. 启动了Qt Creator,它仍然是2.5.2,而不是较新的3.0。 And it looked somewhat ugly. 而且看起来有些难看。 Googling, I decided to try: 谷歌搜索,我决定尝试:

@sudo apt-get install qtdeclarative5-dev@ this had some faulting dependencies, so tried @sudo apt-get install qtbase5-dev@ with more faulting dependencies. @sudo apt-get install qtdeclarative5-dev @有一些错误的依赖项,所以尝试了@sudo apt-get install qtbase5-dev @有更多的错误依赖项。

Diving into installing these dependencies, I saw that doing so would unistall some important libraries for my actual projects: PCL 1.6, VTK 5.8 (there is still no VTK version suitable for Qt5)... 深入安装这些依赖项,我发现这样做会取消一些对我的实际项目重要的库:PCL 1.6,VTK 5.8(仍然没有适用于Qt5的VTK版本)...

Now I got a Qt4 with some non-completely-installed Qt5 components messing around all... 现在我有了一个Qt4,其中包含一些未完全安装的Qt5组件,到处都是...

Finally I got to revert these changes with ppa-purge... but I had to update and upgrade all components again (in example, Qt4 Creator reverted to 2.4.1 instead of 2.5.2...) 最后,我必须使用ppa-purge还原这些更改...但是我不得不再次更新和升级所有组件(例如,Qt4 Creator还原为2.4.1而不是2.5.2 ...)

I got really screwed for some hours... 我真的被搞砸了几个小时...

Would it have been better if I had downloaded Qt5 directly from Qt Project and installed it directly? 如果直接从Qt Project下载Qt5并直接安装它会更好吗? How would this work with my actual Qt4 installed from Ubuntu official repositories? 从Ubuntu官方存储库安装我的实际Qt4怎么办?

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

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