Excel表格解析为QTableWidget

解析表格

在这里插入图片描述

头文件

#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QAxObject>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QDebug>
#include <QSet>
#include <QPoint>
#include <QFile>QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass CellInfo:public QObject{Q_OBJECT
public:explicit CellInfo(QObject* parent=nullptr);~CellInfo();QPair<int, int> id;QString text;QString bgColor;QString fgColor;int rowIndex = 1;int colIndex = 1;QString width = 0;QString heigth = 0;QString tPoint = 0 ;QString lPoint = 0 ;QString rPoint = 0 ;QString bPoint = 0 ;int colSpan=1;int rowSpan=1;QString type;QList<QString> typeDataList;
};class MainWindow : public QMainWindow
{Q_OBJECTpublic:MainWindow(QWidget *parent = nullptr);~MainWindow();
public:void displayWordTableInQTableWidget1(const QString& filePath);void displayWordTableInQTableWidget2(const QString& filePath);void displayExcelTableInQTableWidget1(const QString& filePath);
private:Ui::MainWindow *ui;QString filePath;QString excelPath;QString resTxt;QString cellWordOpenXMLtxt;QString xMLtxt;
};
#endif // MAINWINDOW_H

源代码

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFile>MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);this->filePath = "C:\\Users\\tirklee\\Desktop\\text.docx";this->excelPath = "C:\\Users\\tirklee\\Desktop\\1111.xlsx";this->resTxt = "C:\\Users\\tirklee\\Desktop\\Res.txt";this->cellWordOpenXMLtxt = "C:\\Users\\tirklee\\Desktop\\cellWordOpenXMLtxt.txt";this->xMLtxt = "C:\\Users\\tirklee\\Desktop\\XMLtxt.txt";//displayWordTableInQTableWidget2(filePath);displayExcelTableInQTableWidget1(excelPath);}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::displayWordTableInQTableWidget1(const QString &filePath)
{QAxObject word("Word.Application");word.setProperty("Visible", false);QAxObject* documents = word.querySubObject("Documents");QAxObject* document = documents->querySubObject("Open(const QString&)", filePath);if (!document) {qDebug() << "Failed to open the document.";return;}QAxObject* tables = document->querySubObject("Tables");int tableCount = tables->dynamicCall("Count").toInt();if (tableCount < 1) {qDebug() << "No table found in the document.";document->dynamicCall("Close()");word.dynamicCall("Quit()");return;}QAxObject* table = tables->querySubObject("Item(int)", 1);QAxObject* Rows = table->querySubObject("Rows");int rowCount = Rows->property("Count").toInt();QAxObject* Columns = table->querySubObject("Columns");int columnCount = Columns->property("Count").toInt();ui->tableWidget->setRowCount(rowCount);ui->tableWidget->setColumnCount(columnCount);QMap<QPair<int, int>, CellInfo*> cellMap;QSet<double> xPointSet;QSet<double> yPointSet;bool ok = true;QMap<int,int> zWidthMap;QMap<int,int> zHeightMap;for (int row = 1; row <= rowCount; ++row) {for (int col = 1; col <= columnCount && ok; ++col) {QAxObject* cell = table->querySubObject("Cell(int, int)", row, col);if (!cell) {ok = false;continue;}int rowSpan = 0;int colSpan = 0;for (int colX = 1; colX <= columnCount && ok; ++colX) {QAxObject* Column = Columns->querySubObject("Item(int)",colX);if (!Column || colX<col) {continue;}QAxObject* Cells = Column->querySubObject("Cells");if(!Cells){continue;}int cellCount = Cells->property("Count").toInt();for(int cellIndex=1;cellIndex<cellCount;cellIndex++){QAxObject* cellX = Column->querySubObject("Cells(int)",col);if(!cellX){continue;}int columnIndex = cellX->property("ColumnIndex").toInt();int rowIndex = cellX->property("RowIndex").toInt();if(row==rowIndex && columnIndex==col){colSpan = colSpan+1;}}}for (int rowX = 1; rowX <= rowCount; ++rowX) {QAxObject* Row = Rows->querySubObject("Item(int)",rowX);if (!Row || rowX<row) {continue;}QAxObject* Cells = Row->querySubObject("Cells");if(!Cells){continue;}int cellCount = Cells->property("Count").toInt();for(int cellIndex=1;cellIndex<cellCount;cellIndex++){QAxObject* cellX = Row->querySubObject("Cells(int)",col);if(!cellX){continue;}int columnIndex = cellX->property("ColumnIndex").toInt();int rowIndex = cellX->property("RowIndex").toInt();if(row==rowIndex && columnIndex==col){rowSpan = rowSpan+1;}}}CellInfo* cellInfo = new CellInfo;cellInfo->rowSpan = rowSpan;cellInfo->colSpan = colSpan;cellInfo->rowIndex = row;cellInfo->colIndex = col;QPair<int, int> point = QPair<int, int>(row,col);cellInfo->id = point;cellInfo->width = QString::number(cell->property("Width").toDouble(),'f',2);cellInfo->heigth = QString::number(cell->property("Height").toDouble(),'f',2);double zWidth = zWidthMap.value(row)+cellInfo->width.toInt();double zHeight = zHeightMap.value(col)+cellInfo->heigth.toInt();zWidthMap.insert(row,zWidth);zHeightMap.insert(col,zHeight);if(col>1){int lCIndex = col-1;const QPair<int, int> lPoint = QPair<int, int>(row,lCIndex);if(cellMap.contains(lPoint)){CellInfo* cellInfoL = cellMap.value(lPoint);cellInfo->lPoint = cellInfoL->rPoint;}}if(row>1){int tRIndex = row-1;QPair<int, int> tPoint = QPair<int, int>(tRIndex,col);if(cellMap.contains(tPoint)){CellInfo* cellInfoT = cellMap.value(tPoint);cellInfo->tPoint = cellInfoT->bPoint;}}double lPoint = cellInfo->lPoint.toDouble();double tPoint = cellInfo->tPoint.toDouble();double width = cellInfo->width.toDouble();double heigth = cellInfo->heigth.toDouble();cellInfo->rPoint = QString::number(lPoint+width,'f',2);cellInfo->bPoint = QString::number(tPoint+heigth,'f',2);xPointSet.insert(cellInfo->lPoint.toDouble());xPointSet.insert(cellInfo->rPoint.toDouble());yPointSet.insert(cellInfo->tPoint.toDouble());yPointSet.insert(cellInfo->bPoint.toDouble());QAxObject* range = cell->querySubObject("Range");QString cellText = range->property("Text").toString().trimmed();cellInfo->text = cellText;cellMap.insert(point, cellInfo);delete range;delete cell;}ok = true;}QList<double> xPointList = xPointSet.values();QList<double> yPointList = yPointSet.values();QList<int> zWidthList = zWidthMap.values();QList<int> zHeightList = zHeightMap.values();std::sort(xPointList.begin(), xPointList.end());std::sort(yPointList.begin(), yPointList.end());std::sort(zWidthList.begin(), zWidthList.end());std::sort(zHeightList.begin(), zHeightList.end());int rmZxCount = xPointList.size() - columnCount;int rmZyCount = yPointList.size() - rowCount;int rmxCount = rmZxCount>1?rmZxCount-1:0;int rmyCount = rmZyCount>1?rmZyCount-1:0;for(int rmZxIndex=0;rmZxIndex<rmxCount;rmZxIndex++){xPointList.takeLast();}for(int rmZyIndex=0;rmZyIndex<rmyCount;rmZyIndex++){yPointList.takeLast();}// 设置合并单元格QList<QPair<int, int>> pointList = cellMap.keys();for (QPair<int, int>& point : pointList) {CellInfo* cellInfo = cellMap.value(point);cellInfo->rowSpan = 0;cellInfo->colSpan = 0;double lPoint = cellInfo->lPoint.toDouble();double rPoint = cellInfo->rPoint.toDouble();double tPoint = cellInfo->tPoint.toDouble();double bPoint = cellInfo->bPoint.toDouble();for(double xPointSIndex:xPointList){if(xPointSIndex>lPoint && xPointSIndex<=rPoint){cellInfo->colSpan = cellInfo->colSpan+1;}}for(double yPointSIndex:yPointList){if(yPointSIndex>tPoint && yPointSIndex<=bPoint){cellInfo->rowSpan = cellInfo->rowSpan+1;}}ui->tableWidget->setItem(cellInfo->rowIndex - 1, cellInfo->colIndex - 1, new QTableWidgetItem(cellInfo->text));ui->tableWidget->setSpan(cellInfo->rowIndex - 1, cellInfo->colIndex - 1,cellInfo->rowSpan,cellInfo->colSpan);}document->dynamicCall("Close()");word.dynamicCall("Quit()");
}void MainWindow::displayWordTableInQTableWidget2(const QString &filePath)
{QFile resTxtFile(this->resTxt);QFile cellWordOpenXMLTxtFile(this->cellWordOpenXMLtxt);QFile xMLTxtFile(this->xMLtxt);QStringList resTxtList;QStringList cellWordOpenXMLList;QStringList xMLList;if(!resTxtFile.open(QIODevice::WriteOnly)){return;}if(!cellWordOpenXMLTxtFile.open(QIODevice::WriteOnly)){return;}if(!xMLTxtFile.open(QIODevice::WriteOnly)){return;}QTextStream resTxtFileOut(&resTxtFile);QTextStream cellWordOpenXMLTxtFileOut(&cellWordOpenXMLTxtFile);QTextStream xMLTxtFileOut(&xMLTxtFile);QAxObject word("Word.Application");word.setProperty("Visible", false);QAxObject* documents = word.querySubObject("Documents");QAxObject* document = documents->querySubObject("Open(const QString&)", filePath);if (!document) {qDebug() << "Failed to open the document.";return;}QAxObject* tables = document->querySubObject("Tables");int tableCount = tables->dynamicCall("Count").toInt();if (tableCount < 1) {qDebug() << "No table found in the document.";document->dynamicCall("Close()");word.dynamicCall("Quit()");return;}double xOrg = 0;double yOrg = 0;for (int tableIndex = 1; tableIndex <= tableCount; ++tableIndex) {QAxObject* table = tables->querySubObject("Item(int)", tableIndex);qDebug() << "Processing Table Index:" << tableIndex;QAxObject* rangeTable = table->querySubObject("Range");int maxTableCol = rangeTable->dynamicCall("Information(wdMaximumNumberOfColumns)").toInt();int maxTableRow = rangeTable->dynamicCall("Information(wdMaximumNumberOfRows)").toInt();int rowCount = table->querySubObject("Rows")->property("Count").toInt();int columnCount = table->querySubObject("Columns")->property("Count").toInt();for (int row = 1; row <= rowCount; ++row) {for (int col = 1; col <= columnCount; ++col) {QAxObject* cell = table->querySubObject("Cell(int, int)", row, col);if (!cell) {continue;}QAxObject* range = cell->querySubObject("Range");if(!range){continue;}QString WordOpenXML = range->property("WordOpenXML").toString();qDebug()<<WordOpenXML;QFile dell("C:\\Users\\tirklee\\Desktop\\cell("+QString::number(row)+","+QString::number(col)+").xml");if(dell.open(QIODevice::WriteOnly)){QTextStream dellOut(&dell);dellOut<<WordOpenXML<<endl;}dell.close();QString XML = range->property("XML").toString();cellWordOpenXMLList.append(WordOpenXML);xMLList.append(XML);double width = cell->property("Width").toDouble();double height = cell->property("Height").toDouble();int maxCol = range->dynamicCall("Information(wdMaximumNumberOfColumns)").toInt();int maxRow = range->dynamicCall("Information(wdMaximumNumberOfRows)").toInt();int startRow = range->dynamicCall("Information(wdStartOfRangeRowNumber)").toInt();int endRow = range->dynamicCall("Information(wdEndOfRangeRowNumber)").toInt();int startCol = range->dynamicCall("Information(wdStartOfRangeColumnNumber)").toInt();int endCol = range->dynamicCall("Information(wdEndOfRangeColumnNumber)").toInt();double startRowX = range->dynamicCall("Information(wdVerticalPositionRelativeToPage)").toDouble();double endRowX = startRowX+height;double startColX = range->dynamicCall("Information(wdHorizontalPositionRelativeToPage)").toInt();double endColX = startColX+width;if(col==1){yOrg = startColX;}if(row==1){xOrg = startRowX;}double top = startRowX-yOrg;double bottom = endRowX-yOrg;double left = startColX-xOrg;double rigth = endColX-xOrg;// 计算合并的行数和列数int rowSpan = endRow - startRow + 1;int colSpan = endCol - startCol + 1;//                    // 获取第一个单元格的宽度和高度
//                    int initialWidth = cell->property("Width").toInt();
//                    int initialHeight = cell->property("Height").toInt();//                    int rowSpan = 1;
//                    int colSpan = 1;//                    // 计算行跨度
//                    while (row + rowSpan <= rowCount) {
//                        QAxObject* nextCell = table->querySubObject("Cell(int, int)", row + rowSpan, col);
//                        if (!nextCell) break;//                        if (abs(nextCell->property("Width").toInt() - initialWidth) > 1 || abs(nextCell->property("Height").toInt() - initialHeight) > 1) {
//                            break;
//                        }//                        rowSpan++;
//                        delete nextCell;
//                    }//                    // 计算列跨度
//                    while (col + colSpan <= columnCount) {
//                        QAxObject* nextCell = table->querySubObject("Cell(int, int)", row, col + colSpan);
//                        if (!nextCell) break;//                        if (abs(nextCell->property("Width").toInt() - initialWidth) > 1 || abs(nextCell->property("Height").toInt() - initialHeight) > 1) {
//                            break;
//                        }//                        colSpan++;
//                        delete nextCell;
//                    }// 输出结果QStringList  readLine = QStringList()<< "Cell at (" << QString::number(row) << ", " << QString::number(col) << ") has RowSpan: " << QString::number(rowSpan) << " and ColumnSpan: " << QString::number(colSpan);resTxtList.append(readLine.join(""));resTxtFileOut<<readLine.join("")<<endl;cellWordOpenXMLTxtFileOut<<WordOpenXML<<endl;xMLTxtFileOut<<XML<<endl;qDebug() << readLine;delete cell;}}delete table;}resTxtFile.close();cellWordOpenXMLTxtFile.close();xMLTxtFile.close();document->dynamicCall("Close()");word.dynamicCall("Quit()");
}void MainWindow::displayExcelTableInQTableWidget1(const QString &filePath)
{// 启动ExcelQAxObject* excel = new QAxObject("Excel.Application");excel->dynamicCall("SetVisible(bool Visible)", false);QAxObject* workbooks = excel->querySubObject("Workbooks");// 打开Excel文件QAxObject* workbook = workbooks->querySubObject("Open(const QString&)", filePath);QAxObject* sheets = workbook->querySubObject("Worksheets");QAxObject* sheet = sheets->querySubObject("Item(int)", 1); // 假设处理第一个工作表// 检查合并单元格QAxObject* usedRange = sheet->querySubObject("UsedRange");if (!usedRange) {qDebug() << "无法获取已使用的范围。";return;}QAxObject* rows = usedRange->querySubObject("Rows");int rowsCount = rows->property("Count").toInt();QAxObject* cols = usedRange->querySubObject("Columns");int colsCount = cols->property("Count").toInt();QAxObject* cells = usedRange->querySubObject("Cells");ui->tableWidget->setRowCount(rowsCount);ui->tableWidget->setColumnCount(colsCount);for (int row = 1; row <= rowsCount; ++row) {for (int col = 1; col <= colsCount; ++col) {QAxObject* cell = cells->querySubObject("Item(int, int)", row, col);bool isMerged = cell->property("MergeCells").toBool();int rowSpan = 1;int colSpan = 1;if (isMerged) {QAxObject* mergeArea = cell->querySubObject("MergeArea");QAxObject* rowsRange = mergeArea->querySubObject("Rows");QAxObject* colsRange = mergeArea->querySubObject("Columns");rowSpan = rowsRange->property("Count").toInt();colSpan = colsRange->property("Count").toInt();qDebug() << "单元格 (" << row << ", " << col << ") 合并了 " << rowSpan << " 行和 " << colSpan << " 列。";}QString cellText = cell->property("Text").toString().trimmed();ui->tableWidget->setItem(row-1,col-1,new QTableWidgetItem(cellText));ui->tableWidget->setSpan(row-1,col-1,rowSpan,colSpan);delete cell;}}delete usedRange;delete rows;delete cols;delete cells;// 关闭Excel文件并退出Excelworkbook->dynamicCall("Close()");excel->dynamicCall("Quit()");delete excel;
}CellInfo::CellInfo(QObject *parent)
{Q_UNUSED(parent);
}CellInfo::~CellInfo()
{}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.xdnf.cn/news/18236.html

如若内容造成侵权/违法违规/事实不符,请联系一条长河网进行投诉反馈,一经查实,立即删除!

相关文章

华为欧拉系统使用U盘制作引导安装华为欧拉操作系统

今天记录一下通过U盘来安装华为欧拉操作系统 华为欧拉操作系统是国产的一个类似于Centos的Linus系统 具体实现操作步骤&#xff1a; 先在官网下载欧拉系统镜像点击跳转到下载 准备好一个大于16g的U盘 &#xff0c;用于制作U盘启动 下载一个引导程序制作工具&#xff0c;我使用…

魔改log4j2的JsonLayout,支持自定义json格式日志

小伙伴们&#xff0c;你们好&#xff0c;我是老寇&#xff0c;我又回来辣&#xff0c;1个多月不见甚是想念啊&#xff01;&#xff01;&#xff01;跟我一起魔改源码吧 1.自定义json格式【PatternLayout】 大部分教程都是这个&#xff0c;因此&#xff0c;我就简单给个配置&a…

机器学习—学习曲线

学习曲线是帮助理解学习算法如何工作的一种方法&#xff0c;作为它所拥有的经验的函数。 绘制一个符合二阶模型的学习曲线&#xff0c;多项式或二次函数&#xff0c;画出交叉验证错误Jcv&#xff0c;以及Jtrain训练错误&#xff0c;所以在这个曲线中&#xff0c;横轴将是Mtrai…

在MATLAB中实现自适应滤波算法

自适应滤波算法是一种根据信号特性自动调整滤波参数的数字信号处理方法&#xff0c;其可以有效处理噪声干扰和信号畸变问题。在许多实时数据处理系统中&#xff0c;自适应滤波算法得到了广泛应用。在MATLAB中&#xff0c;可以使用多种方法实现自适应滤波算法。本文将介绍自适应…

【系统编程】实验7 消息队列

设计程序 使用消息队列实现两个进程之间的信息互通 snd.c #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/msg.h> #include <unistd.h>/*消息发送者 */// 消息结构体如下&#xff1a; …

ETH钱包地址如何获取 如何购买比特币

首先我们要先注册一个交易所 Gate.io&#xff08;推荐&#xff09;: 点我注册 1、注册很简单&#xff0c;通过手机号就可以进行注册了。 2、获取ETH钱包地址 注册好之后&#xff0c;如图所示&#xff0c;点击“统一账户” 3、通过搜索栏搜索ETH&#xff0c;如下图所示 4、点…

[Docker#11] 容器编排 | .yml | up | 实验: 部署WordPress

目录 1. 什么是 Docker Compose 生活案例 2. 为什么要使用 Docker Compose Docker Compose 的安装 Docker Compose 的功能 使用步骤 核心功能 Docker Compose 使用场景 Docker Compose 文件&#xff08;docker-compose.yml&#xff09; 模仿示例 文件基本结构及常见…

OpenCV基础(1)

1.图像读写与窗口显示 1.1.imread读取图像文件 Mat cv::imread(const string &filename,int flags IMREAD_COLOR); filename&#xff1a;要读取的图像文件名flags&#xff1a;读取模式&#xff0c;可以从枚举cv::ImreadModes中取值&#xff0c;默认取值是IMREAD_COLOR&am…

【优选算法篇】分治乾坤,万物归一:在重组中窥见无声的秩序

文章目录 分治专题&#xff08;二&#xff09;&#xff1a;归并排序的核心思想与进阶应用前言、第二章&#xff1a;归并排序的应用与延展2.1 归并排序&#xff08;medium&#xff09;解法&#xff08;归并排序&#xff09;C 代码实现易错点提示时间复杂度和空间复杂度 2.2 数组…

生产环境centos8 Red Hat8部署ansible and 一键部署mysql两主两从ansible脚本预告

一、各节点服务器创建lvm逻辑卷组 1.初始化磁盘为物理卷&#xff08;PV&#xff09; 命令&#xff1a;sudo pvcreate /dev/vdb 2.创建卷组&#xff08;VG&#xff09; 命令&#xff1a;sudo vgcreate db_vg /dev/vdb 3.创建逻辑卷&#xff08;LV&#xff09; 命令&#xff1a;s…

CNN神经网络

CNN 一 基本概述二 基础知识三 经典案例 今天跟大家聊聊人工智能中的神经网络模型相关内容。神经网络内容庞大,篇幅有限本文主要讲述其中的CNN神经网络模型。 一 基本概述 深度学习(Deep Learning)特指基于深层神经网络模型和方法的机器学习。它是在统计机器学习、人工神经网…

【Ubuntu24.04】VirtualBox安装ubuntu-live-server24.04

目录 0 背景1 下载镜像2 安装虚拟机3 安装UbuntuServer24.044 配置基本环境5 总结0 背景 有了远程连接工具之后,似乎作为服务器的Ubuntu24.04桌面版有点备受冷落了,桌面版的Ubuntu24.04的优势是图形化桌面,是作为一个日常工作的系统来用的,就像Windows,如果要作为服务器来…

【策略模式】最佳实践——Spring IoC实现策略模式全流程深度解析

简介 策略模式是一种行为型设计模式&#xff0c;它定义了一系列算法&#xff0c;并将每一个算法封装起来&#xff0c;使它们可以互相替换&#xff0c;并且使算法的变化不会影响使用算法的客户端。策略模式通过将具体的业务逻辑从上下文&#xff08;Context&#xff09;中剥离出…

企业项目级IDEA设置类注释、方法注释模板(仅增加@author和@date)

文章目录 前言一 设置类注释1.1 添加模板1.2 复制配置 二 设置方法注释2.1 添加模版2.2 设置模版2.3 设置参数变量2.4 配置对应快捷键2.5 配置对应作用域2.6 使用方式 说明 前言 公司代码规范中&#xff0c;需要在标准JavaDoc注释的基础上加上作者和日期。网上虽然有很多现成的…

单片机学习笔记 2. LED灯闪烁

目录 0、实现的功能 1、Keil工程 2、代码实现 0、实现的功能 LED灯闪烁 1、Keil工程 闪烁原理&#xff1a;需要进行软件延时达到人眼能分辨出来的效果。常用的延时方法有软件延时和定时器延时。此次先进行软件延时 具体操作步骤和之前的笔记一致。此次主要利用无符号整型的范…

编辑器vim 命令的学习

1.编辑器Vim 1.vim是一个专注的编辑器 2.是一个支持多模式的编辑器 1.1见一见&#xff1a; vim 的本质也是一条命令 退出来&#xff1a;-> Shift:q 先创建一个文件 再打开这个文件 进入后先按 I 然后就可以输入了 输入完后&#xff0c;保存退出 按Esc --> 来到最后一…

调用门提权

在我写的2.保护模式&#xff0b;段探测这篇文章中&#xff0c;我们提到了S位对于段描述符的控制&#xff0c;之前我们已经介绍了代码段和数据段&#xff0c;现在我们来把目光转到系统段 在这么多中结构里面&#xff0c;我们今天要介绍的就是编号为12的&#xff0c;32位调用门 结…

langchain模型及I/O的封装

langchain安装&#xff1a;pip install langchain-openai https://python.langchain.com/v0.2/docs/integrations/platforms/openai/ 注意&#xff1a;安装后&#xff0c;我们需要在环境变量中配置OPENAI_API_KEY&#xff0c;langchain会自动获取 1.模型的封装 指令生成式模…

阿里斑马智行 2025届秋招 NLP算法工程师

文章目录 个人情况一面/技术面 1h二面/技术面 1h三面/HR面 20min 个人情况 先说一下个人情况&#xff1a; 学校情况&#xff1a;211本中9硕&#xff0c;本硕学校都一般&#xff0c;本硕都是计算机科班&#xff0c;但研究方向并不是NLP&#xff0c;而是图表示学习论文情况&…

谈一谈QThread::CurrentThread和this->thread

QThread::CurrentThread是指的当前函数调用者者所在的线程 this->thread是指的当前对象所在的线程&#xff08;对象创建出来的时候所在的线程&#xff09; Qt文档说明 CurrentThread返回一个指向管理当前执行线程的QThread的指针 thread返回对象所在的线程 这两个函数所…