Skip to content

Commit e88d268

Browse files
authored
修复发送文本偏移问题
1 parent 1dec910 commit e88d268

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

main.py

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
import config
22
from Lovelymem_ui import Ui_MainWindow
3-
from PySide6.QtWidgets import QMainWindow, QFileDialog, QMessageBox, QApplication, QWidget, QTableWidgetItem, QHeaderView, QMenu, QTableWidget
3+
from PySide6.QtWidgets import QMainWindow, QFileDialog, QMessageBox, QApplication, QWidget, QTableWidgetItem, QHeaderView
44
from PySide6.QtCore import Qt, QThread, Signal,QRect
55
import sys
66
import os
77
import subprocess
88
from colorama import Fore, Back, Style
9-
import csv
109
import shutil
1110
from PySide6 import QtGui
1211
import convert.netstat
1312
import convert.loadcsv
1413
import pandas as pd
1514
from PySide6 import QtWidgets
1615
import re,hexdump
17-
import binascii
1816
from PIL import Image
1917

2018

@@ -135,12 +133,10 @@ def get_truepath(selectstr):
135133
print(Fore.YELLOW + '[*] 正在打开目录:' + os.path.dirname(truepath) + Style.RESET_ALL)
136134
os.system('explorer.exe ' + os.path.dirname(truepath))
137135
elif action == copy_str: #复制内容并发送至搜索框
138-
# Get the content of the selected cell
139-
local_pos = self.tableWidget_find.mapFromGlobal(self.mapToGlobal(pos))
140-
header_height = self.tableWidget_find.horizontalHeader().height()
141-
local_pos.setY(local_pos.y() - header_height)
142-
selected_item = self.tableWidget_find.itemAt(local_pos)
143-
if selected_item is not None:
136+
# Get the content of the selected cell
137+
selected_items = self.tableWidget_find.selectedItems()
138+
if selected_items:
139+
selected_item = selected_items[0]
144140
selectstr = selected_item.text()
145141
self.lineEdit_str.setText(selectstr)
146142
clipboard = QApplication.clipboard()
@@ -557,12 +553,21 @@ def load_netstat(self):
557553
return self.loadcsv2table(netstatpath)
558554

559555
def closeEvent(self, event):
560-
reply = QMessageBox.question(self, '退出', '确认退出吗?退出会结束MemProcFS进程', QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
556+
pixmap = QtGui.QPixmap("res/qrcode.png")
557+
pixmap = pixmap.scaled(200, 200)
558+
msg = QMessageBox()
559+
msg.setIconPixmap(pixmap)
560+
msg.setTextInteractionFlags(Qt.TextSelectableByMouse)
561+
msg.setTextFormat(Qt.RichText)
562+
msg.setText("<center><h2>确认退出吗?</h2></center><center><h2>退出会结束MemProcFS进程</h2></center>")
563+
msg.setWindowTitle("请我喝杯咖啡吧!")
564+
msg.setWindowIcon(QtGui.QIcon('res/logo.ico'))
565+
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
566+
reply = msg.exec()
561567
if reply == QMessageBox.Yes:
562568
event.accept()
563569
# 结束MemProcFS进程,结束MemProcFS.exe
564570
os.system('taskkill /F /IM MemProcFS.exe')
565-
566571
else:
567572
event.ignore()
568573
#----------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)