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


Python QtGui.QDialog方法代码示例

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


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

示例1: doSettings

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def doSettings(millisecWait, depth, fontSize):
  global ui
  Dialog = QtGui.QDialog()
  settings = uic.loadUi(os.path.join(os.path.dirname(__file__), "./ui/settings.ui"), baseinstance=Dialog)
  ui = settings
  Dialog.setModal(True)
  QtCore.QObject.connect(settings.lineEditNfSamples,  QtCore.SIGNAL('textChanged (const QString&)'), onChange)
  QtCore.QObject.connect(settings.lineEditTimesSecond,  QtCore.SIGNAL('textChanged (const QString&)'), onChange)
  ui.lineEditTimesSecond.setText(str(float(1000.0 / (millisecWait * 1.0))))
  ui.lineEditNfSamples.setText(str(depth))
  ui.lineEditFontSize.setText(str(fontSize))
  Dialog.exec_()
  
  millisecWait = int(1000.0 / float(str(ui.lineEditTimesSecond.displayText())))
  depth = int(str(ui.lineEditNfSamples.displayText()))
  fontSize = int(str(ui.lineEditFontSize.displayText()))
  return(millisecWait, depth, fontSize) 
开发者ID:wolfc01,项目名称:procexp,代码行数:19,代码来源:settings.py

示例2: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self,parent = None):
        QtGui.QDialog.__init__(self, parent)

        self.parent = parent

        self.formats = ["%A, %d. %B %Y %H:%M",
                        "%A, %d. %B %Y",
                        "%d. %B %Y %H:%M",
                        "%d.%m.%Y %H:%M",
                        "%d. %B %Y",
                        "%d %m %Y",
                        "%d.%m.%Y",
                        "%x",
                        "%X",
                        "%H:%M"]
         
        self.initUI() 
开发者ID:goldsborough,项目名称:Writer,代码行数:19,代码来源:datetime.py

示例3: get_code

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def get_code(url, size=(640, 480), title="Google authentication"):
    """Open a QT webkit window and return the access code."""
    app = QtGui.QApplication([])
    dialog = QtGui.QDialog()
    dialog.setWindowTitle(title)
    dialog.resize(*size)
    webview = QtWebKit.QWebView()
    webpage = QtWebKit.QWebPage()
    webview.setPage(webpage)           
    webpage.loadFinished.connect(lambda: _on_qt_page_load_finished(dialog, webview))
    webview.setUrl(QtCore.QUrl.fromEncoded(url))
    layout = QtGui.QGridLayout()
    layout.addWidget(webview)
    dialog.setLayout(layout)
    dialog.authorization_code = None
    dialog.show()
    app.exec_()
    return dialog.authorization_code 
开发者ID:tokland,项目名称:shoogle,代码行数:20,代码来源:browser.py

示例4: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self):
    """
    Initializes a new instance of this class.
    """

    QtGui.QDialog.__init__(self)

    self.initUI()

    #region Instance fields

    self.encodings = []
    """Temporary list of encodings that is being edited"""

    self.encodingsChanged = False
    """Flag to indicate if encodings list was edited"""

    #endregion

  #endregion

  #region Methods 
开发者ID:htm-community,项目名称:nupic.studio,代码行数:24,代码来源:node_sensor_form.py

示例5: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self):
    """
    Initializes a new instance of this class.
    """

    QtGui.QDialog.__init__(self)

    self.initUI()

    #region Instance fields

    self.encodingIdx = -1
    """Index of the encoding that is being edited. If index is -1 the user is creating a new encoding."""

    self.encodings = []
    """Temporary list of encodings that is being edited"""

    #endregion

  #endregion

  #region Methods 
开发者ID:htm-community,项目名称:nupic.studio,代码行数:24,代码来源:node_sensor_encoding_form.py

示例6: setupWin

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def setupWin(self):
        self.setWindowTitle("UITranslator" + " - v" + self.version) 
        self.setGeometry(300, 300, 300, 300)
        # win icon setup
        path = os.path.join(os.path.dirname(self.location),'icons','UITranslator.png')
        self.setWindowIcon(QtGui.QIcon(path))
        # initial win drag position
        self.drag_position=QtGui.QCursor.pos()
        #self.resize(250,250)
        # - for frameless or always on top option
        #self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # it will keep ui always on top of desktop, but to set this in Maya, dont set Maya as its parent
        #self.setWindowFlags(QtCore.Qt.FramelessWindowHint) # it will hide ui border frame, but in Maya, use QDialog instead as QMainWindow will disappear
        #self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) # best for Maya case with QDialog without parent, for always top frameless ui
        # - for transparent and non-regular shape ui
        #self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # use it if you set main ui to transparent and want to use alpha png as irregular shape window
        #self.setStyleSheet("background-color: rgba(0, 0, 0,0);") # black color better white color for get better look of semi trans edge, like pre-mutiply 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:18,代码来源:UITranslator_v1.0.py

示例7: setupWin

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def setupWin(self):
        self.setWindowTitle("TMP_UniversalToolUI_TND" + " - v" + self.version) 
        self.setGeometry(300, 300, 800, 600)
        # win icon setup
        path = os.path.join(os.path.dirname(self.location),'icons','TMP_UniversalToolUI_TND.png')
        self.setWindowIcon(QtGui.QIcon(path))
        # initial win drag position
        self.drag_position=QtGui.QCursor.pos()
        #self.resize(250,250)
        # - for frameless or always on top option
        #self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # it will keep ui always on top of desktop, but to set this in Maya, dont set Maya as its parent
        #self.setWindowFlags(QtCore.Qt.FramelessWindowHint) # it will hide ui border frame, but in Maya, use QDialog instead as QMainWindow will disappear
        #self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint) # best for Maya case with QDialog without parent, for always top frameless ui
        # - for transparent and non-regular shape ui
        #self.setAttribute(QtCore.Qt.WA_TranslucentBackground) # use it if you set main ui to transparent and want to use alpha png as irregular shape window
        #self.setStyleSheet("background-color: rgba(0, 0, 0,0);") # black color better white color for get better look of semi trans edge, like pre-mutiply 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:18,代码来源:universal_tool_template_v7.3.py

示例8: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self, settings):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.setupUi(self)

        # internal GUI signals
        self.axialThresholdEdit.editingFinished.connect(self.checkSettingsValues)
        self.axialMinimumEdit.editingFinished.connect(self.checkSettingsValues)
        self.unlinksThresholdEdit.editingFinished.connect(self.checkSettingsValues)
        self.linksThresholdEdit.editingFinished.connect(self.checkSettingsValues)
        self.closeButtonBox.accepted.connect(self.updateSettings)
        self.closeButtonBox.rejected.connect(self.restoreSettings)

        # hide unused UI buttons
        self.linksThresholdLabel.hide()
        self.linksThresholdEdit.hide()

        #
        self.ok = self.closeButtonBox.button(QtGui.QDialogButtonBox.Ok)
        self.settings = settings
        self.restoreSettings() 
开发者ID:SpaceGroupUCL,项目名称:qgisSpaceSyntaxToolkit,代码行数:23,代码来源:VerificationSettingsDialog.py

示例9: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self,parent = None):
        QtGui.QDialog.__init__(self, parent)

        self.parent = parent
         
        self.initUI() 
开发者ID:goldsborough,项目名称:Writer,代码行数:8,代码来源:table.py

示例10: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self, parent = None, forEditing = False):

        QtGui.QDialog.__init__(self,parent)

        self.parent = parent

        self.cursor = self.parent.text.textCursor()

        self.forEditing = forEditing

        self.initUI() 
开发者ID:goldsborough,项目名称:Writer,代码行数:13,代码来源:link.py

示例11: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self, parent = None):
        
        QtGui.QDialog.__init__(self, parent)

        self.parent = parent

        self.lastStart = 0

        self.initUI() 
开发者ID:goldsborough,项目名称:Writer,代码行数:11,代码来源:find.py

示例12: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.resize(500, 200)
        self.setWindowTitle(u'网络适配器选择')
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
        self.initUI()
        self.show() 
开发者ID:HatBoy,项目名称:SimpleSniffer,代码行数:11,代码来源:Sniffer.py

示例13: print_result

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def print_result(self):
        if "HTML" in self.result:
            data=QtCore.QFile("ar/style.css");
            if (data.open(QtCore.QFile.ReadOnly)):
                mySTYLE_SHEET=QtCore.QTextStream(data).readAll();
    ##            text=unicode(text);
            else:
                mySTYLE_SHEET=u"""
body {
	direction: rtl;
	font-family: Traditional Arabic, "Times New Roman";
	font-size: 16pt;
}
"""
            document = QtGui.QTextDocument("")
            document.setDefaultStyleSheet(mySTYLE_SHEET)
            self.result["HTML"]=u"<html dir=rtl><body dir='rtl'>"+self.result["HTML"]+"</body></html>"
            document.setHtml(self.result["HTML"]);
            printer = QtGui.QPrinter()

            dlg = QtGui.QPrintDialog(printer, self.centralwidget)
            if dlg.exec_() != QtGui.QDialog.Accepted:
                return
            self.ResultVocalized.print_(printer)

        else:
            QtGui.QMessageBox.warning(self.centralwidget,U"خطأ",
                                u"لا شيء يمكن طبعه.") 
开发者ID:linuxscout,项目名称:mishkal,代码行数:30,代码来源:appgui.py

示例14: set_setting

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [as 别名]
def set_setting(self):
        init_Dialog=QtGui.QDialog(self.centralwidget)
        Dialog=Ui_Dialog();
        Dialog.setupUi(init_Dialog);
        if init_Dialog.exec_() == QtGui.QDialog.Accepted:
            self.readSettings();
            self.applySettings(); 
开发者ID:linuxscout,项目名称:mishkal,代码行数:9,代码来源:appgui.py

示例15: manual

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QDialog [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


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