2023-02-10 21:51:03 +08:00

29 lines
1.1 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from distutils.log import info
from PyQt5.QtWidgets import QHBoxLayout,QDialog,QLabel,QVBoxLayout
from PyQt5.QtGui import QColor, QDragEnterEvent, QDropEvent,QPixmap
from PyQt5.QtCore import QSize,Qt
import yaml
class InfoBox(QDialog):
def __init__(self,infodic:dict,parent=None):
super(InfoBox,self).__init__(parent=parent)
v=QVBoxLayout()
if 'prewmap' in infodic.keys():
pmap=infodic.pop('prewmap')
label=QLabel(yaml.dump(infodic,allow_unicode=True,sort_keys=False))
label.setWordWrap(True)#过长自动换行主要是wkt过长
v.addWidget(label)
maplabel=QLabel()
maplabel.setPixmap(QPixmap.fromImage(pmap))
v.addWidget(maplabel,0,Qt.AlignHCenter)
else:
label=QLabel(yaml.dump(infodic,allow_unicode=True,sort_keys=False))
label.setWordWrap(True)#过长自动换行主要是wkt过长
v.addWidget(label)
self.setLayout(v)
self.show()