From a251d988fb5cbc73f6fbe3aba8e4ab2055700783 Mon Sep 17 00:00:00 2001 From: touwoyimuli Date: Mon, 23 Sep 2019 00:00:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9B=E5=BB=BAUI=E5=92=8C=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0init()=E5=87=BD=E6=95=B0=EF=BC=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=80=BC=E5=88=B0QTableView=E5=92=8CQStandar?= =?UTF-8?q?dItemModel=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExQStandardItemModel.cpp | 122 +++++++++ QtQStandardItemModelEx/ExQStandardItemModel.h | 40 +++ .../ExQStandardItemModel.ui | 259 ++++++++++++++++++ .../QtQStandardItemModelEx.pro | 45 +++ QtQStandardItemModelEx/images/Image001.png | Bin 0 -> 797 bytes QtQStandardItemModelEx/images/Image002.png | Bin 0 -> 1629 bytes QtQStandardItemModelEx/images/Image003.png | Bin 0 -> 865 bytes QtQStandardItemModelEx/images/Image004.png | Bin 0 -> 282 bytes QtQStandardItemModelEx/images/Image005.png | Bin 0 -> 287 bytes QtQStandardItemModelEx/images/Image006.png | Bin 0 -> 334 bytes QtQStandardItemModelEx/images/Image007.jpg | Bin 0 -> 957 bytes QtQStandardItemModelEx/images/Image008.jpg | Bin 0 -> 827 bytes QtQStandardItemModelEx/images/Image009.jpg | Bin 0 -> 826 bytes QtQStandardItemModelEx/images/Image010.jpg | Bin 0 -> 906 bytes QtQStandardItemModelEx/images/Image011.jpg | Bin 0 -> 607 bytes QtQStandardItemModelEx/images/Image012.png | Bin 0 -> 1301 bytes QtQStandardItemModelEx/main.cpp | 11 + QtQStandardItemModelEx/qt.ico | Bin 0 -> 4286 bytes QtQStandardItemModelEx/resources.qrc | 16 ++ QtQStandardItemModelEx/录入的人员信息.txt | 14 + 20 files changed, 507 insertions(+) create mode 100644 QtQStandardItemModelEx/ExQStandardItemModel.cpp create mode 100644 QtQStandardItemModelEx/ExQStandardItemModel.h create mode 100644 QtQStandardItemModelEx/ExQStandardItemModel.ui create mode 100644 QtQStandardItemModelEx/QtQStandardItemModelEx.pro create mode 100644 QtQStandardItemModelEx/images/Image001.png create mode 100644 QtQStandardItemModelEx/images/Image002.png create mode 100644 QtQStandardItemModelEx/images/Image003.png create mode 100644 QtQStandardItemModelEx/images/Image004.png create mode 100644 QtQStandardItemModelEx/images/Image005.png create mode 100644 QtQStandardItemModelEx/images/Image006.png create mode 100644 QtQStandardItemModelEx/images/Image007.jpg create mode 100644 QtQStandardItemModelEx/images/Image008.jpg create mode 100644 QtQStandardItemModelEx/images/Image009.jpg create mode 100644 QtQStandardItemModelEx/images/Image010.jpg create mode 100644 QtQStandardItemModelEx/images/Image011.jpg create mode 100644 QtQStandardItemModelEx/images/Image012.png create mode 100644 QtQStandardItemModelEx/main.cpp create mode 100644 QtQStandardItemModelEx/qt.ico create mode 100644 QtQStandardItemModelEx/resources.qrc create mode 100644 QtQStandardItemModelEx/录入的人员信息.txt diff --git a/QtQStandardItemModelEx/ExQStandardItemModel.cpp b/QtQStandardItemModelEx/ExQStandardItemModel.cpp new file mode 100644 index 0000000..cfc542f --- /dev/null +++ b/QtQStandardItemModelEx/ExQStandardItemModel.cpp @@ -0,0 +1,122 @@ +#include "ExQStandardItemModel.h" +#include "ui_ExQStandardItemModel.h" +#include +#include + +ExQStandardItemModel::ExQStandardItemModel(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::ExQStandardItemModel) +{ + ui->setupUi(this); + setWindowTitle(QObject::tr("QTableView和QStandardItemModel的用法")); + + ui->mainToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); //设置主工具栏的图标样式风格 + + m_labCurrFile = new QLabel("当前文件:", this); //设置状态栏 + m_labCellPos = new QLabel("当前单元格:", this); + m_labCellText = new QLabel("单元格内容:", this); + m_labCurrFile->setMinimumWidth(200); + m_labCellPos->setMinimumWidth(200); + m_labCellText->setMinimumWidth(200); + ui->statusBar->addWidget(m_labCurrFile); + ui->statusBar->addWidget(m_labCellPos); + ui->statusBar->addWidget(m_labCellText); + + m_model = new QStandardItemModel(2, 6, this); //设置数据模型,一开始设置为默认的2行6列表的一个表 + m_selectModet = new QItemSelectionModel(m_model, this); //设置选择模型 + + ui->tableView->setModel(m_model); //设置数据模型 + ui->tableView->setSelectionModel(m_selectModet); //设置选择模型 + ui->tableView->setSelectionMode(QAbstractItemView::ExtendedSelection); //设置选择模式 + ui->tableView->setSelectionBehavior(QAbstractItemView::SelectItems); //设置选择行为 + + connect(m_selectModet, SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(onCurrentChanged(QModelIndex, QModelIndex))); //选择当前单元格变化时的信号与槽 +} + +ExQStandardItemModel::~ExQStandardItemModel() +{ + delete ui; +} + +//从list初始化数据模型QTableView里面 +void ExQStandardItemModel::init(QStringList &list) +{ + int rowCount = list.count(); //文本行数,第一行为表头 + m_model->setRowCount(rowCount - 1); + + QString header = list.at(0); + QStringList headerList = header.split(QRegExp("\\s+"), QString::SkipEmptyParts); //通过一个或者多个空格或者tab按键切割 + m_model->setHorizontalHeaderLabels(headerList); //设置表头 + + QStandardItem *item = nullptr; //此处开始,设置表格数据 + QStringList tempList; + int j = 0; + + for (int i = 1; i < rowCount; i++) { + QString aLineText = list.at(i); + tempList = aLineText.split(QRegExp("\\s+"), QString::SkipEmptyParts);//正则表达式中\s匹配任何空白字符,包括空格、制表符、换页符等等, 等价于[ \f\n\r\t\v] + + for ( j = 0; j < 6 - 1; j++) { //设置前5列的item + item = new QStandardItem(tempList.at(j)); + m_model->setItem(i - 1, j, item); + } + + item = new QStandardItem(tempList.at(j)); //最后一列的item + item->setCheckable(true); //设置有检查框 + + if ( tempList.at(j) == "https://www.google.com") + item->setCheckState(Qt::Unchecked); + else + item->setCheckState(Qt::Checked); + + m_model->setItem(i - 1, 5, item); + } +} + +//当前单元格发生变化时 +void ExQStandardItemModel::onCurrentChanged(const QModelIndex ¤t, const QModelIndex &previous) +{ + +} + + +//action+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +//打开和导入文件,并且在plainTextEdit里面显示 +void ExQStandardItemModel::on_actOpen_triggered() +{ + QString currPath = QCoreApplication::applicationDirPath(); + QString fileName = QFileDialog::getOpenFileName(this, "打开一个文件", currPath, "导入数据文件(*txt); 所有文件(*.*)"); + + if (fileName.isEmpty()) + return; + + QStringList list; + QFile file(fileName); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { //只读形式打开文本文件 + QTextStream stream(&file); //用文本流读取文件 + ui->plainTextEdit->clear(); + + while (!stream.atEnd()) { //读取文本中文本的内容 + QString str = stream.readLine(); + ui->plainTextEdit->appendPlainText(str); + list.append(str); + } + + file.close(); //关闭 + m_labCurrFile->setText("当前文件:" + fileName); //设置状态栏 + + ui->actAppend->setEnabled(true); //设置action的Enabled的属性 + ui->actInsert->setEnabled(true); + ui->actDelete->setEnabled(true); + ui->actSave->setEnabled(true); + } + + init(list); //初始化.txt的数据 +} + + +//在表格的最后一行添加一行 +void ExQStandardItemModel::on_actAppend_triggered() +{ + +} diff --git a/QtQStandardItemModelEx/ExQStandardItemModel.h b/QtQStandardItemModelEx/ExQStandardItemModel.h new file mode 100644 index 0000000..15fd0e6 --- /dev/null +++ b/QtQStandardItemModelEx/ExQStandardItemModel.h @@ -0,0 +1,40 @@ +#ifndef EXQSTANDARDITEMMODEL_H +#define EXQSTANDARDITEMMODEL_H + +#include +#include +#include +#include + +namespace Ui { +class ExQStandardItemModel; +} + +class ExQStandardItemModel : public QMainWindow +{ + Q_OBJECT + +public: + explicit ExQStandardItemModel(QWidget *parent = nullptr); + ~ExQStandardItemModel(); + +private: + void init(QStringList& list); //从list初始化数据模型 + +private slots: + void onCurrentChanged(const QModelIndex& current, const QModelIndex& previous); //当前单元格发生变化时 + void on_actOpen_triggered(); //打开和导入文件,并且在plainTextEdit里面显示 + void on_actAppend_triggered(); //在表格的最后一行添加一行 + +private: + Ui::ExQStandardItemModel *ui; + + QLabel *m_labCurrFile; //当前文件 + QLabel *m_labCellPos; //当前单元格行列号 + QLabel *m_labCellText; //当前单元格数据内容 + QStandardItemModel *m_model; //数据模型 + QItemSelectionModel *m_selectModet; //选择模型 + +}; + +#endif // EXQSTANDARDITEMMODEL_H diff --git a/QtQStandardItemModelEx/ExQStandardItemModel.ui b/QtQStandardItemModelEx/ExQStandardItemModel.ui new file mode 100644 index 0000000..68e7b70 --- /dev/null +++ b/QtQStandardItemModelEx/ExQStandardItemModel.ui @@ -0,0 +1,259 @@ + + + ExQStandardItemModel + + + + 0 + 0 + 739 + 403 + + + + ExQStandardItemModel + + + + + + + Qt::Horizontal + + + + + + + Table View: + + + + + + + + + + + + + + PlainTextEdit: + + + + + + + + + + + + + + + + 0 + 0 + 739 + 23 + + + + + + TopToolBarArea + + + false + + + + + + + + + + + + + + + + + + + + + :/images/Image011.jpg:/images/Image011.jpg + + + 打开 + + + 打开文件夹 + + + Ctrl+1 + + + + + + :/images/Image001.png:/images/Image001.png + + + 保存 + + + 保存文件 + + + Ctrl+S + + + + + + :/images/Image012.png:/images/Image012.png + + + 添加 + + + 添加一行 + + + + + + :/images/Image008.jpg:/images/Image008.jpg + + + 插入 + + + 插入一行 + + + Ins + + + + + + :/images/Image009.jpg:/images/Image009.jpg + + + 删除 + + + 删除一行 + + + Del + + + + + + :/images/Image007.jpg:/images/Image007.jpg + + + 退出 + + + 退出程序 + + + Ctrl+0 + + + + + + :/images/Image010.jpg:/images/Image010.jpg + + + 预览 + + + 预览数据模型到文本框 + + + Ctrl+2 + + + + + + :/images/Image004.png:/images/Image004.png + + + 居左 + + + 文字左对齐 + + + Ctrl+3 + + + + + + :/images/Image006.png:/images/Image006.png + + + 居中 + + + 文本居中 + + + Ctrl+4 + + + + + + :/images/Image005.png:/images/Image005.png + + + 居右 + + + 文本右对齐 + + + Ctrl+5 + + + + + true + + + + :/images/Image003.png:/images/Image003.png + + + 粗体 + + + 文字设置粗体 + + + Ctrl+B + + + + + + + + + diff --git a/QtQStandardItemModelEx/QtQStandardItemModelEx.pro b/QtQStandardItemModelEx/QtQStandardItemModelEx.pro new file mode 100644 index 0000000..f9056fb --- /dev/null +++ b/QtQStandardItemModelEx/QtQStandardItemModelEx.pro @@ -0,0 +1,45 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2019-09-21T21:51:12 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = QtQStandardItemModelEx +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which has been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +CONFIG += c++11 + +SOURCES += \ + main.cpp \ + ExQStandardItemModel.cpp + +HEADERS += \ + ExQStandardItemModel.h + +FORMS += \ + ExQStandardItemModel.ui + +RC_ICONS += qt.ico + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +RESOURCES += \ + resources.qrc diff --git a/QtQStandardItemModelEx/images/Image001.png b/QtQStandardItemModelEx/images/Image001.png new file mode 100644 index 0000000000000000000000000000000000000000..6fdf4fc169f4e6a7adb00230cc797c786c5d46b6 GIT binary patch literal 797 zcmV+&1LFLNP)K&Ig2^ZTjU^$L^X z4UpRnkJ+Qp>i+-#@c8}j_x$JY^XBdH^!4?(+U`oK;7Y3DO0Vfkuh}GX z(eu{n^wsF|Ub$J10000YbW%=J0H*f#_WQ^J0|d&;0S5@m$_xt%&CCx1&B?ge4G;GA z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#3M1XSSVu=Ll4XK>J=_CsId2ch>rEhU zFawESVmq!hFttK=s`lQhF01WaFC<3{V(adD68gUD9s_ZG)LjW);8vRlcUj!fIp~Vb z!VT&E`%|#gFk8uZcb0$KSzWfb>n&k;5QErU`j8X3B~mqsoL~%o@RK3(13Cy(^uC!tLLi8l~EsZ7VrkRXF?DNkQO`6 zk!BJB+8YLMFbW=j1SWiuq<;R=?v~YSKC4yA8b;nH2N(`Ts%ADz4paFgzU9JhO1Zr- z=?lY5C<>!&7=mO6i@I^(bE#%z)&Lh5gkUfTwZ!tl$q*dsn}%)@CoG@sgIrQSFFG{v zqfBF2Td1S=?6~R*Y$t-(SZt&k`#xbe#op0Ibf7Nm8K`^D@1B^x39tW!0qB8jwcYRc zL)#NKENikn1uf)7rlle(BeN^lsaMrZ??!AceRyAa bl)3&dHTX%8(T-8}00000NkvXXu0mjf!Q~Gi literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image003.png b/QtQStandardItemModelEx/images/Image003.png new file mode 100644 index 0000000000000000000000000000000000000000..40101093060f06c38e93b4b400cc2fa37edeb270 GIT binary patch literal 865 zcmV-n1D^beP)P)t-s0000) zL_kDDKtx19L_|PDL_kDDKtx19L_|Osj?W&I*&CYU8=K@FmDm`N(nLf+L_|OxmDw7a z<7vI_X}s-cx8-NH5&5|`r=nB)nR8^{LeD zsMG6dxaFJE^#A|=>-PPN%<}&J{)ffs;_UME_4S(4^X~Wk?e_ea((_=s?M<=k^z`)o z{{H^||Hk0&%;@;d>G^FMK3V_(0915RPE!B_1OW#K3JVQ+&C1HncLEQ*xcT|{`TYF2 z_rZF9fRg$7jCgr~#rMl4B+ZJ6WKu6l`7!xi^z%{;Q+ezC{OWQKRr&P({`2`=_4Qst z<>=_?MAd*Z$YTyk zVueH$ho)(lgMey)n!z}VWS_tmg$7#CpPMm+}zsUc_HL=cW*ygmt^wbt@I96Iy|aF rl9!H8Qm0UW}(^nPd@00000NkvXXu0mjf)3>{l literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image004.png b/QtQStandardItemModelEx/images/Image004.png new file mode 100644 index 0000000000000000000000000000000000000000..89e496a8374ae3562d3058a809acffbcac1e422a GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TG#sNMdu0Yzw#Q_%r%CfL9v#_uL z89>0q#Kg?ZJddMv5|G1H666=mz{tYN$jQaT%Wr%3bO}(j$J50zMC1J0$=-Yo3Ouad znIHM@{okT=cR}Xr&P@vXGuv#`7(S%2_DD=onPOq6>G`a!P>Nl3qPObV)4Oth#@yE3 z%64=SZ*q|zTSw02TQYC!T5=C%o!|KGdf49>r-QN2|4or!Gtry5TBM-7Cp`P8*}uE9 zYPYw@iDrAPz7rXo@$c-d%hAf8m(RJ@^!YSj!#_b*VO@(rklQ_7{an^LB{Ts5%s5=X literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image005.png b/QtQStandardItemModelEx/images/Image005.png new file mode 100644 index 0000000000000000000000000000000000000000..9b5a39ce8483d3e2eb959c22b08ebd2f69a8b2d5 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^av;pY3?xs=ZJr3E3<7*YT!FNUivunMlx1OIW?^9g zGJt@IiD`C9zY&ndRTAVE%)rRP%E-yZ#LI7c_H+qQbc&~oV~E7%?SZGkfkr3_cvRM=MVTwznX^W2d6C}YpW6_{d?~#}JFt zYbSdPwJ7koMAsQMG=1OyMyI5qkZH$+(D2gG$$L}|9NxYnbpb=}7YD{`HyfEURM{9d zEMT~CwOt~)C-L_7RY5=R2MYa}uz#zR^@(_f(yLm(q8P*1d!9(o=HmQjUw4LKMvUUY zqUB|eg7yE0xU0IhKX|`S(Nb;g-5dKo(k%B+I`e3W)TE^4x}FnV6e~~Lhh}-G9pne9 zxV`hIpOEtZr}sUcy;~A@+w#S3j3^P6``2_j6xdp@o1cgOJMMZh|#U;coyG6VInuyV4pa*FVB^NNrR z{vTivP+(?MVqg+vWEN!ne}qAbfdS|;1|-17&dR~S$O4qp5dg|D0$t3=#12uw z$OLpg8@nKbkfN}Xp`(asqKcDiU}57$plWfDpBa%1VqjroVg^d62m(b}fnJA8f{YPV zWH5AO6$+fFl(_NW|62?^KxrmHW&cS4f7YB zK7ZoXym`B7RxAy67QWGD-2HCa_s3JNwEFuko6GZR#X{?&XWPEraKFyaywv%nj^4yG zFZc9mi~EaKq-7q-32IHs_kGIo^3(^fO&eKiKVR+X*gfytxAmXa|9z>>m(I6qQjcYo zrMGrm$X2P4BeyrLdimb%U7Hz88^g!*{rfs~^L0J8)`@klp6p{66}njDn!)s}UD38j z9W#?dQW7ja9@dQWFPdifXj`ajc=|C_*4?$+@8AC%YgKbA%I^1Z9;Mcn!`trl-;tX7 z?dYCM9>;$%e5%{uVO#WGOlS^> RH54hNU3;!L|8(~Mn*a*IWqbet literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image008.jpg b/QtQStandardItemModelEx/images/Image008.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f963db2746da4cd0bb1d42194d370b569d1c3848 GIT binary patch literal 827 zcmex=``2_j6xdp@o1cgOJMMZh|#U;coyG6VInuyV4pa*FVB^NNrR z{vTivP+(?MVqg+vWEN!ne}qAbfsuicl>rH`u`@6M?E%VZ3otM-0@*-UL**Hn zfX-)Q7ZhR;5mQVQR&rD}Gzt_|T?$kz&d9*bh-3@{10xeF15iRnkOAm-MkF~#K?X%8 zX2Zb5|F;-;fSQ;DnFSf_8D8?GJv!YdwKe+TW?l17-@SWHx6RACamz#V%=*P1FV?L2 z9bm~JSuVi#lx4%!lNo0tLijcxeD{2VtaA9u{|x?J=iCH>ufp7YP*DzyEyut3?8r zP950!d;ayt!zM~!PE;G@&s;t2Mo^Bs>UZ}03QJZleU@>yXdm>0Y40R_9NS+nTD9bB+^menGgY!OFK<5brsq^d7T>BfYnDbv zPMz8{#o3rsMM~q{iaMM5Htsi5e16qtS&n(D8% z{KX$^|L&;kNJ~^{c9p%#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git a/QtQStandardItemModelEx/images/Image010.jpg b/QtQStandardItemModelEx/images/Image010.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b7cbb9ad0d007eadf3b69785135c5dd5ca3c434f GIT binary patch literal 906 zcmex=``2_j6xdp@o1cgOJMMZh|#U;coyG6VInuyV4pa*FVB^NNrR z{vTivP+(?MVqg+vWEN!ne}qAjfq{vckpT&?vN5u-a{{Gw1sIr^m>8LvSXfyh z@{CMC*Ru(-3n?-PD;YW_a)_un1&XSf1~meeOE5ApGoqNp0CY1eP)1IWk%5tgi5X!D zqae^$Lm@@S!Vmv%G4KE#z$C~l$Y9U#BJbpmx6`ef%R{baJUn>((W{iT@u$!0&p+dx zX40$NTQ`4dQN;Fl0pibGJnchQtx%G+y4R{yMcSIKuxx$p6l-Wvi-JSLH{3ja?jcH0|lR$Ay>fu9f+8adVZTsV7(850$w0 zLT+~!YkrdSuybF|6X(WrHe`3u8M9TM=eMg?GB0MRP~RcPKf(Ra*QvMv*qxlU?R$~* zy{fCzZD!^q75FPxJP=ctettl%Ezx9ltn@3f?SJ(XcTYWbpl-?`6f!XB$o@Wry4>FnE1a>ZaDE%}WgTE=uWgsbe;ZnOc!zBe3@5 zgOyf?SAFA*fAh7c=KQOF`r8+_STFI|lAeEW(ZT4Y{p*8r<~cpIyBfjIIz@on@RL(t zeMZ^?!^c}?r>fiTynegv-qauST+4cD_p zgDQn2>^4a^+dwrkDoo4;L5d&An5C)8`tPqHolB=dT6 U>Slvjn=sQW73ufmx&Pk;0M3R>XaE2J literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image011.jpg b/QtQStandardItemModelEx/images/Image011.jpg new file mode 100644 index 0000000000000000000000000000000000000000..995f1509c714b06a8bddb41d8fab56b1f9aea8d5 GIT binary patch literal 607 zcmex=``2_j6xdp@o1cgOJMMZh|#U;coyG6VInuyV4pa*FVB^NNrR z{vTivP+(?MVqg+vWEN!ne}qAbfdS|;1|-13&dSEX%n6h;5MW?rW@ch$WoL!T zGcqx=Ft7@;DGCW28aXBwHnNK-1qCNBEGpi(=^{{v7|`F0NMz<23V`E~ZIR&}upp8O(mWqxjdNshVZzU0hs0e?a1cgEZ2GL%eRnJ)Lb<=><4 zf3BpkOnUTu`>*<0+g}LpdD6fA<*k*anbzShN4`GO&p#`jzvajl){eDBKW9Ap(Rt3Q O)J|>d3D3sh|2F}iytSDC literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/images/Image012.png b/QtQStandardItemModelEx/images/Image012.png new file mode 100644 index 0000000000000000000000000000000000000000..7c62593c4f7c174acf03dae5edc48f0c66a8e390 GIT binary patch literal 1301 zcmXX`2~bl<7!E=UTiWS?6 zCXe^RQ4!^kL#d(#Lb*Y!fPtE^0dl_g0=Wo~;yNju_c zK2F5~!BO$;D9fGLPYm6tlUbx4)Vn68 ztTvmiOk$FnW~l(o1muw=@~9F;nbg{>vah)@v8sGLv;?JH8H4)u7>3o1*ed@v5po2N z4GnTEs#K97Mr{~YJBnp?n3*CJ9I|GL(Gz{sv32^oQH(D}e;KsI*6O-YXKa<>uH*RgH8qw`&~g*PZ)ox>RZ{d1iqI4R4jJ`c&q;Ufr=4l(@|>aEt*V zcSf;C6RrWRwI8tz8C=80S%<@ZS7A3faHHL$vp6R#j@o}_C_;@nv30K>~9Xj37)r)+DXX8ooju)mabbL^Ui>)fEKVI$K65x!PQ5hU#yV0{XiGqjMEOJ z>u|*Zh8V+e9Je+FP~|2LbgL>@^)#(alj*=x6j_UBf8fiN zxOIvnDr*RvI=zeS)E?cfx>nHC7^dF8Sy_8(?DhEWI7V5ay=vh~|D-1kd8?OXD`|YS zXGN4K=i?9YO+F<3;3ZyXS7O#7S*%RW{8O7Z_r|EgH?iP82lKfs*ZW6MW$_CuuC3NR}mYnv1uRE+F zIi1f?W}L0yuk7SpQl{m3?-Nr3)c&2E6Je({EG6t7ut$8|{NjJ(Zrj1Rv*qB~e*x(b B<1YXJ literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/main.cpp b/QtQStandardItemModelEx/main.cpp new file mode 100644 index 0000000..40530df --- /dev/null +++ b/QtQStandardItemModelEx/main.cpp @@ -0,0 +1,11 @@ +#include "ExQStandardItemModel.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + ExQStandardItemModel w; + w.show(); + + return a.exec(); +} diff --git a/QtQStandardItemModelEx/qt.ico b/QtQStandardItemModelEx/qt.ico new file mode 100644 index 0000000000000000000000000000000000000000..0ee0568945377c30d5d973d89afcc31770cd8818 GIT binary patch literal 4286 zcmeHKdr(y86+io87ZyYwA_hySrjx{)Njo~7w3D=Go0O&*)2xbtP|_lTj{v^F6l<|4 z!TRE16coi*F_>DPiHV~$YSL&Lgk=|&m4~p)V}S)!47%0a{(A22URjA+|FAR3OzzI_ zp6@&7JHKBO?Lu5#%-ZBiRg$@WRi6TzUI$u#k!Uz4@+6%sBmDt|-5nU_e| z7fHeg@p7SVjknOZZ=`Vjy7MivgQDE}G#O0Oe_VLG8&NBA&`P!TV~z&n1pb#e?G?}cIT z&=`F2_fRJW4~F8#u}5(8_!tb9kHklFz0kAS7lZplFi;kZfgNhJq$t6h5IOG!{VQ~X z2S8Ikg_Bh8jEmPp%hXZkq`TBPS!M-yb_T3X;-}6Hkc0Gxn(s1;a2I2DF zQMg(b%I!v@XIn5j-}YnqC>qnhiyATZjC(_j`NC+@{_Pi}tBIyBD_$a)m&h4GCPW}OX$I{VzbSW->umrt_;?Pqz6}FObux$xM$Ce*qcgVDYBr!b^G2IH$T7-M9pWr$KL5339F zo}z&LQ50A4GT};|0`{%`=qwIL&%P)$WlzGtbj%TVcYHow2J@TWhi&JxXnQ-1;|HOu z1eh#6pNW=5zkM_;sXkHPDN*+Jc>vGiH2i4rS`h|XI zD+obbzCXG)`NFt>P!)G?KZ(=yJ2?s?X>55E&9|)}bZ^!&#|T*eqGf*>Ota;8pe{jy zx`aD*Vw($`gJqQxZF#=v*E(4YbQJn>d|$Nw zQHH8`In2olC+b-m6BT%WrW}W-%Td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%75gMfQ0?xEpe)zGt&?Wg%a9&lRi!mwam F{Vzx7jH3Vm literal 0 HcmV?d00001 diff --git a/QtQStandardItemModelEx/resources.qrc b/QtQStandardItemModelEx/resources.qrc new file mode 100644 index 0000000..9a367d9 --- /dev/null +++ b/QtQStandardItemModelEx/resources.qrc @@ -0,0 +1,16 @@ + + + images/Image001.png + images/Image002.png + images/Image003.png + images/Image004.png + images/Image005.png + images/Image006.png + images/Image007.jpg + images/Image008.jpg + images/Image009.jpg + images/Image010.jpg + images/Image011.jpg + images/Image012.png + + diff --git a/QtQStandardItemModelEx/录入的人员信息.txt b/QtQStandardItemModelEx/录入的人员信息.txt new file mode 100644 index 0000000..74f3cc5 --- /dev/null +++ b/QtQStandardItemModelEx/录入的人员信息.txt @@ -0,0 +1,14 @@ +(name) Ա(sex) (age) (cm) (kg) ϵ(blog) +Ͷľ Ů 18 175 57 https://touwoyimuli.github.io +֮ Ů 18 174 58 https://github.com/touwoyimuli +˱Ҳ Ů 18 173 59 https://www.google.com +ΪҲ Ů 18 172 60 https://www.google.com +Ͷľ Ů 18 171 56 https://www.google.com +֮ Ů 18 170 55 https://www.google.com +˱Ҳ Ů 18 176 54 https://www.google.com +ΪҲ Ů 18 177 53 https://www.google.com +Ͷľ Ů 18 178 52 https://www.google.com +֮ Ů 18 179 51 https://www.google.com +˱Ҳ Ů 18 180 50 https://www.google.com +ΪҲ Ů 18 181 49 https://www.google.com +Ը԰쳯Ϧ 18 182 48 https://blog.csdn.net/qq_33154343