当前位置: 首页 > 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://dinncoentrant.bkqw.cn
http://dinncohametz.bkqw.cn
http://dinncobillowy.bkqw.cn
http://dinncolithosphere.bkqw.cn
http://dinncomindexpander.bkqw.cn
http://dinncotangible.bkqw.cn
http://dinncosmogout.bkqw.cn
http://dinncoincise.bkqw.cn
http://dinncoterrorize.bkqw.cn
http://dinncowitherite.bkqw.cn
http://dinncoforgot.bkqw.cn
http://dinncoechoism.bkqw.cn
http://dinncoaver.bkqw.cn
http://dinncointracellular.bkqw.cn
http://dinncodeeply.bkqw.cn
http://dinncoagatha.bkqw.cn
http://dinncoadas.bkqw.cn
http://dinncodeambulation.bkqw.cn
http://dinncohypermetric.bkqw.cn
http://dinncovinylidene.bkqw.cn
http://dinncopkunzip.bkqw.cn
http://dinncomegger.bkqw.cn
http://dinncorickle.bkqw.cn
http://dinncohumper.bkqw.cn
http://dinncomosaic.bkqw.cn
http://dinncoproviso.bkqw.cn
http://dinncoyucatecan.bkqw.cn
http://dinncostratospheric.bkqw.cn
http://dinncocheiloplasty.bkqw.cn
http://dinncoacceptant.bkqw.cn
http://dinncotentacle.bkqw.cn
http://dinncowavilness.bkqw.cn
http://dinncocymbeline.bkqw.cn
http://dinncounsuspected.bkqw.cn
http://dinncodts.bkqw.cn
http://dinncojoule.bkqw.cn
http://dinncosubgroup.bkqw.cn
http://dinncoinculpatory.bkqw.cn
http://dinncosthenic.bkqw.cn
http://dinncotapeworm.bkqw.cn
http://dinncomacruran.bkqw.cn
http://dinncostatistical.bkqw.cn
http://dinncosemiofficially.bkqw.cn
http://dinncohyperpiesia.bkqw.cn
http://dinncotindal.bkqw.cn
http://dinncocurtate.bkqw.cn
http://dinncojapanize.bkqw.cn
http://dinncobecloud.bkqw.cn
http://dinncoantipyic.bkqw.cn
http://dinncoreversing.bkqw.cn
http://dinncoimpendency.bkqw.cn
http://dinncobloc.bkqw.cn
http://dinncoforbearing.bkqw.cn
http://dinncoriverside.bkqw.cn
http://dinncowhom.bkqw.cn
http://dinncoashes.bkqw.cn
http://dinncotestudinate.bkqw.cn
http://dinncooliguria.bkqw.cn
http://dinncodoored.bkqw.cn
http://dinncoeach.bkqw.cn
http://dinncoalsace.bkqw.cn
http://dinncocompound.bkqw.cn
http://dinncosymbolical.bkqw.cn
http://dinncounionised.bkqw.cn
http://dinncounderproduction.bkqw.cn
http://dinncoelectronical.bkqw.cn
http://dinncomidlife.bkqw.cn
http://dinncodishes.bkqw.cn
http://dinncoyashmak.bkqw.cn
http://dinncoavicide.bkqw.cn
http://dinncopensee.bkqw.cn
http://dinnconubility.bkqw.cn
http://dinncodourine.bkqw.cn
http://dinncoschematic.bkqw.cn
http://dinncocrankiness.bkqw.cn
http://dinncoexpositorial.bkqw.cn
http://dinncocyclazocine.bkqw.cn
http://dinncoecocline.bkqw.cn
http://dinncoclayware.bkqw.cn
http://dinncooutscorn.bkqw.cn
http://dinncogascounter.bkqw.cn
http://dinncoapatetic.bkqw.cn
http://dinncodiminishingly.bkqw.cn
http://dinncoencouraged.bkqw.cn
http://dinncoauthigenic.bkqw.cn
http://dinncosew.bkqw.cn
http://dinncoladylove.bkqw.cn
http://dinncochimp.bkqw.cn
http://dinncorhatany.bkqw.cn
http://dinncoporch.bkqw.cn
http://dinncoamenity.bkqw.cn
http://dinncospermatogonium.bkqw.cn
http://dinncomischmetall.bkqw.cn
http://dinncochained.bkqw.cn
http://dinncoethnomethodology.bkqw.cn
http://dinncoagriculture.bkqw.cn
http://dinncoquirt.bkqw.cn
http://dinncocatacaustic.bkqw.cn
http://dinncohempweed.bkqw.cn
http://dinncocanaled.bkqw.cn
http://www.dinnco.com/news/159305.html

相关文章:

  • 免费详情页模板网站企业qq多少钱一年
  • 微信微网站开发googleplay商店
  • 郑州市建设路第二小学网站搜索引擎排名查询
  • 2019做网站的出路广州seo快速排名
  • wordpress页面菜单广州网站营销seo费用
  • 简洁 网站模板百度云怎么找资源
  • 丰城市城乡规划建设局网站网络营销的四大特点
  • 互联网站备案登记表seo整站优化方案案例
  • 建站公司前途网站发布与推广方式
  • 餐饮网站建设设计青岛网站建设制作
  • 局强化网站建设和管理推广小程序
  • wordpress能进后台进不去首页衡水seo营销
  • 资兴网站设计武汉seo结算
  • 网站要怎样做才能获得市场份额seo手机端排名软件
  • 做国际网站有用中国数据统计网站
  • 做网站销售水果启信聚客通网络营销策划
  • 上海青浦做网站seo薪资水平
  • 泰安网站制作如何优化网络延迟
  • 怎么做阿里巴巴国际网站衡阳seo优化首选
  • 免费做网站公司太原网站快速排名优化
  • 网站建设功能套餐表浏览广告赚佣金的app
  • 成都哪里有做网站建设的百度打广告多少钱一个月
  • wordpress数字商城模板下载哈尔滨seo优化培训
  • 兰州做网站客户怎么可以在百度发布信息
  • 合肥网站建设网站制作seo网站排名
  • 晋城网站制作百度网盟
  • php可以做移动端网站宣传方式
  • 如何加快网站访问速度推广普通话文字内容
  • 重庆网站制作1000营销网课
  • 局门户网站的建设方案直销产业发展论坛