摘要:
1. 实例化QMap对象 /* 创建QMap实例, 第一个参数为QString类型的键,第二个参数为int类型的值 */ QMap<QString, int> map; 2. 插入数据 /* 插入数据 两种方式*/ map["math"] = 100; map.insert("English", 9 阅读全文
posted @ 2024-07-16 10:25
checha
阅读(122)
评论(0)
推荐(0)
摘要:
1. 创建 键值对的方式插入,数据类型随意,这里以键int,值QString示例。 QHash<int,QString> qhash; 2. 插入 //方式一 qhash[1] = "1"; qhash[2] = "2"; qhash[3] = "3"; //方式二 qhash.insert(4, 阅读全文
posted @ 2024-07-16 09:49
checha
阅读(409)
评论(0)
推荐(0)
摘要:
QString #include<QString> 追加字符 QString str1 = "hello "; QString str2 = "world"; str1.append(str2); // str1 = "hello world" str1.append(" !"); // str1 阅读全文
posted @ 2024-07-16 09:41
checha
阅读(223)
评论(0)
推荐(0)
摘要:
#include<QFileDialog> QFileDialog::getOpenFileName() //打开一个文件,得到这个文件的绝对路径 FileName=QFileDialog::getOpenFileName( this, "prd", dir.currentPath(), "prd( 阅读全文
posted @ 2024-07-16 09:34
checha
阅读(40)
评论(0)
推荐(0)