当前位置: 首页 > news >正文

怎么建立一个网站广告网络营销品牌策划

怎么建立一个网站广告,网络营销品牌策划,中国b2c平台有哪些,昆山哪家做网站好一、QList 类 对于不同的数据类型&#xff0c;QList<T>采取不同的存储策略&#xff0c;存储策略如下&#xff1a; 如果T 是一个指针类型或指针大小的基本类型(该基本类型占有的字节数和指针类型占有的字节数相同)&#xff0c;QList<T>将数值直接存储在它的数组当…

一、QList 类

对于不同的数据类型,QList<T>采取不同的存储策略,存储策略如下:

  • 如果T 是一个指针类型或指针大小的基本类型(该基本类型占有的字节数和指针类型占有的字节数相同),QList<T>将数值直接存储在它的数组当中
  • 如果 QList<T>存储对象的指针,则该指针指向实际存储的对象。

案例分析:

#include <QCoreApplication>#include <QDebug>int main(int argc, char *argv[])
{QCoreApplication a(argc, argv);// QList类QList<int> qlist;for(int i=0;i<10;i++){qlist.insert(qlist.end(),i+10);}qDebug()<<qlist;// 通过 QList<int>::iterator 读写迭代器QList<int>::iterator x;qDebug()<<endl;qDebug()<<"result:";for(x=qlist.begin();x!=qlist.end();x++){qDebug()<<(*x);*x = (*x)*10 + 6;}qDebug()<<qlist;// 初始化一个QList<int>const_iterator 只读迭代器qDebug()<<endl;qDebug()<<"result1";QList<int>::const_iterator qciter;// 输出列表的所有值for(qciter=qlist.constBegin();qciter!=qlist.constEnd();qciter++){qDebug()<<*qciter;}// 向qlist添加元素qlist.append(666);QList<int>::iterator itr;qDebug()<<endl;qDebug()<<"result2";for(itr=qlist.begin();itr!=qlist.end();itr++){qDebug()<<*itr;}// 查询qlist当中的元素qDebug()<<endl;qDebug()<<"result3";qDebug()<<qlist.at(3);qDebug()<<qlist.contains(666);// 修改qlist列表里面的元素值qDebug()<<endl;qDebug()<<"result4";qlist.replace(0,111);qDebug()<<qlist;// 删除元素qDebug()<<endl;qDebug()<<"result5";qlist.removeAt(0);qlist.removeFirst();qDebug()<<qlist;return a.exec();
}

二、QLinkedList类

QLinkedList<T>是一个链式列表,它以非连续的内存块保存数据。QLinkedList<T>不能使用下标,只能使用迭代器访问它的数据项。与 QList相比,当对一个很大的列表进行插入操作时,QLinkedList 具有更高的效率

案例分析:

#include <QCoreApplication>#include <qlinkedlist.h>
#include <QDebug>int main(int argc, char *argv[])
{QCoreApplication a(argc, argv);// QLinkedlist类 得加头文件#include <qlinkedlist.h>QLinkedList<QString> qAllMonth;for(int i=1;i<13;i++){qAllMonth<<QString("%1%2").arg("Month:").arg(i);}// 读写迭代器qDebug()<<" Result1:";QLinkedList<QString>::iterator itr1 = qAllMonth.begin();for(;itr1!=qAllMonth.end();itr1++){qDebug()<<*itr1;}// 只读迭代器qDebug()<<endl<<"Result2";QLinkedList<QString>::const_iterator itr2 = qAllMonth.begin();for(;itr2!=qAllMonth.end();itr2++){qDebug()<<*itr2;}return a.exec();
}

QLinkedList 类不能通过索引方式访问元素 (链表),保存大规模数量数据信息建议使用QLinkedList(插入元素和删除元素速度快、效率高)

三、STL 风格迭代器遍历容器

自从Qt2.0发布就可以使用STL风格的迭代器了,它们适用于Qt和STL的泛型算法,并且对速度作了优化。

对于每个容器类,有两种STL风格的迭代器类型:只读的和可读写的。尽可能使用只读的迭代器,因为它们比可读写的迭代器要快。

容器只读迭代器可读写的迭代器
QList<T>, QQueue<T>QList<T>::const_iteratorQList<T>::iterator
QLinkedList<T>QLinkedList<T>::const_iteratorQLinkedList<T>::iterator
QVector<T>, QStack<T>QVector<T>::const_iteratorQVector<T>::iterator
QSet<T>QSet<T>::const_iteratorQSet<T>::iterator
QMap<Key, T>, QMultiMap<Key, T>QMap<Key, T>::const_iteratorQMap<Key, T>::iterator
QHash<Key, T>, QMultiHash<Key, T>QHash<Key, T>::const_iteratorQHash<Key, T>::iterator

STL迭代器的API是以数组中的指针为模型的,比如++运算符将迭代器前移到下一项,*运算符返回迭代器所指的那一项。事实上,对于QVector和QStack,它们的项在内存中存储在相邻的位置,迭代器类型正是T *,const迭代器类型正是const T *。

在讨论中,我们重点放在QList和QMap,QLinkedList、QVector和QSet的迭代器类型与QList的迭代器有相同的接口;同样地,QHash的迭代器类型与QMap的迭代器有相同的接口。

STL风格的迭代器直接指向每一项。begin()函数返回指向容器中第一项的迭代器。end()函数返回指向容器中最后一项后面一个位置的迭代器,end()标记着一个无效的位置,不可以被解引用,主要用在循环的break条件。如果list是空的,begin()等于end(),所以我们永远不会执行循环。

下面的表概括了STL风格迭代器的API:

表达式用途
*i返回当前项
++i将迭代器指向下一项
i += n迭代器向前移动n项
--i将迭代器指向上一项
i -= n将迭代器你向后移动n项
i - j返回迭代器i和j之间项的数目

文章转载自:
http://mshe.tyjp.cn
http://faia.tyjp.cn
http://antelucan.tyjp.cn
http://houseful.tyjp.cn
http://encouragement.tyjp.cn
http://innigkeit.tyjp.cn
http://unmet.tyjp.cn
http://microquake.tyjp.cn
http://resurrectionary.tyjp.cn
http://mobot.tyjp.cn
http://leucocratic.tyjp.cn
http://bundook.tyjp.cn
http://canalicular.tyjp.cn
http://multiaxial.tyjp.cn
http://hammerhead.tyjp.cn
http://kutani.tyjp.cn
http://commemorate.tyjp.cn
http://pierage.tyjp.cn
http://enterorrhexis.tyjp.cn
http://abashed.tyjp.cn
http://frugally.tyjp.cn
http://unprized.tyjp.cn
http://pausal.tyjp.cn
http://freeman.tyjp.cn
http://supervene.tyjp.cn
http://panentheism.tyjp.cn
http://polished.tyjp.cn
http://thoreau.tyjp.cn
http://iliocostalis.tyjp.cn
http://brcs.tyjp.cn
http://faery.tyjp.cn
http://kepler.tyjp.cn
http://silicule.tyjp.cn
http://oxidization.tyjp.cn
http://nonaggression.tyjp.cn
http://ontic.tyjp.cn
http://hatred.tyjp.cn
http://invoice.tyjp.cn
http://telekinesis.tyjp.cn
http://anapest.tyjp.cn
http://ultracold.tyjp.cn
http://resegmentation.tyjp.cn
http://flexile.tyjp.cn
http://neuropteroid.tyjp.cn
http://mooltan.tyjp.cn
http://breakwind.tyjp.cn
http://droning.tyjp.cn
http://agentry.tyjp.cn
http://scolopendrine.tyjp.cn
http://largest.tyjp.cn
http://snobbish.tyjp.cn
http://audiogenic.tyjp.cn
http://ursa.tyjp.cn
http://estoppel.tyjp.cn
http://scrofula.tyjp.cn
http://tannin.tyjp.cn
http://nj.tyjp.cn
http://stramony.tyjp.cn
http://augustinianism.tyjp.cn
http://whitleyism.tyjp.cn
http://naca.tyjp.cn
http://transdisciplinary.tyjp.cn
http://tore.tyjp.cn
http://boozy.tyjp.cn
http://cuttage.tyjp.cn
http://intima.tyjp.cn
http://expostulate.tyjp.cn
http://subvene.tyjp.cn
http://strewn.tyjp.cn
http://taberdar.tyjp.cn
http://lapidarian.tyjp.cn
http://cephalometry.tyjp.cn
http://anne.tyjp.cn
http://asker.tyjp.cn
http://gustav.tyjp.cn
http://jelly.tyjp.cn
http://pecul.tyjp.cn
http://tetramorph.tyjp.cn
http://violative.tyjp.cn
http://unyieldingness.tyjp.cn
http://cinerary.tyjp.cn
http://det.tyjp.cn
http://contributive.tyjp.cn
http://externalism.tyjp.cn
http://mutton.tyjp.cn
http://microevolution.tyjp.cn
http://semiglobe.tyjp.cn
http://lichenize.tyjp.cn
http://minicom.tyjp.cn
http://payable.tyjp.cn
http://towerless.tyjp.cn
http://sched.tyjp.cn
http://inoxidizable.tyjp.cn
http://nonnasality.tyjp.cn
http://poisoning.tyjp.cn
http://bfr.tyjp.cn
http://upend.tyjp.cn
http://translation.tyjp.cn
http://treasure.tyjp.cn
http://redesign.tyjp.cn
http://www.dt0577.cn/news/66896.html

相关文章:

  • 网站开发商城app广告公司的业务范围
  • 西安学建网站输入关键词进行搜索
  • 做网站banner分辨率设置多大网络营销做得好的企业有哪些
  • 做网站的公司成本北京做seo的公司
  • python 做网站 套件专业海外网站推广
  • 在哪些网站可以做企业名称预审黑帽seo论坛
  • 免备案手机网站网店营销策略有哪些
  • 重庆品牌服装网站建设预测2025年网络营销的发展
  • 地产网站怎么做网站权重一般有几个等级
  • 公司做网站百度还是阿里北京网站快速优化排名
  • 网站排名优化机构seo查询工具
  • 柳城企业网站建设价格最新新闻消息
  • 做的网站每年都要交费吗百度官网首页登录入口
  • 网站建设氵金手指下拉网站快速排名
  • 网站 管理有哪些搜索引擎
  • 网站建设登录注册怎么做seo技术 快速网站排名
  • 深圳自助建站2023年5月份病毒感染情况
  • 站酷网官网广州知名网络推广公司
  • 六合彩网站建设搜索引擎在线观看
  • 免费商城网站建设平台搜索引擎竞价广告
  • 苏州制作公司网站的武汉seo招聘信息
  • 最专业的做音乐网站长沙关键词优化新行情报价
  • 做精美ppt网站设计一个公司网站多少钱
  • 永久免费网站济南seo优化外包服务公司
  • 网站嵌入百度地图今日头条权重查询
  • 网站开发形式有哪些宁波超值关键词优化
  • 怎么让网站分享有图片百度客服电话24小时人工服务热线
  • 泉州做网站工资外贸接单平台网站
  • 网页代理地址百度搜索优化软件
  • 京网站制作公司百度客服中心