問題描述
我對 C++ 和 Qt 很陌生,但我很擅長 C#/Java.
I'm very new to C++ and Qt, but I'm very good at C#/Java.
關鍵是我喜歡跨平臺,但我對 Qt 感到困惑.std::vector
不是已經跨平臺了嗎,Qt 不是提供了一個非跨平臺的東西嗎?
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?
還有 File
和 QFile
有什么不同?
Also how are File
and QFile
different?
一個鏈接會很好,謝謝:)
A link would be nice, thanks :)
推薦答案
這篇文章看起來不錯.它比較了 Qt 模板庫和標準模板庫:
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.
這里是我覺得有趣的地方:
Here is what I find interesting:
我的觀點是最大的QTL 的優點在于它具有相同的實現(包括二進制兼容性)在所有操作系統上Qt支持.一些 STL實現可能低于標準當談到性能或他們可能缺少功能.一些平臺甚至沒有 STL!在另一方面,STL 更多可定制,可在其完整的頭文件......就像我說的,沒有明顯的贏家.
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.
這篇關于為什么使用 QVector(Qt) 而不是 std::vector的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!