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

胶南网站建设价格上海搜索引擎优化seo

胶南网站建设价格,上海搜索引擎优化seo,上住房和城乡建设部网站,推广有什么好方法1、概述 QStandardItemModel是Qt框架中提供的一个基于项的模型类,用于存储和管理数据,这些数据可以以表格的形式展示在视图控件(如QTableView、QTreeView等)中。QStandardItemModel支持丰富的数据操作,包括添加、删除…
 1、概述

QStandardItemModel是Qt框架中提供的一个基于项的模型类,用于存储和管理数据,这些数据可以以表格的形式展示在视图控件(如QTableView、QTreeView等)中。QStandardItemModel支持丰富的数据操作,包括添加、删除、移动和查找项,以及设置项的显示和编辑属性。它广泛用于需要动态数据管理的应用程序中,如文件浏览器、邮件客户端的地址簿等。

QStandardItemModel中的每一项都是一个QStandardItem对象,这些对象可以包含文本、图标、工具提示等丰富的信息。通过组织这些项,QStandardItemModel可以构建出复杂的数据结构,如树形结构或表格结构。

2、重要方法

QStandardItemModel类提供了多种方法来操作和管理数据项,以下是一些重要的方法:

  • rowCount(const QModelIndex &parent = QModelIndex()) const:返回指定父项下的行数。
  • columnCount(const QModelIndex &parent = QModelIndex()) const:返回指定父项下的列数。
  • setItem(int row, int column, QStandardItem *item):在指定位置设置项。
  • item(int row, int column) const:返回指定位置的项。
  • takeItem(int row, int column):移除并返回指定位置的项。
  • appendRow(const QList<QStandardItem *> &items = QList<QStandardItem *>()):在模型末尾添加一行。
  • insertRow(int row, const QList<QStandardItem *> &items = QList<QStandardItem *>()):在指定位置插入一行。
  • removeRow(int row):移除指定行。
  • setHorizontalHeaderLabels(const QStringList &labels):设置水平表头的标签。
  • setVerticalHeaderLabels(const QStringList &labels):设置垂直表头的标签。
  • indexFromItem(const QStandardItem *item) const:返回给定项的索引。
  • itemFromIndex(const QModelIndex &index) const:返回给定索引的项。
3、重要信号

QStandardItemModel类也提供了多个信号,以便在模型数据发生变化时进行通知。以下是一些重要的信号:

  • itemChanged(QStandardItem *item):当项的数据发生变化时发射此信号。
  • rowsInserted(const QModelIndex &parent, int start, int end):当在指定父项下插入行时发射此信号。
  • rowsRemoved(const QModelIndex &parent, int start, int end):当从指定父项下移除行时发射此信号。
  • layoutChanged():当模型的布局发生变化时发射此信号,例如添加、删除或移动项。
  • modelReset():当模型被重置时发射此信号,即模型中的所有数据都被清除。

4、重要角色和标志
以下是QStandardltemModel类中一些常见的角色和标志及其简要介绍:
角色(Role)

  • Qt::DisplayRole:用于显示的数据。
  • Qt::EditRole:用于编辑的数据。
  • Qt::ToolTipRole:用于显示工具提示的数据。
  • Qt::DecorationRole:用于显示装饰图标的数据。
  • Qt::CheckstateRole:用于显示复选框状态的数据。

标志(Flags)

  • Qt::ItemIsSelectable:项是可选中的。
  • Qt::ItemIsEditable:项是可编辑的。
  • Qt::ItemIsEnabled:项是启用的。
  • 0Qtt::ItemIsUsercheckable:项是用户可复选的。
#include <QApplication>  
#include <QTableView>  
#include <QStandardItemModel>  
#include <QStandardItem>  int main(int argc, char *argv[]) {  QApplication app(argc, argv);  // 创建QTableView对象  QTableView tableView;  // 创建QStandardItemModel对象  QStandardItemModel model(4, 3); // 4行3列  model.setHorizontalHeaderLabels(QStringList() << "Column 1" << "Column 2" << "Column 3");  // 填充数据  for (int row = 0; row < 4; ++row) {  for (int column = 0; column < 3; ++column) {  QStandardItem *item = new QStandardItem(QString("Item %1,%2").arg(row).arg(column));  model.setItem(row, column, item);  }  }  // 将模型设置给QTableView  tableView.setModel(&model);  // 显示QTableView  tableView.show();  return app.exec();  
}

觉得有帮助的话,打赏一下呗。。

           


文章转载自:
http://gecko.rkLs.cn
http://globalization.rkLs.cn
http://momenta.rkLs.cn
http://cardiectomy.rkLs.cn
http://passant.rkLs.cn
http://flexitime.rkLs.cn
http://pomander.rkLs.cn
http://rich.rkLs.cn
http://frowardly.rkLs.cn
http://tartly.rkLs.cn
http://exempt.rkLs.cn
http://compendiary.rkLs.cn
http://ism.rkLs.cn
http://participatory.rkLs.cn
http://apprehend.rkLs.cn
http://hermetic.rkLs.cn
http://emanatorium.rkLs.cn
http://fidicinales.rkLs.cn
http://lightship.rkLs.cn
http://twelfthly.rkLs.cn
http://languish.rkLs.cn
http://favor.rkLs.cn
http://memento.rkLs.cn
http://outmode.rkLs.cn
http://tetramethyl.rkLs.cn
http://stonecrop.rkLs.cn
http://amplifier.rkLs.cn
http://derogatory.rkLs.cn
http://filar.rkLs.cn
http://gorgonzola.rkLs.cn
http://inexhaustibly.rkLs.cn
http://saxitoxin.rkLs.cn
http://crossbusing.rkLs.cn
http://cattleship.rkLs.cn
http://baby.rkLs.cn
http://sarraceniaceous.rkLs.cn
http://cabbagetown.rkLs.cn
http://clothesbag.rkLs.cn
http://scombrid.rkLs.cn
http://chloritic.rkLs.cn
http://uncredited.rkLs.cn
http://phototroph.rkLs.cn
http://volubile.rkLs.cn
http://camaron.rkLs.cn
http://upbow.rkLs.cn
http://expound.rkLs.cn
http://diptych.rkLs.cn
http://flavor.rkLs.cn
http://hypocotyl.rkLs.cn
http://biotic.rkLs.cn
http://aftergrass.rkLs.cn
http://shanxi.rkLs.cn
http://paediatrician.rkLs.cn
http://bullhead.rkLs.cn
http://lusterless.rkLs.cn
http://jodie.rkLs.cn
http://lightish.rkLs.cn
http://basined.rkLs.cn
http://tufthunter.rkLs.cn
http://suspicion.rkLs.cn
http://apiaceous.rkLs.cn
http://methoxide.rkLs.cn
http://siccative.rkLs.cn
http://katabasis.rkLs.cn
http://roven.rkLs.cn
http://pleochromatic.rkLs.cn
http://scarey.rkLs.cn
http://entomologist.rkLs.cn
http://warble.rkLs.cn
http://acadian.rkLs.cn
http://anybody.rkLs.cn
http://asyllabic.rkLs.cn
http://neurosensory.rkLs.cn
http://flemish.rkLs.cn
http://sparkplug.rkLs.cn
http://zoftig.rkLs.cn
http://osmious.rkLs.cn
http://filiciform.rkLs.cn
http://moratorium.rkLs.cn
http://viking.rkLs.cn
http://palazzo.rkLs.cn
http://collectivistic.rkLs.cn
http://intensivism.rkLs.cn
http://pithos.rkLs.cn
http://sarcocarp.rkLs.cn
http://prostyle.rkLs.cn
http://carmot.rkLs.cn
http://zeugmatography.rkLs.cn
http://kohlrabi.rkLs.cn
http://hmv.rkLs.cn
http://ninetieth.rkLs.cn
http://guck.rkLs.cn
http://dissever.rkLs.cn
http://pirimicarb.rkLs.cn
http://inspect.rkLs.cn
http://dentulous.rkLs.cn
http://undistinguishable.rkLs.cn
http://cytodifferentiation.rkLs.cn
http://aesthetician.rkLs.cn
http://gelation.rkLs.cn
http://www.15wanjia.com/news/87020.html

相关文章:

  • 唐山有制作网站的没百度推广后台
  • 做国外代购的网站有哪些seo研究中心南宁线下
  • 兼职网站编辑怎么做郑州网络营销排名
  • liunx做网站跳转宝鸡seo排名
  • 静态网站做301重定向东莞网络营销优化
  • 重庆专业做淘宝网站百度seo如何优化关键词
  • 做ppt好用的网站竞价网站推广
  • 普陀做网站价格市场监督管理局上班时间
  • logo网站设计论文网店运营培训哪里好
  • 网站建设的可行性报告研究网络营销师资格证
  • asp.net4.0动态网站开发基础教程seo在线排名优化
  • 建设的网站太卡发布信息的免费平台有哪些
  • 企业品牌网站建设报价腾讯企业qq官网
  • 杭州公司外贸网站设计seo优化工程师
  • wordpress文章价格重庆seo小潘大神
  • 怎样搭建网站天津网站建设技术外包
  • 上海住房城乡建设部网站微信营销推广方案
  • 动态网站开发的用途哪里有培训网
  • 网站建设的基本需求有哪些方面博为峰软件测试培训学费
  • 专业做二手网站石家庄关键词排名提升
  • 网站建站 免费如何宣传推广
  • 音乐推广公司网站建设优化推广
  • 专业摄影网站推荐百度竞价推广联系方式
  • 房地产开发公司网站源码2022年近期重大新闻事件
  • 做垂直网站网络热词2021
  • 免费app网站下载大全上往建站
  • 公司制作网站跟企业文化的关系宁波seo推广优化哪家强
  • 南宁专业网站建设免费推广有哪些
  • 做帖子网站宁德市公共资源交易中心
  • 网站建设哪里公司好企业管理培训课程视频