为什么使用QVector(Qt)而不是std :: vector(Why use QVector(Qt) instead of std::vector)

编程入门 行业动态 更新时间:2024-10-28 20:22:38
为什么使用QVector(Qt)而不是std :: vector(Why use QVector(Qt) instead of std::vector)

我对C ++和Qt很新,但我非常擅长于C#/ Java。

关键是我喜欢跨平台,但我和Qt混淆。 不是std::vector已经跨平台了,Qt是不是提供了相当于非交叉平台的东西?

File和QFile还有什么区别?

一个链接会很好,谢谢:)

I'm very new to C++ and Qt, but I'm very good at C#/Java.

The point is I like cross-platform, but I'm confuse with Qt. Isn't std::vector already cross-platform, doesn't Qt provide an equivalent to a non-crossplatform thing?

Also how are File and QFile different?

A link would be nice, thanks :)

最满意答案

这篇文章很好。 它将Qt模板库与标准模板库进行比较:

QTL与STL

希望,你会发现有趣的看到文章中列出的所有差异。

编辑:

这是我觉得有趣的:

我的意见是, QTL最大的优点是在Qt支持的所有操作系统上都具有相同的实现(包括二进制兼容性) 。 有些STL实现在性能方面可能低于标准值,或者可能缺少功能。 有些平台甚至没有STL! 另一方面,STL更可自定义,并且在头文件中可以全部使用... 像我所说,没有明确的赢家

就像他说的,没有明确的赢家。 但是,仍然在阅读这篇文章,很多事情都清楚了。 知道差异比一个人更好,而不知道另一个。

This article loooks good. It compares Qt Template Library with Standard Template Library:

QTL vs STL

Hope, you'll find it interesting seeing all the differences listed there in the article.

EDIT:

Here is what I find interesting:

My opinion is that the biggest advantage of the QTL is that it has the same implementation (including binary compatibility) on all OSes supported by Qt. Some STL implementations might be below par when it comes to performance or they might be missing functionality. Some platforms don’t even have an STL! On the other hand, the STL is more customizable and is available in its entirety in header files… Like I said, there is no clear winner.

Like he said, no clear winner. But still reading the article makes lots of things clear. Its better to know the difference than going for one, without knowing the other.

更多推荐

本文发布于:2023-04-27 13:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327073.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   Qt   QVector   std   vector

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!