活动介绍
file-type

本地EDR挂接Nt/Zw功能检测工具开发

下载需积分: 50 | 23.3MB | 更新于2024-11-05 | 191 浏览量 | 0 下载量 举报 收藏
download 立即下载
本文介绍了一个专门用于检测本地端点检测和响应(EDR)系统所挂接的Windows系统底层API函数的工具。该项目基于C/C++语言开发,并与安全研究领域有关,特别是那些专注于用户空间的系统检测与防护的技术。项目的主要目的是提供一种手段,以确定本地EDR解决方案是否以及如何挂接(hooking)了Windows内核中的Nt/Zw系列函数。这些函数通常被用于执行核心级别的系统操作,是安全研究人员和攻击者都非常关注的部分。 ### 标题知识点: - **EDR(Endpoint Detection and Response)**: EDR是一种安全技术,旨在帮助监控、检测和响应网络中端点设备上的威胁和可疑行为。它通过持续监测并分析系统活动来实现,通常包含有规则和行为分析引擎。 - **Nt/Zw函数挂接(Hooking)**: 在计算机安全领域,"挂接"是一种广泛使用的技术,用于拦截和修改系统函数调用或消息传递。在EDR上下文中,挂接Nt/Zw函数是一种检测潜在恶意操作并实时进行干预的手段。 ### 描述知识点: - **本地EDR挂接检测**: 这个项目专门用来扫描并报告在本地EDR系统中可能被挂接的Nt/Zw系列函数。这类函数通常属于Windows Native API,是执行关键系统操作的基础。 - **SolomonSklash贡献**: SolomonSklash在安全研究领域有广泛贡献,他的博客为这个项目提供了重要的代码基础。这表明该项目背后有权威的安全研究者提供支持。 ### 标签知识点: - **C/C++**: 项目使用C/C++语言开发,这是系统级编程中最常见的语言之一,因其性能强大和对系统资源的精确控制而受到青睐。 - **Miscellaneous**: 此标签表明该项目可能涵盖了多个方面,不局限于单一功能,可能包括了各种不同的安全检查和分析技术。 ### 压缩包子文件列表知识点: - **文件名称:Probatorum-EDR-Userland-Hook-Checker-master**: 此文件名表明项目的主文件或项目所在的主目录。"Probatorum"可能是项目名称,而"EDR-Userland-Hook-Checker"则直接指示了该工具的用途和功能。 ### 结语知识点: - **免责声明**: 该项目明确指出不允许将其用于非法活动。这是对项目使用者的法律提醒,以确保技术的合法合规使用。 ### 总结 在网络安全领域,理解和检测EDR系统的功能挂接是至关重要的。通过检查Nt/Zw函数的挂接,安全专家可以评估EDR解决方案的覆盖范围和可能的检测盲点。此外,此项目的提供也展示了在合法范围内进行安全研究的重要性,以及遵守法律法规的必要性。安全工具的开发和使用是保护系统不受恶意软件侵害的必要步骤,但同时也需要敏感和负责任地对待这些工具的潜力和应用。

相关推荐

filetype

./BTSnifferBREDR.py --port=/dev/ttyUSB0 --target=E0:D4:E8:19:C7:69 --live-terminal Using options: Serial Port: /dev/ttyUSB0 Serial Baud: 921600 BT Host Program: ./host_stack/sdp_rfcomm_query Host BDAddress: e0:d4:e8:19:c7:68 Target BDAddress: e0:d4:e8:19:c7:69 [!] Reset Done! EN pin toggled HIGH->LOW->HIGH [!] Waiting 0.8s... Traceback (most recent call last): File "./BTSnifferBREDR.py", line 262, in <module> sniffer() File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/runtime/install/lib/python3.8/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/runtime/install/lib/python3.8/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/runtime/install/lib/python3.8/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/runtime/install/lib/python3.8/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) File "./BTSnifferBREDR.py", line 245, in sniffer Sniffer.start() File "./BTSnifferBREDR.py", line 118, in start self.driver = ESP32BTDriver(self.serial_port, self.serial_baud) File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/src/ESP32BTDriver.py", line 87, in __init__ self.get_version() File "/home/anritsen/Work/wifi-bt/git-prj/esp32_bluetooth_classic_sniffer-master/src/ESP32BTDriver.py", line 142, in get_version self.version = version_string.decode('utf-8').split('\n')[0] UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb1 in position 0: invalid start byte

filetype

该代码搜索不到蓝牙设备,一直在显示正在搜索中<template> <view> <view class="uni-list"> <canvas :id="canvasId" :canvas-id="canvasId" type="2d" :style="{ width: labelWidth + 'px', height: labelHeight + 'px' }" style="position: fixed; left: -999999rpx; top: -999999rpx" /> <view class="uni-list-cell"> <view class="uni-list-cell-left">打印机:</view> <view class="uni-list-cell-db"> <picker :value="deviceIndex" :range="deviceList" @change="onDeviceChanged" range-key="name"> <view class="uni-input">{{ deviceList[deviceIndex].name }}</view> </picker> </view> </view> </view> <view class="uni-padding-wrap uni-common-mt"> <button type="primary" @click="startDiscovery">开始搜索打印机</button> <button type="primary" @click="stopDiscovery">停止搜索打印机</button> <button type="primary" @click="openPrinter">打开打印机</button> <button type="primary" @click="closePrinter">关闭打印机</button> <button type="primary" plain="true" @click="onPrintTest">打印测试</button> </view> <view style="text-align: center; padding: 10px"> <view style="margin: 10px; border: solid lightgray 1px"> <image v-for="item in previewList" :src="item.value" :key="item.key" class="image" mode="widthFix" style="margin: 10rpx; border: dashed lightgray 1px" /> </view> </view> </view> </template> <script> import { LPAPIFactory, LPA_Result, LPAUtils } from "@/uni_modules/dothan-lpapi-ble/js_sdk/index.js"; export default { data() { return { canvasId: "lpapi-ble-uni1", labelWidth: 960, labelHeight: 960, deviceList: [{ name: "未检测到打印机" }], deviceIndex: 0, isAppPlus: false, isWeiXin: false, isLark: false, isAlipay: false, isDingTalk: false, previewList: [], threshold: 128, }; }, onLoad() { console.log("========== onLoad =========="); // #ifdef APP-PLUS this.isAppPlus = true; // #endif // #ifdef MP-

filetype

void MainWindow::readexcelrf() { QString filepath="./各地区法规.xlsx"; QString sheetname="ce_fcc_RF";; // if(ui->tabWidget->currentIndex()==0)// if (ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("FCC CE标准", Qt::CaseInsensitive) == 0) // 不区分大小写的比较,如果选中的是名字叫“FCC CE标准”的tab { filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx // if(ui->tabWidget_2->currentIndex()==0)//SUMMARY if (ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("summary", Qt::CaseInsensitive) == 0)//SUMMARY { sheetname="ce_fcc_合并单元格"; // sheetindex=0; } // else if(ui->tabWidget_2->currentIndex()==1)//battery else if(ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("battery", Qt::CaseInsensitive) == 0)//battery { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_battery"; // sheetindex=1; } // else if(ui->tabWidget_2->currentIndex()==2)//safety else if(ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("safety", Qt::CaseInsensitive) == 0)//safety { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_safety"; // sheetindex=2; } else if(ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("emf/sar", Qt::CaseInsensitive) == 0)//emf/sar { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_EMF、SAR"; // sheetindex=3; } // else if(ui->tabWidget_2->currentIndex()==4)//emc else if(ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("emc", Qt::CaseInsensitive) == 0)//emc { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_EMC"; // sheetindex=4; } // else if(ui->tabWidget_2->currentIndex()==5)//ce fcc rf else if(ui->tabWidget_2->tabText(ui->tabWidget_2->currentIndex()).compare("rf", Qt::CaseInsensitive) == 0)//ce fcc rf { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_RF"; // sheetindex=5; } else { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_RF"; // sheetindex=5; } } // else if(ui->tabWidget->currentIndex()==1)//如果选中的是日本的tab else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("日本", Qt::CaseInsensitive) == 0)//如果选中的是日本的tab { filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx // if(ui->tabWidget_3->currentIndex()==0)//SUMMARY if(ui->tabWidget_3->tabText(ui->tabWidget_3->currentIndex()).compare("summary", Qt::CaseInsensitive) == 0)//SUMMARY=“日本法规” { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="日本法规"; // sheetindex=6; } else if(ui->tabWidget_3->tabText(ui->tabWidget_3->currentIndex()).compare("lte fdd", Qt::CaseInsensitive) == 0)// lte fdd { filepath = "./Japan LTE-NR-UMTS认证测试case_20250528.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="LTE E-UTRA FDD"; // sheetindex=0; } else if(ui->tabWidget_3->tabText(ui->tabWidget_3->currentIndex()).compare("BT", Qt::CaseInsensitive) == 0)// bt case { filepath = "./Japan BT_Wi-Fi_SAR认证测试case_20250528.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="BT BR-EDR-LE"; // sheetindex=0; } else if(ui->tabWidget_3->tabText(ui->tabWidget_3->currentIndex()).compare("wifi 2.4g", Qt::CaseInsensitive) == 0)// 2.4G WIFI case { filepath = "./Japan BT_Wi-Fi_SAR认证测试case_20250528.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="Wi-Fi 2.4G"; // sheetindex=1; } else//如果没有,则默认日本法规这个sheet { // filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="日本法规"; // sheetindex=6; } } // else if(ui->tabWidget->currentIndex()==2)//如果选中的是网址的tab else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("法规网址", Qt::CaseInsensitive) == 0)//如果选中的是网址的tab { filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="法规标准网址"; // sheetindex=7; } // else if(ui->tabWidget->currentIndex()==3)//如果选中的是CE RSE与RE对比的tab else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("CE RSE与RE对比", Qt::CaseInsensitive) == 0)//如果选中的是CE RSE与RE对比的tab { filepath = "./CE认证RSE与RE对比20250528.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx // if(ui->tabWidget_4->currentIndex()==0)//测试目的 if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("测试目的", Qt::CaseInsensitive) == 0)//测试目的 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="测试目的"; // sheetindex=0; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("法规", Qt::CaseInsensitive) == 0)//法规 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="法规"; // sheetindex=1; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("场地", Qt::CaseInsensitive) == 0)//场地 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="场地"; // sheetindex=2; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("DUT高度", Qt::CaseInsensitive) == 0)//DUT高度 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="DUT高度"; // sheetindex=3; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("天线高度", Qt::CaseInsensitive) == 0)//天线高度 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="天线高度"; // sheetindex=4; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("检波方式", Qt::CaseInsensitive) == 0)//检波方式 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="检波方式"; // sheetindex=5; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("限值", Qt::CaseInsensitive) == 0)//限值 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="限值"; // sheetindex=6; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("频率", Qt::CaseInsensitive) == 0)//频率 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="频率"; // sheetindex=7; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("距离", Qt::CaseInsensitive) == 0)//距离 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="距离"; // sheetindex=8; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("测试项", Qt::CaseInsensitive) == 0)//测试项 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="测试项"; // sheetindex=9; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("信道", Qt::CaseInsensitive) == 0)//信道 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="信道"; // sheetindex=10; } else if(ui->tabWidget_4->tabText(ui->tabWidget_4->currentIndex()).compare("测试模式", Qt::CaseInsensitive) == 0)//测试模式 { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="测试模式"; // sheetindex=11; } else { // filepath = "./CE认证RSE与RE对比20250520.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="测试目的"; // sheetindex=0; } } else//如果都没有,默认fcc合并单元格显示 { filepath = "./各地区法规.xlsx";//和exe同级目录用这个,如果相对目录是上一级, 则用两个点../xxx sheetname="ce_fcc_合并单元格"; // sheetindex=0; } QXlsx::Document xlsx(filepath); // 加载Excel文件 xlsx.selectSheet(sheetname);//读取excel中哪一个sheet?只需要将此sheet名字写入即可,这里是调用上面判断里的 // 设置表格的行数和列数 int lastRow = xlsx.dimension().lastRow(); int lastCol = xlsx.dimension().lastColumn(); ui->tableWidget->setRowCount(lastRow); ui->tableWidget->setColumnCount(lastCol); // 清除旧的合并单元格状态 clearSpans(ui->tableWidget); for (int row = 1; row <= lastRow; row++)//读取多少行多少列 { for (int col = 1; col <= lastCol; col++) { Cell* cell = xlsx.cellAt(row, col); //获取具体位置单元格 if (cell != NULL) { QVariant var = cell->readValue(); // QTableWidgetItem *item = new QTableWidgetItem(var.toString());//我们直接用Qstring即可,我们需要的是显示内容 // 空值检测与转换(满足$ \text{isEmpty} $条件时返回空字符串) QString textValue = var.isNull() ? "" : var.toString().trimmed();//如果单元格是空的,则输出“” QTableWidgetItem *item = new QTableWidgetItem(textValue); // 显式设置文本内容 // 样式设置保持原有逻辑 QColor bgColor = cell->format().patternBackgroundColor(); QColor fontColor = cell->format().fontColor(); QFont font = cell->format().font(); item->setBackground(QBrush(bgColor)); item->setForeground(QBrush(fontColor)); item->setFont(font); // 坐标转换公式:$ \text{Qt\_row} = \text{Excel\_row} - 1 $ ui->tableWidget->setItem(row-1, col-1, item); } else { // 处理单元格不存在的情况(可选) QTableWidgetItem *emptyItem = new QTableWidgetItem(""); ui->tableWidget->setItem(row-1, col-1, emptyItem); } } } // /******合并单元格的内容处理******/ QXlsx::Workbook *xWorkBook = xlsx.workbook(); // //默认使用 表格 // QXlsx::Worksheet *xWorksheet = static_cast<QXlsx::Worksheet*>(xWorkBook->sheet(sheetindex));//excel sheet的索引号。excel中sheet索引从0开始 // // QXlsx::Worksheet *xWorksheet = static_cast<QXlsx::Worksheet*>(xWorkBook->sheet(4));//excel sheet的索引号。excel中sheet索引从0开始 QXlsx::Worksheet *xWorksheet = static_cast<QXlsx::Worksheet*>(xlsx.workbook()->sheet(xlsx.sheetNames().indexOf(sheetname)));//excel sheet的索引号。excel中sheet索引从0开始 QList<QXlsx::CellRange> qMergedCellsList = xWorksheet->mergedCells(); // 处理合并单元格信息 for (const QXlsx::CellRange &range : qMergedCellsList) { int startRow = range.firstRow() - 1; int startCol = range.firstColumn() - 1; int spanRows = range.lastRow() - range.firstRow() + 1; int spanCols = range.lastColumn() - range.firstColumn() + 1; ui->tableWidget->setSpan(startRow, startCol, spanRows, spanCols); } // 使用 QSS 设置表格边框 ui->tableWidget->setStyleSheet( "QTableWidget {" " gridline-color: gray;" // 设置单元格之间的网格线颜色为蓝色 "}" ); // ui->tableWidget->setStyleSheet("QTableView::item { border: 0.5px solid gray; }");//不可以使用这样的item的,否则会导致之前的颜色读取不生效!!! // ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 // if(ui->tabWidget->currentIndex()==0)//如果选中的是CEFCC的tab if (ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("FCC CE标准", Qt::CaseInsensitive) == 0) // 不区分大小写的比较,如果选中的是名字叫“FCC CE标准”的tab { ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 // 设置所有列采用固定模式并设定初始宽度 ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui->tableWidget->horizontalHeader()->setDefaultSectionSize(130); // 定义固定宽度为80像素 } else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("日本", Qt::CaseInsensitive) == 0)//如果选中的是日本的tab { ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 if(ui->tabWidget_3->tabText(ui->tabWidget_3->currentIndex()).compare("summary", Qt::CaseInsensitive) == 0)//日本法规summary那一页设置不一样 { ui->tableWidget->horizontalHeader()->resizeSection(0, 130); // 将第1列设为200像素宽,从0开始,第1列是0 ui->tableWidget->horizontalHeader()->resizeSection(1, 270); // 将第1列设为200像素宽,从0开始,第1列是0 ui->tableWidget->horizontalHeader()->resizeSection(2, 250); // 将第1列设为200像素宽 ui->tableWidget->horizontalHeader()->resizeSection(3, 130); // 将第1列设为200像素宽 ui->tableWidget->horizontalHeader()->resizeSection(4, 140); // 将第1列设为200像素宽 } else { ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui->tableWidget->horizontalHeader()->setDefaultSectionSize(128); // 定义固定宽度为80像素 ui->tableWidget->horizontalHeader()->resizeSection(0, 30); // 将第1列设为200像素宽,从0开始,第1列是0 } // // ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小 // // 单独设置某一列为固定宽度 // ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); // ui->tableWidget->horizontalHeader()->resizeSection(1, 250); // 同时设置该列宽度为150px // ui->tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed); // ui->tableWidget->horizontalHeader()->resizeSection(2, 250); // 同时设置该列宽度为150px // ui->tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Fixed); // ui->tableWidget->horizontalHeader()->resizeSection(2, 250); // 同时设置该列宽度为150px } else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("法规网址", Qt::CaseInsensitive) == 0)//如果选中的是网址的tab { // ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小 } else if(ui->tabWidget->tabText(ui->tabWidget->currentIndex()).compare("CE RSE与RE对比", Qt::CaseInsensitive) == 0)//如果选中的是CE RSE和RE对比 { ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 // 设置所有列采用固定模式并设定初始宽度 ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui->tableWidget->horizontalHeader()->setDefaultSectionSize(115); // 定义固定宽度为80像素 } else { ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//按照每类文本内容自动定义每格大小,主要是垂直大小,因为水平大小调整后不方便看 // 设置所有列采用固定模式并设定初始宽度 ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui->tableWidget->horizontalHeader()->setDefaultSectionSize(130); // 定义固定宽度为80像素 } }

婉君喜欢DIY
  • 粉丝: 25
上传资源 快速赚钱