pyqt在控件上创建图片

# text=self.UserName.text()
        # if  text.isEmpty():
        #     imgpath=r'Image/lineclose.png'
        #     self.ButtonShowKeyboard = QToolButton(self)
        #     self.ButtonShowKeyboard.setCursor(Qt.PointingHandCursor)
        #     self.ButtonShowKeyboard.setFocusPolicy(Qt.NoFocus)
        #     self.ButtonShowKeyboard.setIcon(QIcon(imgpath))
        #     self.ButtonShowKeyboard.setStyleSheet("background: transparent; border:

none;")
        #     layout = QHBoxLayout(self)
        #     layout.addWidget(self.ButtonShowKeyboard,0,Qt.AlignRight)
        #     layout.setSpacing(0)
        #     layout.setMargin(5)
        #
        #     self.UserName.setLayout(layout)
        #     layout.addWidget(self.ButtonShowKeyboard,0,Qt.AlignRight)
        #     self.PassWords.setLayout(layout)
        #
        #     self.ButtonShowKeyboard.setToolTip(QApplication.translate("None", "Show

virtual keyboard", None, QApplication.UnicodeUTF8))



你可能感兴趣的:(图片,layout,background,border)