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


Python QtGui.QDialog方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def __init__(self):
        super(addVariable,self).__init__()
        self.UI = QtGui.QDialog()
        self.drawUI()
        self.allowedProperties = [  'App::PropertyBool',
                                    'App::PropertyBoolList',
                                    'App::PropertyInteger',
                                    'App::PropertyIntegerList',
                                    'App::PropertyFloat',
                                    'App::PropertyFloatList',
                                    'App::PropertyString',
                                    'App::PropertyEnumeration',
                                    #'App::PropertyLink',
                                    'App::PropertyXLink',
                                    'App::PropertyVector',
                                    'App::PropertyMatrix', 
                                    'App::PropertyPlacement',
                                    'App::PropertyColor',
                                    'App::PropertyFile'] 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:21,代码来源:VariablesLib.py

示例2: setupWin

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

示例3: setupWin

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

示例4: __init__

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

        self.protocol_dir = prefs.PROTOCOLDIR

        tabWidget = QtGui.QTabWidget()

        self.bio_tab = self.Biography_Tab()
        tabWidget.addTab(self.bio_tab, "Biography")

        if self.protocol_dir:
            self.task_tab = self.Task_Tab()
            tabWidget.addTab(self.task_tab, "Protocol")

        buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
        buttonBox.accepted.connect(self.accept)
        buttonBox.rejected.connect(self.reject)

        mainLayout = QtGui.QVBoxLayout()
        mainLayout.addWidget(tabWidget)
        mainLayout.addWidget(buttonBox)
        self.setLayout(mainLayout)

        self.setWindowTitle("Setup New Subject") 
开发者ID:wehr-lab,项目名称:autopilot,代码行数:26,代码来源:gui.py

示例5: showAbout

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def showAbout(self):
        widget = QtGui.QDialog(self)
        widget.setWindowTitle("About PySimulator")
        p = QtGui.QPalette()
        p.setColor(QtGui.QPalette.Background, QtGui.QColor("white"))
        widget.setPalette(p)
        layout = QtGui.QGridLayout(widget)
        widget.setLayout(layout)
        pixmap = QtGui.QPixmap(self.rootDir + "/Icons/dlr-splash.png")
        iconLabel = QtGui.QLabel()
        iconLabel.setPixmap(pixmap)
        layout.addWidget(iconLabel, 0, 0)
        layout.addWidget(QtGui.QLabel("Copyright (C) 2011-2015 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.),\nInstitute of System Dynamics and Control. All rights reserved.\n\nPySimulator is free software: You can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nPySimulator is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with PySimulator. If not, see www.gnu.org/licenses."), 1, 0)
        layout.addWidget(QtGui.QLabel("PySimulator Version: " + str(version)), 2, 0)
        button = QtGui.QPushButton("OK")
        button.clicked.connect(widget.close)
        layout.addWidget(button, 3, 0)
        widget.show() 
开发者ID:PySimulator,项目名称:PySimulator,代码行数:20,代码来源:PySimulator.py

示例6: get_QDialog

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def get_QDialog():
    """QDialog getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QDialog
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QDialog 
开发者ID:AirbusCyber,项目名称:grap,代码行数:11,代码来源:QtShim.py

示例7: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def __init__(self):
        super(animateVariable,self).__init__()
        self.UI = QtGui.QDialog()
        self.drawUI() 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:6,代码来源:AnimationLib.py

示例8: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def __init__(self):
        super(Asm4Help,self).__init__()
        self.UI = QtGui.QDialog()
        self.drawUI() 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:6,代码来源:HelpCmd.py

示例9: Activated

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def Activated(self):
        self.UI = QtGui.QDialog()
        # get the current active document to avoid errors if user changes tab
        self.modelDoc = App.ActiveDocument
        self.model = self.modelDoc.Model
        self.drawUI()
        self.UI.show()
        self.BOM.clear()
        self.PartsList = ''
        self.listParts(self.model)
        self.BOM.setPlainText(self.PartsList) 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:13,代码来源:makeBomCmd.py

示例10: drawUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def drawUI(self):
        # Our main window will be a QDialog
        self.UI.setWindowTitle('Parts List / BOM')
        self.UI.setWindowIcon( QtGui.QIcon( os.path.join( Asm4.iconPath , 'FreeCad.svg' ) ) )
        self.UI.setWindowFlags( QtCore.Qt.WindowStaysOnTopHint )
        self.UI.setModal(False)
        # set main window widgets layout
        self.mainLayout = QtGui.QVBoxLayout(self.UI)

        # The list, is a plain text field
        self.BOM = QtGui.QPlainTextEdit()
        self.BOM.setMinimumSize(600,500)
        self.BOM.setLineWrapMode(QtGui.QPlainTextEdit.NoWrap)
        self.mainLayout.addWidget(self.BOM)

        # the button row definition
        self.buttonLayout = QtGui.QHBoxLayout()
        self.buttonLayout.addStretch()
        # Save button
        self.CopyButton = QtGui.QPushButton('Copy')
        self.buttonLayout.addWidget(self.CopyButton)
        # Save button
        #self.SaveButton = QtGui.QPushButton('Save')
        #self.buttonLayout.addWidget(self.SaveButton)
        # OK button
        self.OkButton = QtGui.QPushButton('Close')
        self.OkButton.setDefault(True)
        self.buttonLayout.addWidget(self.OkButton)
        self.mainLayout.addLayout(self.buttonLayout)

        # finally, apply the layout to the main window
        self.UI.setLayout(self.mainLayout)

        # Actions
        self.CopyButton.clicked.connect(self.onCopy)
        #self.SaveButton.clicked.connect(self.onSave)
        self.OkButton.clicked.connect(self.onOK)

# add the command to the workbench 
开发者ID:Zolko-123,项目名称:FreeCAD_Assembly4,代码行数:41,代码来源:makeBomCmd.py

示例11: setupUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def setupUI(self, layout='grid'):
        #------------------------------
        # main_layout auto creation for holding all the UI elements
        #------------------------------
        main_layout = None
        if isinstance(self, QtWidgets.QMainWindow):
            main_widget = QtWidgets.QWidget()
            self.setCentralWidget(main_widget)        
            main_layout = self.quickLayout(layout, 'main_layout') # grid for auto fill window size
            main_widget.setLayout(main_layout)
        else:
            # main_layout for QDialog
            main_layout = self.quickLayout(layout, 'main_layout')
            self.setLayout(main_layout) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:16,代码来源:GearBox_template_1010.py

示例12: setupUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def setupUI(self):
        #------------------------------
        # main_layout auto creation for holding all the UI elements
        #------------------------------
        main_layout = None
        if isinstance(self, QtWidgets.QMainWindow):
            main_widget = QtWidgets.QWidget()
            self.setCentralWidget(main_widget)        
            main_layout = self.quickLayout('vbox', 'main_layout') # grid for auto fill window size
            main_widget.setLayout(main_layout)
        else:
            # main_layout for QDialog
            main_layout = self.quickLayout('vbox', 'main_layout')
            self.setLayout(main_layout)

        #------------------------------
        # user ui creation part
        #------------------------------
        # + template: qui version since universal tool template v7
        #   - no extra variable name, all text based creation and reference
        
        self.qui('dict_table | source_txtEdit | result_txtEdit','info_split;v')
        self.qui('filePath_input | fileLoad_btn;Load | fileLang_choice | fileExport_btn;Export', 'fileBtn_layout;hbox')
        
        self.qui('info_split | process_btn;Process and Update Memory From UI | fileBtn_layout', 'main_layout')
        self.uiList["source_txtEdit"].setWrap(0)
        self.uiList["result_txtEdit"].setWrap(0)
        
        #------------- end ui creation --------------------
        for name,each in self.uiList.items():
            if isinstance(each, QtWidgets.QLayout) and name!='main_layout' and not name.endswith('_grp_layout'):
                each.setContentsMargins(0,0,0,0) # clear extra margin some nested layout
        #self.quickInfo('Ready') 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:35,代码来源:UITranslator.py

示例13: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def __init__(self, parent=None, mode=0):
        QtGui.QMainWindow.__init__(self, parent)
        #QtGui.QDialog.__init__(self, parent)
        
        self.version="1.0"
        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        
        self.fileType='.UITranslator_EXT'
        # mode: example for receive extra user input as parameter
        self.mode = 0
        if mode in [0,1]:
            self.mode = mode # mode validator
        
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(__file__) # location: ref: sys.modules[__name__].__file__
            
        self.setupStyle()
        self.setupMenu() # only if you use QMainWindows Class
        self.setupWin()
        self.setupUI()
        self.Establish_Connections()
        self.loadData()
        self.loadLang() 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:31,代码来源:UITranslator_v1.0.py

示例14: setupUI

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def setupUI(self):
        #------------------------------
        # main_layout auto creation for holding all the UI elements
        #------------------------------
        main_layout = None
        if isinstance(self, QtWidgets.QMainWindow):
            main_widget = QtWidgets.QWidget()
            self.setCentralWidget(main_widget)        
            main_layout = self.quickLayout('vbox', 'main_layout') # grid for auto fill window size
            main_widget.setLayout(main_layout)
        else:
            # main_layout for QDialog
            main_layout = self.quickLayout('vbox', 'main_layout')
            self.setLayout(main_layout) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:16,代码来源:universal_tool_template_0903.py

示例15: setupWin

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDialog [as 别名]
def setupWin(self):
        super(self.__class__,self).setupWin()
        self.setGeometry(500, 300, 250, 110) # self.resize(250,250)
        
        #------------------------------
        # template list: for frameless or always on top option
        #------------------------------
        # - template : keep ui always on top of all;
        # While in Maya, dont set Maya as its parent
        '''
        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) 
        '''
        
        # - template: hide ui border frame; 
        # While in Maya, use QDialog instead, as QMainWindow will make it disappear
        '''
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        '''
        
        # - template: best solution for Maya QDialog without parent, for always on-Top frameless ui
        '''
        self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint)
        '''
        
        # - template: for transparent and non-regular shape ui
        # note: use it if you set main ui to transparent, and want to use alpha png as irregular shape window
        # note: black color better than white for better look of semi trans edge, like pre-mutiply
        '''
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
        self.setStyleSheet("background-color: rgba(0, 0, 0,0);")
        ''' 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:33,代码来源:universal_tool_template_0903.py


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