(摘)Qt之数据库编程

(原)Qt学习笔记之容器类

孔令春 posted @ 2010年12月28日 12:16 in 开发语言 with tags QT 容器类 , 5111 阅读

       QT库也提供了类似STL的容器类,它们是QList<T> 、QLinkedList<T>、QVector<T>、QStack<T>、QQueue<T>、QSet<T>、QMap<Key, T>、QMultiMap<Key, T>、QHash<Key, T>、QMultiHash<Key, T>,还有两个比较特殊一点的QCache和QContiguousCaChe。

       这些容器类被设计成高效的、安全的和易于使用的,并且是隐式共享、可重入的和线程安全的,提供了两种风格的遍历方式:java风格和stl迭代器风格的。

       对于这些容器类,最先考虑使用的应该是QList<T>,因为实现了一种数组-链表式,所以无论是前置、追加还是中间插入都是非常快的。如果你确切需要链表式存储方式就用QLinkedList<T>,如果你确切需要连续的内存就用QVector<T>,如果需要后进先出就用QStack<T>,需要先进先出就用QQueue<T>。如果是其它映射方式的存储就考虑其它几方式了。

       这些容器类都是可以嵌套使用的,值的注意的一点是,由于继承QObject类的所有Gui类都没有拷贝构造函数和赋值运算符,所以不能直接用容器类存储,但是可以存储指向它们的指针。

Avatar_small
PSC Result 2022 Comi 说:
2022年8月27日 02:07

Right now there is a press announcement issued by Education Ministry Bangladesh for PSC Exam Result Date 2022, based on the announcement the PSC Result 2022 will be announced on 30th or 31st December 2022 in case of any early announcement the Grade-5 exam result announced on 24th December 2022 respectively for all education boards and all divisions in the country.According to the previous reports, PSC Result 2022 Comilla Board the PSC Result Date 2022 Comilla Board is also last week of December, however, we will update the official result date here after the official announcement by DPE, as per DPE previous five years result from the announcement of this year result will be announced likely on 30th or 31st December 2022.

Avatar_small
jnanabhumiap.in 说:
2024年1月17日 21:44

JNANABHUMI AP provides all latest educational updates and many more. The main concept or our aim behind this website has been the will to provide resources full information on each topic which can be accessed through Internet. To ensure that every readers get’s what important and worthy about the topic they search and link to hear from us. jnanabhumiap.in Jnanabhumi AP is a startup by passionate webmasters and bloggers who have passion to provide engaging content which is accurate, interesting and worthy to read. We are mope like a web community where you can find different information’s, resources, topics on day to day incidents or news. We provide you the finest of web content on each and every topics possible with help of editorial and content team.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter