def __init__(self, parent=None):
super(DragWidget, self).__init__(parent)
self.setMinimumSize(200, 200)
self.setFrameStyle(QFrame.Sunken | QFrame.StyledPanel)
self.setAcceptDrops(True)
boatIcon = QLabel(self)
boatIcon.setPixmap(QPixmap(':/images/boat.png'))
boatIcon.move(20, 20)
boatIcon.show()
boatIcon.setAttribute(Qt.WA_DeleteOnClose)
carIcon = QLabel(self)
carIcon.setPixmap(QPixmap(':/images/car.png'))
carIcon.move(120, 20)
carIcon.show()
carIcon.setAttribute(Qt.WA_DeleteOnClose)
houseIcon = QLabel(self)
houseIcon.setPixmap(QPixmap(':/images/house.png'))
houseIcon.move(20, 120)
houseIcon.show()
houseIcon.setAttribute(Qt.WA_DeleteOnClose)
评论列表
文章目录