当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QTextBrowser方法代码示例

本文整理汇总了Python中PyQt4.QtGui.QTextBrowser方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QTextBrowser方法的具体用法?Python QtGui.QTextBrowser怎么用?Python QtGui.QTextBrowser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtGui的用法示例。


在下文中一共展示了QtGui.QTextBrowser方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: manual

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def manual(self):
        data=QtCore.QFile("ar/help_body.html");
        if (data.open(QtCore.QFile.ReadOnly)):
            textstream=QtCore.QTextStream(data);
            textstream.setCodec("UTF-8");
            text=textstream.readAll();
        else:
            text=u"لا يمكن فتح ملف المساعدة"

        Dialog=QtGui.QDialog(self.centralwidget)

        Dialog.setObjectName("Dialog")
        Dialog.resize(480, 480)
        Dialog.setWindowTitle(u'دليل الاستعمال')
        gridLayout = QtGui.QGridLayout(Dialog)
        gridLayout.setObjectName("gridLayout")
        textBrowser = QtGui.QTextBrowser(Dialog)
        textBrowser.setObjectName("textBrowser")
        gridLayout.addWidget(textBrowser, 0, 0, 1, 1)
        buttonBox = QtGui.QDialogButtonBox(Dialog)
        buttonBox.setOrientation(QtCore.Qt.Horizontal)
        buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        buttonBox.setObjectName("buttonBox")
        gridLayout.addWidget(buttonBox, 1, 0, 1, 1)


        QtCore.QObject.connect(buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
        text2=unicode(text)
        textBrowser.setText(text2)
        RightToLeft=1;
        Dialog.setLayoutDirection(RightToLeft);
        Dialog.show(); 
开发者ID:linuxscout,项目名称:mishkal,代码行数:35,代码来源:appgui.py

示例2: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def setupUi(self, howToWidget):
        howToWidget.setObjectName(_fromUtf8("howToWidget"))
        howToWidget.resize(800, 600)
        howToWidget.setStyleSheet(_fromUtf8(""))
        self.logoImg = LogoImage(howToWidget)
        self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101))
        self.logoImg.setObjectName(_fromUtf8("logoImg"))
        self.howToUseLabel = QtGui.QLabel(howToWidget)
        self.howToUseLabel.setGeometry(QtCore.QRect(60, 50, 271, 31))
        font = QtGui.QFont()
        font.setPointSize(16)
        font.setBold(True)
        font.setWeight(75)
        self.howToUseLabel.setFont(font)
        self.howToUseLabel.setObjectName(_fromUtf8("howToUseLabel"))
        self.setupPushButton = QtGui.QPushButton(howToWidget)
        self.setupPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27))
        self.setupPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.setupPushButton.setObjectName(_fromUtf8("setupPushButton"))
        self.helpPushButton = QtGui.QPushButton(howToWidget)
        self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27))
        self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.helpPushButton.setObjectName(_fromUtf8("helpPushButton"))
        self.howToUseTextBrowser = QtGui.QTextBrowser(howToWidget)
        self.howToUseTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 431))
        self.howToUseTextBrowser.setObjectName(_fromUtf8("howToUseTextBrowser"))

        self.retranslateUi(howToWidget)
        QtCore.QMetaObject.connectSlotsByName(howToWidget) 
开发者ID:glamrock,项目名称:Stormy,代码行数:33,代码来源:howToWidget.py

示例3: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def __init__(self):
        QtGui.QWidget.__init__(self)
        self.vlayout = QtGui.QVBoxLayout()

        self.browser = QtGui.QTextBrowser()
        self.browser.setSource(QtCore.QUrl(
            "library/browser/welcome.html")
        )
        self.browser.setOpenExternalLinks(True)
        self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)

        self.vlayout.addWidget(self.browser)
        self.setLayout(self.vlayout)
        self.show() 
开发者ID:FOSSEE,项目名称:eSim,代码行数:16,代码来源:Welcome.py

示例4: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def setupUi(self, completeWidget):
        completeWidget.setObjectName(_fromUtf8("completeWidget"))
        completeWidget.resize(800, 600)
        completeWidget.setStyleSheet(_fromUtf8(""))
        self.logoImg = LogoImage(completeWidget)
        self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101))
        self.logoImg.setObjectName(_fromUtf8("logoImg"))
        self.installedLabel = QtGui.QLabel(completeWidget)
        self.installedLabel.setGeometry(QtCore.QRect(60, 50, 561, 31))
        font = QtGui.QFont()
        font.setPointSize(16)
        font.setBold(True)
        font.setWeight(75)
        self.installedLabel.setFont(font)
        self.installedLabel.setObjectName(_fromUtf8("installedLabel"))
        self.setupPushButton = QtGui.QPushButton(completeWidget)
        self.setupPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27))
        self.setupPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.setupPushButton.setObjectName(_fromUtf8("setupPushButton"))
        self.helpPushButton = QtGui.QPushButton(completeWidget)
        self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27))
        self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.helpPushButton.setObjectName(_fromUtf8("helpPushButton"))
        self.installedInfoTextBrowser = QtGui.QTextBrowser(completeWidget)
        self.installedInfoTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 181))
        self.installedInfoTextBrowser.setObjectName(_fromUtf8("installedInfoTextBrowser"))
        self.visitHiddenServicePushButton = QtGui.QPushButton(completeWidget)
        self.visitHiddenServicePushButton.setGeometry(QtCore.QRect(396, 330, 225, 50))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.visitHiddenServicePushButton.setFont(font)
        self.visitHiddenServicePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.visitHiddenServicePushButton.setObjectName(_fromUtf8("visitHiddenServicePushButton"))
        self.howToGuidePushButton = QtGui.QPushButton(completeWidget)
        self.howToGuidePushButton.setGeometry(QtCore.QRect(59, 330, 225, 50))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.howToGuidePushButton.setFont(font)
        self.howToGuidePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.howToGuidePushButton.setObjectName(_fromUtf8("howToGuidePushButton"))

        self.retranslateUi(completeWidget)
        QtCore.QMetaObject.connectSlotsByName(completeWidget) 
开发者ID:glamrock,项目名称:Stormy,代码行数:49,代码来源:completeWidget.py

示例5: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def setupUi(self, installWidget):
        installWidget.setObjectName(_fromUtf8("installWidget"))
        installWidget.resize(800, 600)
        installWidget.setStyleSheet(_fromUtf8(""))
        self.logoImg = LogoImage(installWidget)
        self.logoImg.setGeometry(QtCore.QRect(698, 10, 141, 101))
        self.logoImg.setObjectName(_fromUtf8("logoImg"))
        self.installLabel = QtGui.QLabel(installWidget)
        self.installLabel.setGeometry(QtCore.QRect(60, 50, 561, 31))
        font = QtGui.QFont()
        font.setPointSize(16)
        font.setBold(True)
        font.setWeight(75)
        self.installLabel.setFont(font)
        self.installLabel.setObjectName(_fromUtf8("installLabel"))
        self.howPushButton = QtGui.QPushButton(installWidget)
        self.howPushButton.setGeometry(QtCore.QRect(714, 130, 71, 27))
        self.howPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.howPushButton.setObjectName(_fromUtf8("howPushButton"))
        self.helpPushButton = QtGui.QPushButton(installWidget)
        self.helpPushButton.setGeometry(QtCore.QRect(713, 163, 71, 27))
        self.helpPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.helpPushButton.setObjectName(_fromUtf8("helpPushButton"))
        self.installInfoTextBrowser = QtGui.QTextBrowser(installWidget)
        self.installInfoTextBrowser.setGeometry(QtCore.QRect(60, 110, 561, 271))
        self.installInfoTextBrowser.setObjectName(_fromUtf8("installInfoTextBrowser"))
        self.continuePushButton = QtGui.QPushButton(installWidget)
        self.continuePushButton.setGeometry(QtCore.QRect(460, 400, 120, 50))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.continuePushButton.setFont(font)
        self.continuePushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.continuePushButton.setObjectName(_fromUtf8("continuePushButton"))
        self.goBackPushButton = QtGui.QPushButton(installWidget)
        self.goBackPushButton.setGeometry(QtCore.QRect(100, 400, 120, 50))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.goBackPushButton.setFont(font)
        self.goBackPushButton.setStyleSheet(_fromUtf8("background-color:rgb(85, 170, 255);\n"
"color:rgb(255,255,255)"))
        self.goBackPushButton.setObjectName(_fromUtf8("goBackPushButton"))

        self.retranslateUi(installWidget)
        QtCore.QMetaObject.connectSlotsByName(installWidget) 
开发者ID:glamrock,项目名称:Stormy,代码行数:49,代码来源:installWidget.py

示例6: createWidget

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def createWidget(self, style, listWidget, chat_msg,uin,flag=0,g_sender=None):
        self.listWidgetItem = QtGui.QListWidgetItem(listWidget)
        self.listWidgetItem.setSizeHint(QtCore.QSize(0, 50))
        self.widget = QtGui.QWidget()
        self.graphicsView = QtGui.QGraphicsView(self.widget)
        self.label = QtGui.QTextBrowser(self.widget)
        self.label.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        orient=''
        if flag==0:
            ruin=uin
        else:
            ruin=g_sender
            print 'img senderuin:',ruin
        if style == 0:
            self.widget.setGeometry(QtCore.QRect(0, 10, 455, 50))
            self.graphicsView.setGeometry(QtCore.QRect(5, 5, 60, 60))
            self.graphicsView.setScene(self.createImg(ruin,flag,g_sender))
            self.graphicsView.resize(50,50)
            self.label.setGeometry(QtCore.QRect(50, 5, 390, 50))
            orient='left'
        elif style == 1:
            self.widget.setGeometry(QtCore.QRect(0, 10, 455, 50))
            self.graphicsView.setGeometry(QtCore.QRect(392, 5, 60, 60))
            self.graphicsView.setScene(self.createImg(ruin,flag,g_sender))
            self.graphicsView.resize(50,50)
            self.label.setGeometry(QtCore.QRect(10, 5, 390, 50))
            orient='right'
        # msg edit
        if flag==1:
            nick=self.groupInfo[uin][g_sender]['nick']
        if flag==2:
            nick=self.discussInfo[uin][g_sender]['nick']
        if flag==1 or flag==2:
            chat_msg=u'<p><b>'+nick+'</b></p><p>'+chat_msg+'</p>'
        content = u'''
<html><body><p align="'''+orient+'''"> ''' + chat_msg + '''</p></body></html>
        '''
        doc = QtGui.QTextDocument(self.label)
        doc.setHtml(content)
        self.label.setDocument(doc)
        # resize
        size = max(self.label.document().size().height() + 5, 50)
        self.listWidgetItem.setSizeHint(QtCore.QSize(445, size))
        self.widget.resize(455, size)
        self.label.resize(380, size)
        return self.listWidgetItem, self.widget 
开发者ID:younfor,项目名称:PyLinuxQQ,代码行数:48,代码来源:guiChatQQ.py

示例7: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QTextBrowser [as 别名]
def setupUi(self, InitializeDialog):
        InitializeDialog.setObjectName(_fromUtf8("InitializeDialog"))
        InitializeDialog.resize(400, 378)
        self.verticalLayout = QtGui.QVBoxLayout(InitializeDialog)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.textBrowser = QtGui.QTextBrowser(InitializeDialog)
        self.textBrowser.setFocusPolicy(QtCore.Qt.NoFocus)
        self.textBrowser.setObjectName(_fromUtf8("textBrowser"))
        self.verticalLayout.addWidget(self.textBrowser)
        self.label_3 = QtGui.QLabel(InitializeDialog)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.pwFileEdit = QtGui.QLineEdit(InitializeDialog)
        self.pwFileEdit.setObjectName(_fromUtf8("pwFileEdit"))
        self.horizontalLayout.addWidget(self.pwFileEdit)
        self.pwFileButton = QtGui.QPushButton(InitializeDialog)
        self.pwFileButton.setObjectName(_fromUtf8("pwFileButton"))
        self.horizontalLayout.addWidget(self.pwFileButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.label = QtGui.QLabel(InitializeDialog)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label)
        self.masterEdit1 = QtGui.QLineEdit(InitializeDialog)
        self.masterEdit1.setEchoMode(QtGui.QLineEdit.Password)
        self.masterEdit1.setObjectName(_fromUtf8("masterEdit1"))
        self.verticalLayout.addWidget(self.masterEdit1)
        self.label_2 = QtGui.QLabel(InitializeDialog)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2)
        self.masterEdit2 = QtGui.QLineEdit(InitializeDialog)
        self.masterEdit2.setEchoMode(QtGui.QLineEdit.Password)
        self.masterEdit2.setObjectName(_fromUtf8("masterEdit2"))
        self.verticalLayout.addWidget(self.masterEdit2)
        self.buttonBox = QtGui.QDialogButtonBox(InitializeDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(InitializeDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), InitializeDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), InitializeDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(InitializeDialog) 
开发者ID:1deos,项目名称:deosorg,代码行数:47,代码来源:ui_initialize_dialog.py


注:本文中的PyQt4.QtGui.QTextBrowser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。