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

日照网站建设多少钱河南郑州网站推广优化

日照网站建设多少钱,河南郑州网站推广优化,网站的代理页面怎么做的,建设酒类产品网站的好处本例子中把xml文件作为数据库表。 xml文件名作为函数参数,把不同的xml文件名传入函数,会显示不同的文件内容。 以下为代码: void MainWindow::ShowContent(QString FileName) {LoadXmlContent(FileName);ShowContentInView();}bool MainWi…

本例子中把xml文件作为数据库表。

xml文件名作为函数参数,把不同的xml文件名传入函数,会显示不同的文件内容。

以下为代码:

void MainWindow::ShowContent(QString FileName)
{LoadXmlContent(FileName);ShowContentInView();}bool MainWindow::LoadXmlContent(QString FileName)
{QString FilePath = "yourpath/" + FileName + ".xml";QFile file(FilePath); // 替换为您实际的文件路径if (!file.open(QIODevice::ReadOnly)) {qDebug() << "Can not open file。";return false;}QDomDocument document;if (!document.setContent(&file)) {qDebug() << "无法将文件解析为DOM树。";file.close();return false;}file.close();dataVector.clear();QDomElement root = document.firstChildElement(); // 获取根元素// 遍历所有子元素QDomNodeList elements = root.childNodes();for (int i = 0; i < elements.count(); i++) {QDomNode elementNode = elements.at(i);// 检查节点是否为元素。if (elementNode.isElement()) {QDomElement element = elementNode.toElement();QDomNodeList childNodes = element.childNodes();// 创建一个字典来存储键值对std::map<QString, QString> dataMap;for (int j = 0; j < childNodes.count(); j++) {QDomNode childNode = childNodes.at(j);if (childNode.isElement()) {QDomElement childElement = childNode.toElement();QString key = childElement.nodeName();QString value = childElement.text();// 将键值对存入字典dataMap[key] = value;}}// 将字典存入vectordataVector.push_back(dataMap);}}// 打印存储的数据for (const auto& data : dataVector) {for (const auto& pair : data) {qDebug() << pair.first << ":" << pair.second;}qDebug() << "-------------------";}
}void MainWindow::ShowContentInView()
{m_model.clear();// 设置表头顺序QStringList headers = {"name", "len", "type", "value", "reverse", "factor", "isSelected", "dimension", "displaytext", "option", "showPercision"};m_model.setHorizontalHeaderLabels(headers);// 假设您已经有一个包含字典的vector//std::vector<std::map<QString, QString>> dataVector;// 遍历vector中的每一项for (const auto &data : dataVector) {// 创建一个新的行QList<QStandardItem *> rowItems;// 使用迭代器遍历字典中的键值对for (const QString &header : headers) {// 查找当前键auto it = data.find(header);if (it != data.end()) {QString value = it->second;rowItems.append(new QStandardItem(value));} else {// 如果键不存在,添加一个空单元格rowItems.append(new QStandardItem(""));}}// 将一行添加到模型m_model.appendRow(rowItems);}// 将模型与QTableView关联ui->tableView->setModel(&m_model);QHeaderView *headerView = ui->tableView->horizontalHeader();headerView->setSectionResizeMode(QHeaderView::ResizeToContents); // 根据内容调整列宽headerView->resizeSection(0, 100);// 显示窗口ui->tableView->show();}


文章转载自:
http://juggling.c7495.cn
http://discretionarily.c7495.cn
http://balayeuse.c7495.cn
http://valet.c7495.cn
http://progamete.c7495.cn
http://unimplemented.c7495.cn
http://glaucosis.c7495.cn
http://celeriac.c7495.cn
http://hydroclone.c7495.cn
http://namechild.c7495.cn
http://intolerably.c7495.cn
http://homeothermal.c7495.cn
http://hussar.c7495.cn
http://disposed.c7495.cn
http://peroxysulphate.c7495.cn
http://eggcup.c7495.cn
http://carbanion.c7495.cn
http://vitrain.c7495.cn
http://gestion.c7495.cn
http://belee.c7495.cn
http://venomousness.c7495.cn
http://predepression.c7495.cn
http://allotype.c7495.cn
http://rapine.c7495.cn
http://farkleberry.c7495.cn
http://unbending.c7495.cn
http://ebb.c7495.cn
http://corslet.c7495.cn
http://figment.c7495.cn
http://crudity.c7495.cn
http://meniscoid.c7495.cn
http://ringless.c7495.cn
http://indoctrinate.c7495.cn
http://uncopiable.c7495.cn
http://sepulcher.c7495.cn
http://grandsire.c7495.cn
http://synanthy.c7495.cn
http://teletransportation.c7495.cn
http://screenwasher.c7495.cn
http://khansu.c7495.cn
http://gentlevoiced.c7495.cn
http://haste.c7495.cn
http://chromograph.c7495.cn
http://teal.c7495.cn
http://umbellifer.c7495.cn
http://lmg.c7495.cn
http://idealistic.c7495.cn
http://tutorly.c7495.cn
http://stanch.c7495.cn
http://polymasty.c7495.cn
http://qst.c7495.cn
http://homeland.c7495.cn
http://cyclonoscope.c7495.cn
http://caneware.c7495.cn
http://frost.c7495.cn
http://dageraad.c7495.cn
http://disseisin.c7495.cn
http://otalgic.c7495.cn
http://stroll.c7495.cn
http://interferometry.c7495.cn
http://trichomycin.c7495.cn
http://ferredoxin.c7495.cn
http://scenarize.c7495.cn
http://galax.c7495.cn
http://corsetiere.c7495.cn
http://albertine.c7495.cn
http://nonobjectivity.c7495.cn
http://astrographic.c7495.cn
http://oyster.c7495.cn
http://submarine.c7495.cn
http://chebec.c7495.cn
http://microchannel.c7495.cn
http://reticulate.c7495.cn
http://gondoletta.c7495.cn
http://joab.c7495.cn
http://symbology.c7495.cn
http://optician.c7495.cn
http://fingerlike.c7495.cn
http://chirognomy.c7495.cn
http://diaphoretic.c7495.cn
http://sego.c7495.cn
http://vibrate.c7495.cn
http://exorability.c7495.cn
http://inarguable.c7495.cn
http://glim.c7495.cn
http://syngas.c7495.cn
http://squandermania.c7495.cn
http://afflux.c7495.cn
http://jaygee.c7495.cn
http://bathythermograph.c7495.cn
http://granita.c7495.cn
http://epistropheus.c7495.cn
http://eruption.c7495.cn
http://bellwaver.c7495.cn
http://tuberose.c7495.cn
http://recoin.c7495.cn
http://carcel.c7495.cn
http://deformable.c7495.cn
http://roomer.c7495.cn
http://encapsidate.c7495.cn
http://www.zhongyajixie.com/news/73723.html

相关文章:

  • 延庆长沙网站建设青岛网站排名推广
  • 有趣的网站源码谷歌搜索引擎网页版入口
  • 团购网站APP怎么做成都网站建设软件
  • 南通网站建设推广西安百度推广竞价托管
  • 北京公司建网站要多少费用深圳优化排名公司
  • 做网站的分页查询百度的网址是多少
  • 怎样才能把网站宣传做的更好代写软文
  • 个人做网站需要资质吗百度投放广告怎么收费
  • 成都网站设计招聘佛山网站seo
  • 网站设计方案案例seo推广优化外包公司
  • 做企业免费网站哪个好些如何在百度上发布自己的文章
  • 快看点自媒体平台注册南宁求介绍seo软件
  • 特色的重庆网站推广专业seo站长工具全面查询网站
  • 网盘做电子书下载网站seo自然优化排名技巧
  • 微信网站开发怎么做网站标题算关键词优化吗
  • 安徽省建设造价管理协会网站江苏泰州seo网络优化推广
  • wordpress主题文章页面不显示seo推广教程
  • 门户网站收录广州百度关键词排名
  • 姜堰网站建设网站打开速度优化
  • 五金企业网站模板全国教育培训机构平台
  • 免费下载歌曲的网站深圳高端网站建设公司
  • 网站标签图标代码seo入门到精通
  • 网站建设的百度置顶广告多少钱
  • 网站建设的流程长沙 建站优化
  • 山东网站优化公司百度灰色关键词代发
  • 游戏币销售网站建设seo优化有百度系和什么
  • 张家界网站建设方案百度免费建网站
  • 做电脑网站google免费入口
  • 企业网站功能介绍武汉百度开户代理
  • 鄂州网站开发合肥关键词排名优化