visual-studio Qt:我应该使用 Visual Studio、Qt Creator 还是其他什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1519291/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 11:04:37  来源:igfitidea点击:

Qt: Should I use Visual Studio, Qt Creator or something else?

visual-studioqtideqt-creator

提问by Rasmus Faber

I realize that there have been similar questions, but they seem to have been from when Qt Creator was still in beta, so the answer might have changed since then:

我意识到有类似的问题,但它们似乎是从 Qt Creator 仍处于测试阶段的时候开始的,所以从那时起答案可能已经改变了:

We are going to start a project with a small amount of GUI that needs to work on Windows, OS X and Linux. So choosing Qt was a no-brainer, even though we have little experience with Qt.

我们将开始一个带有少量 GUI 的项目,该项目需要在 Windows、OS X 和 Linux 上运行。所以选择 Qt 是轻而易举的事,尽管我们对 Qt 的经验很少。

What is currently the best option for IDE?

目前 IDE 的最佳选择是什么?

All the developers will be using Windows machines, so the IDE does not need to be cross-platform.

所有开发人员都将使用 Windows 机器,因此 IDE 不需要跨平台。

We use Visual Studio for most things, but most of us are also comfortable with Eclipse.

我们在大多数情况下使用 Visual Studio,但我们大多数人也对 Eclipse 感到满意。

How are the refactoring tools in Qt Creator? I like Visual Assist X when using Visual Studio for C++. Have anyone tried using that with Qt-projects?

Qt Creator 中的重构工具如何?在使用 Visual Studio for C++ 时,我喜欢 Visual Assist X。有没有人试过在 Qt 项目中使用它?

I realize that was a lot of different questions. Please answer even if you can't answer all of them.

我意识到这是很多不同的问题。即使您不能全部回答,也请回答。

EDIT:

编辑:

I should probable add that we already have Visual Studio and Visual Assist licenses, so the cost of those is not an issue.

我应该补充一点,我们已经拥有 Visual Studio 和 Visual Assist 许可证,因此它们的成本不是问题。

采纳答案by rpg

I use Visual C++ 2008 with Visual Assist and Qt Creator with MinGW:

我将 Visual C++ 2008 与 Visual Assist 和 Qt Creator 与 MinGW 一起使用:

  • MinGW will drive you nuts, but thankfully you can use the VC++ compiler in Qt Creator.
  • The debugger integration is not as good as VC++. You can't set the next instruction or do any of the fancy stuff like see what a function has returned in the locals window. GDB is as slow as a snail.
  • Code navigation is as good as VA X (but use the tech preview, 1.2.1 is not that great)
  • Code completion is acceptable, certainly not as good as VA X. Code completion doesn't work for anything a bit more complicated such as accessing the members of a const_iterator from a QList typedef.
  • Lighter IDE than VC++ and has a nicer GUI IMO.
  • .pro files are generally easier to manage than sln
  • MinGW 会让你抓狂,但幸运的是你可以在 Qt Creator 中使用 VC++ 编译器。
  • 调试器集成不如VC++。你不能设置下一条指令或做任何花哨的事情,比如在 locals 窗口中查看函数返回了什么。GDB 像蜗牛一样慢。
  • 代码导航与 VA X 一样好(但使用技术预览,1.2.1 不是那么好)
  • 代码补全是可以接受的,当然不如 VA X。代码补全不适用于更复杂的任何事情,例如从 QList typedef 访问 const_iterator 的成员。
  • 比 VC++ 更轻的 IDE,并且有更好的 GUI IMO。
  • .pro 文件通常比 sln 更容易管理

QtCreator is a good alternative to VC++ and I would definitely use it on Linux. If you already have VC++ 2005 or 2008 and VA X, I recommend that you install the Qt addin and use VC++ for development. I also recommend that you install the Qt SDK side by side and compile in both MinGW and VC++ to catch cross-platforms issues early! Try to keep the .pro files in sync to the sln and beware of this issue.

QtCreator 是 VC++ 的一个很好的替代品,我肯定会在 Linux 上使用它。如果你已经有 VC++ 2005 或 2008 和 VA X,我建议你安装 Qt 插件并使用 VC++ 进行开发。我还建议您并排安装 Qt SDK 并在 MinGW 和 VC++ 中编译,以尽早发现跨平台问题!尝试使 .pro 文件与 sln 保持同步并注意此问题

回答by Zimmermann

Use QtCreator, but learn key all shortcuts first.

使用 QtCreator,但首先要学习所有快捷键。

I'm 30% faster (veeeery subjective:-) since I switched, and I tried every IDE and editor there is for several days to several years. I'm fed up with visual-something and even eclipse, my long-time favorite.

自从我切换以来,我的速度提高了 30%(非常主观:-),并且我尝试了那里的每个 IDE 和编辑器几天到几年。我厌倦了视觉方面的东西,甚至厌倦了我长期以来最喜欢的日食。

First I thought 'another ide, what a waste of these developers' time', but after some days I used Qt creator even for non-Qt C++ development.

起初我想“另一个ide,真是浪费这些开发人员的时间”,但几天后我什至将Qt creator 用于非Qt C++ 开发。

This IDE helps you to focus on your work, hides all distraction and lets you jump instead of search. (So, no class browser desired)

此 IDE 可帮助您专注于工作,隐藏所有干扰,让您跳跃而不是搜索。(因此,不需要类浏览器)

回答by Patrice Bernassola

QTCreator is still in the beginning of its dev if you are facing it with Visual Studio.

如果您使用 Visual Studio 面对 QTCreator,它仍处于其开发的初期。

Personally I'm using QTCreator for QT devs since all QT environment (IDE, QTDesigner, QT Documentation) is embedded and I find it great but not mature for now.

就个人而言,我将 QTCreator 用于 QT 开发人员,因为所有 QT 环境(IDE、QTDesigner、QT 文档)都是嵌入式的,我觉得它很棒但目前还不成熟。

But since you used to develop with Visual Studio (with the Visual Assist X add-in) you should continue using it. In addition new QT binarieshave been released for Visual Studio 2008. So no need to compile QT before using it!

但由于您曾经使用 Visual Studio(使用 Visual Assist X 加载项)进行开发,因此您应该继续使用它。此外,Visual Studio 2008 还发布了新的QT 二进制文件。因此无需在使用前编译 QT!

Edit (Oct 5) : Next QtCreator release 1.3 will have an improved completion system at least as good as Visual Assist X : http://www.youtube.com/watch?v=TyfO-7lvy%5Fc&feature=player%5Fembedded.

编辑(10 月 5 日):下一个 QtCreator 版本 1.3 将有一个改进的完成系统,至少与 Visual Assist X 一样好:http: //www.youtube.com/watch?v=TyfO-7lvy%5Fc&feature=player%5Fembedded 。

回答by Vance Tower

I own Visual Studio 2005 and the wonderful add-on "Visual Assist X" (VAX I call it), but am pleased with using Qt Creator. Things get way better with Qt Creator 1.3, and I hope 1.4 adds a class browser, which is its worst weakness. But I am continually amazed by how good Qt Creator is, and how clear a vision its developers have. Amazed, I Say!It is as though all the VS competitors laid down and died and now Qt Creator is all that stands to truly develop a C++-Centric IDE. I always hated how VS watered itself down to adapt to every language, to the point that later versions downplayed the MFC wizards (yuck, but hey, I needed them back then). Eclipse is based on Java. I love using an IDE build with Qt and made for Qt. So go Qt Creator and don't look back. At first I was a bit wary that Qt Creator might be another "dies on the vine" type of project, but after the last two releases and the coming v1.3 I see that it is going to be the new kid on the block -- if only it gets that class browser!

我拥有 Visual Studio 2005 和出色的附加组件“Visual Assist X”(我称之为 VAX),但对使用 Qt Creator 感到满意。Qt Creator 1.3 使事情变得更好,我希望 1.4 增加一个类浏览器,这是它最大的弱点。但我一直惊讶于 Qt Creator 的出色程度以及其开发人员的清晰愿景。 惊讶,我说!就好像所有的 VS 竞争者都倒下了,现在 Qt Creator 才是真正开发以 C++ 为中心的 IDE。我总是讨厌 VS 如何淡化自己以适应每种语言,以至于后来的版本淡化了 MFC 向导(哎呀,但是嘿,当时我需要它们)。Eclipse 基于 Java。我喜欢使用带有 Qt 的 IDE 构建并为 Qt 制作。所以去 Qt Creator,不要回头。起初我有点担心 Qt Creator 可能是另一个“死在藤蔓上”类型的项目,但在最后两个版本和即将到来的 v1.3 之后,我看到它会成为新的孩子 - - 如果它有那个类浏览器就好了!

回答by Matthieu

Another possibility is using Netbeans. Have a look at this
Netbeans provides great tools about memory and profiling for free. Morevover, the integration with Qt is nice.

另一种可能性是使用 Netbeans。看看这个
Netbeans 免费提供了关于内存和分析的好工具。此外,与 Qt 的集成很好。

回答by Milan

I was confronted with the same problem not so long ago. I chose QtCreator in the end, because it really grew stable over the past few months.

不久前我遇到了同样的问题。我最终选择了 QtCreator,因为它在过去几个月里确实变得稳定了。

It's just so much easier to have all your tools within one environment. The debugging facilities are also quite extensive and integrate well with the Qt framework. Code completion is almost as good as in Visual Studio (as long as you don't own Visual Assist ;-), and the code navigation is very easy to use!

在一个环境中拥有所有工具要容易得多。调试工具也非常广泛,并且与 Qt 框架集成良好。代码补全几乎和 Visual Studio 一样好(只要你没有 Visual Assist ;-),而且代码导航非常好用!

That together with the fact that QtCreator works on all three major platforms made the difference for me in the end.

再加上 QtCreator 可在所有三个主要平台上运行的事实,最终对我产生了影响。

I think when starting a new project, QtCreator has become a serious alternative to consider...

我认为在开始一个新项目时,QtCreator 已经成为一个值得考虑的严重替代方案......

回答by gnud

I've never used the Qt visual studio integration, and I've only taken a quick look at qt creator, but here are my thoughts anyway.

我从来没有使用过 Qt Visual Studio 集成,我只是快速浏览了 qt creator,但无论如何这里是我的想法。

Using Qt creator gives you a familiar debugging enviroment across platforms, with support for stuff like Qt collections.

使用 Qt creator 为您提供了一个熟悉的跨平台调试环境,并支持诸如 Qt 集合之类的东西。

It seems like Qt creator has really good code navigation features. It also integrates with git, subversion and perforce. When starting a new project, that seems like a plus compared to VS.

看起来 Qt creator 有非常好的代码导航功能。它还与 git、subversion 和 perforce 集成。在开始一个新项目时,与 VS 相比,这似乎是一个优势。

回答by RedGlyph

QtCreator is stable enough and a comfortable IDE, although compile/debug cycles are slower on Windows than with Visual Studio. It doesn't have all the fancy features Visual Studio offers, but after using it for a while I just realized I wasn't missing them. Especially in C++, where Visual Studio doesn't provide source refactoring - they really are pushing C# aren't they? ;)

QtCreator 足够稳定并且是一个舒适的 IDE,尽管 Windows 上的编译/调试周期比 Visual Studio 慢。它没有 Visual Studio 提供的所有花哨功能,但在使用它一段时间后我才意识到我并没有错过它们。尤其是在 C++ 中,Visual Studio 不提供源代码重构——他们真的在推动 C#,不是吗?;)

Visual Studio is certainly a nice IDE, but at the end of the day if you have to pay many licences just for the fancy features (depending on the size of your team), that money could be better spent on other tools.

Visual Studio 无疑是一个不错的 IDE,但归根结底,如果您只为花哨的功能(取决于您的团队的规模)支付许多许可证,那么这笔钱最好花在其他工具上。

You will also avoid the trouble of maintaining different project files (Visual Studio on Windows, something else on MacOS and Linux), even if you develop on Windows only, time will come when you will have to compile, test and debug minor issues on the other OS'es.

您还将避免维护不同项目文件的麻烦(Windows 上的 Visual Studio,MacOS 和 Linux 上的其他东西),即使您只在 Windows 上进行开发,时间也会到来,您将不得不在项目上编译、测试和调试小问题。其他操作系统。

Eclipse is an alternative, but I haven't checked the stability of Designer on that IDE. You might spend some time on configuring each workstation, and you might have to wait for updates. On the other hand, you benefit from the whole Eclipse environment, which could help if you have other needs. But is that worth the risk?

Eclipse 是一种替代方案,但我没有检查过该 IDE 上 Designer 的稳定性。您可能会花一些时间来配置每个工作站,并且可能需要等待更新。另一方面,您可以从整个 Eclipse 环境中受益,如果您有其他需要,它会有所帮助。但这值得冒险吗?

I would definitely try QtCreator first and try to stick with their environment. If that proves to be a problem, it won't be too late to move to VS later.

我肯定会先尝试 QtCreator 并尝试坚持他们的环境。如果这被证明是一个问题,那么稍后转移到 VS 不会太晚。

Your timing isn't too bad either: you should probably test the 4.6 preview, normally the official release should be soon.

您的时机也不错:您可能应该测试 4.6 预览版,通常正式版本应该很快。

回答by nephewtom

Hit CTRL+K in QtCreator.

在 QtCreator 中按 CTRL+K。

回答by Idan K

I would recommend to at least try QtCreator. Obviously for someone used to Visual Studio the transition won't be overnight but in the end I believe it'll be worth it.

我建议至少尝试 QtCreator。显然,对于习惯了 Visual Studio 的人来说,转变不会在一夜之间完成,但最终我相信这是值得的。

Main reason is although you mention all developers will be using Windows, eventually you will have to run the program on other platforms during testing. And then it's hard to imagine you won't need to debug and fix things. You can do just fine with gdb/vim but for someone who's used to a debugger/editor experience that Visual Studio delivers, getting used to gdb/vim can take some time. QtCreator isn't perfect in this area, but it's as close as it gets to Visual Studio.

主要原因是尽管您提到所有开发人员都将使用 Windows,但最终您将不得不在测试期间在其他平台上运行该程序。然后很难想象你不需要调试和修复东西。您可以使用 gdb/vim 做得很好,但对于习惯了 Visual Studio 提供的调试器/编辑器体验的人来说,习惯 gdb/vim 可能需要一些时间。QtCreator 在这方面并不完美,但它与 Visual Studio 非常接近。

A few other points worth mentioning:

还有几点值得一提:

  • It doesn't have the maturity of Visual Studio but for an IDE that's been around for around a year it's great.
  • In terms of refactoring, it is not as advanced as Visual Assist X. As far as code browsing I'd say they're equal.
  • 它没有 Visual Studio 的成熟度,但对于已经存在大约一年的 IDE 来说,它很棒。
  • 在重构方面,它不如 Visual Assist X 先进。就代码浏览而言,我会说它们是平等的。