• Qt


    1,typedef QStack<char> StringStack;创建处理char元素特殊类型栈

    typedef QStack<int> IntStack;

    容器类Container class 存储类型Stack<>,STL--standard template library标准模板库

    新建class alias,栈中插入元素检索,QStack::push(),QStack::pop()检索并删除检索出的元素,QStack::remove()栈中删除元素不检索,QQueue从一端插入元素,并从另一端检索元素,从以插入相同顺序检索元素

    2,enqueue,dequeue出队,QQueue.dequeue()

    push压入,pop弹出;

    3,散列表hash-table

    散列表是一个列表,通过字符串键值--检索对象,QDict

    typedef QDict<char> StringDict;

    StringDict stringdict;创建字符串散列表;

    stringdict.insert("keys","values");

    edit.insertLine(stringdict["keys"]);

    QApplication a(argc,argv);

    QWidget w;

    w.resize(),QMultiLineEdit edit(&w)

    stringdict.insert("为建","实际元素");

    iteration traverse,QDict函数,QDict::clear()清除整个散列,QDict::idEmpty;

    5,数据缓存,QCache,QIntCache创建具有大小受限的散列,意味着设置容器最大能够变的多大,若散列达到最大使用最少的Element将被删除,控制一个散列所具有的元素以减少内存消耗

    QCache创建大小受限散列

    stringcache.setMaxCost()

    6,为了遍历容器类,使用iteration,迭代--特殊类---作用就是遍历容器

    每种容器类均有一种类型的迭代,QDictIterator,QCacheIterator,QIntCacheIterator

    所有迭代包含几个用于遍历容器的函数,toFirst()提取容器第一个元素,toLast()

    QDict(QDictIterator())

    toFirst提取容器的第一个元素,toLast(),++/--容器前移后移,current()提取当前元素

    创建容器迭代器

    typedef QDictIterator<char> StringDictIterator;

    StringDictIterator stringdictiterator(stringdict);

    迭代器需要对应 的迭代容器 作为参数

    7,采用图形交换格式GIF(Graphics Interchange Format) QMovie 显示动画,Gif图形动画格式

    8,Qt图像格式,QPicture类能够记录QPainter所执行的操作,将QPainter随绘制的图像用Qt图像格式保存到一个文件

    QPicture pic;

    pic.load("file.pic");

    QPainter paint;

    Paint.begin(this);

    paint.drawPicture(pic);

    paint.drawPincture(pic);

    paint.end();

    draw pixmap

  • 相关阅读:
    codeblocks多文件联合编译
    C++顶层const和底层const的区别
    keras failed to create cublas handle:CUBLAS_STATUS_ALLOC_FAILED问题
    Notepad++强大的代码补全和代码提示功能的方法
    PEP8编码风格
    在Maven项目中使用easypoi完成Excel文件上传下载
    Restful风格,使用同一地址,访问不同的方法
    注解@NoRepositoryBean的作用
    注解@MappedSuperclass的作用
    Shiro整合Spring以及权限登陆过滤
  • 原文地址:https://www.cnblogs.com/ruiy/p/4374650.html
Copyright © 2020-2023  润新知