Exemplo n.º 1
0
 def __init__(self, parent):
     super(self.__class__, self).__init__(parent)
     Ui_Comment.__init__(self)
     self.setupUi(self)
     self.id = ""
     p = QPixmap()
     p.loadFromData(DataMgr.GetData("placeholder_avatar"))
     self.picIcon.setPixmap(p)
     self.picIcon.setCursor(Qt.PointingHandCursor)
     self.picIcon.setScaledContents(True)
     self.picIcon.setWordWrap(True)
     p = QPixmap()
     p.loadFromData(DataMgr.GetData("icon_comment_like"))
     q = QPixmap()
     q.loadFromData(DataMgr.GetData("icon_comment_reply"))
     self.pictureData = None
     self.starPic.setPixmap(p)
     self.starPic.setCursor(Qt.PointingHandCursor)
     self.starPic.setScaledContents(True)
     self.numPic.setPixmap(q)
     self.numPic.setCursor(Qt.PointingHandCursor)
     self.numPic.setScaledContents(True)
     self.picIcon.installEventFilter(self)
     self.commentLabel.setWordWrap(True)
     self.commentLabel.setTextInteractionFlags(Qt.TextSelectableByKeyboard)
Exemplo n.º 2
0
 def SwitchButton3(self):
     isVisible = self.bookList3.isVisible()
     self.bookList3.setVisible(not isVisible)
     p = QPixmap()
     if isVisible:
         p.loadFromData(DataMgr().GetData("fold2"))
     else:
         p.loadFromData(DataMgr().GetData("fold1"))
     self.toolButton_3.setIcon(QIcon(p))
     return
Exemplo n.º 3
0
 def __init__(self):
     super(self.__class__, self).__init__()
     Ui_ChatRoomMsg.__init__(self)
     self.setupUi(self)
     p = QPixmap()
     p.loadFromData(DataMgr().GetData("placeholder_avatar"))
     self.commentLabel.installEventFilter(self)
     self.picLabel.installEventFilter(self)
     self.picLabel.setPixmap(p)
     self.picLabel.setCursor(Qt.PointingHandCursor)
     self.picLabel.setScaledContents(True)
     self.commentLabel.setWordWrap(True)
     self.widget.setStyleSheet(""".QWidget{
         border-image:url(resources/skin_aio_friend_bubble_pressed.9.png) 50;
         border-top-width: 20px;
         border-right-width: 20px;
         border-bottom-width: 10px;
         border-left-width: 20px;}
         """)
     self.replayLabel.setWordWrap(True)
     self.replayLabel.setStyleSheet("""
         border-image:url(resources/skin_aio_friend_bubble_pressed.9.png) 50;
         border-top-width: 20px;
         border-right-width: 20px;
         border-bottom-width: 10px;
         border-left-width: 20px;
         """)
Exemplo n.º 4
0
    def __init__(self):
        super(self.__class__, self).__init__()
        Ui_ChatRoomMsg.__init__(self)
        self.setupUi(self)
        # self.setWindowFlag(Qt.FramelessWindowHint)
        # self.setWindowFlag(Qt.Dialog)
        self.resize(400, 100)

        p = QPixmap()
        p.loadFromData(DataMgr().GetData("placeholder_avatar"))
        self.commentLabel.installEventFilter(self)
        self.picLabel.installEventFilter(self)
        self.label.installEventFilter(self)
        self.label.setText("")
        self.data = None
        self.picData = None
        self.audioData = None
        self.picLabel.setPixmap(p)
        self.picLabel.setCursor(Qt.PointingHandCursor)
        self.picLabel.setScaledContents(True)
        self.picLabel.setAttribute(Qt.WA_TranslucentBackground)
        self.commentLabel.setWordWrap(True)
        # self.setStyleSheet("""
        #     background:transparent;
        #     border:2px solid red;
        # """)
        self.widget.setStyleSheet(""".QWidget{
            border-image:url(resources/skin_aio_friend_bubble_pressed.9.png) 50;
            border-top-width: 10px;
            border-right-width: 10px;
            border-bottom-width: 10px;
            border-left-width: 10px;
            }
            """)
        self.replayLabel.setWordWrap(True)
        self.replayLabel.setStyleSheet("""
            border-image:url(resources/skin_aio_friend_bubble_pressed.9.png) 50;
            border-top-width: 20px;
            border-right-width: 20px;
            border-bottom-width: 10px;
            border-left-width: 20px;
            """)
        # self.commentLabel.setTextInteractionFlags(Qt.TextSelectableByMouse)
        # self.name.setTextInteractionFlags(Qt.TextSelectableByMouse)
        p = QPixmap()
        p.loadFromData(DataMgr().GetData("audio"))
        self.toolButton.setIcon(QIcon(p))
Exemplo n.º 5
0
    def __init__(self, owner):
        super(self.__class__, self).__init__(owner)
        Ui_Index.__init__(self)
        self.setupUi(self)
        self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.owner = weakref.ref(owner)
        self.isInit = False
        self.bookList1 = QtBookList(self, "1", owner)
        self.bookList1.InitBook()
        self.horizontalLayout.addWidget(self.bookList1)
        self.bookList1.doubleClicked.connect(self.OpenSearch1)
        self.bookList2 = QtBookList(self, "2", owner)
        self.bookList2.InitBook()
        self.bookList2.doubleClicked.connect(self.OpenSearch2)
        self.horizontalLayout_2.addWidget(self.bookList2)

        self.bookList3 = QtBookList(self, "3", owner)
        self.bookList3.InitBook()
        self.bookList3.doubleClicked.connect(self.OpenSearch3)
        self.horizontalLayout_3.addWidget(self.bookList3)
        p = QPixmap()
        p.loadFromData(DataMgr().GetData("fold2"))
        q = QPixmap()
        q.loadFromData(DataMgr().GetData("fold1"))
        self.toolButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        self.toolButton.setIcon(QIcon(p))
        self.bookList1.setVisible(False)
        self.toolButton_2.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        self.toolButton_2.setIcon(QIcon(p))
        self.bookList2.setVisible(False)
        self.toolButton_3.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        self.toolButton_3.setIcon(QIcon(q))
        self.bookList3.setVisible(True)

        self.toolButton.clicked.connect(self.SwitchButton1)
        self.toolButton_2.clicked.connect(self.SwitchButton2)
        self.toolButton_3.clicked.connect(self.SwitchButton3)