In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge points about how to use Qt's ergodic iterator. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Foreword:
Qt (official pronunciation [kju:t], pronunciation with cute) is a cross-platform C++ development library, mainly used for the development of graphical user interface (Graphical User Interface,GUI) programs, of course, you can also develop command line (Command User Interface,CUI) programs without an interface.
Iterators are usually used to traverse the container, which provides a unified way to access items in the container. Qt's container class provides two types of iterators, one is a Java-style iterator and the other is an STL-style iterator. Generally speaking, C++ programmers are more accustomed to using STL-style iterators. You can also use Qt's foreach keyword if you only want to traverse items in a container sequentially.
STL style iterator:
Each container class has two STL-style iterator types, one providing read-only access and the other providing read / write access. Read-only iterators are much faster than read / write iterators, so use read-only iterators whenever possible.
Read-only iterator: "container type":: const_iterator; for example: QList::const_iterator, QMap::const_iterator.
Read / write iterator: "container type":: iterator; for example: QVector::iterator, QHash::iterator.
How to use it:
QList list;list
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.