• 5230阅读
  • 3回复

Qt容器 和 c++ STL中的容器哪个好用呀? [复制链接]

上一主题 下一主题
离线wxyao
 

只看楼主 倒序阅读 楼主  发表于: 2010-01-21
我现在做个项目,不确定要用哪个容器呢,主要是 list, map,

(1) 我是想用C++中的容器,因为我想参考资料多些,且可能效率更高点。
而Qt得容器可能更好和界面融合吧。
大家有什么经验和使用习惯呢,期待您的建议噢 :-) ?

(2) 另外使用了第三方的DLL,还要经常在char *字符串和 QString之间转换,
我是使用 QString::toAscii().constData()来把QString转换成 char数组格式的字符串,
大家使用什么方法呢?
[ 此帖被wxyao在2010-01-21 23:11重新编辑 ]
离线wxyao

只看该作者 1楼 发表于: 2010-01-21
大家随便给点建议哦。

我又参考了一下《C++ GUI Qt4》,

开始的地方说Qt的容器类是STL的一部分。

另外说它的主要优点是:在所有的平台上都表现一致 和 写时复制。

我想我不怎么需要这些特性,还是使用STL的容器好点。
离线dbzhang800

只看该作者 2楼 发表于: 2010-01-22
These container classes are designed to be lighter, safer, and easier to use than the STL containers. If you are unfamiliar with the STL, or prefer to do things the "Qt way", you can use these classes instead of the STL classes.


If you are already familiar with the STL containers and have STL available on your target platforms, you might want to use them instead of, or in addition to, the Qt containers.
离线wxyao

只看该作者 3楼 发表于: 2010-01-31
引用第2楼dbzhang800于2010-01-22 08:53发表的  :


很好! 谢谢您!
快速回复
限100 字节
 
上一个 下一个