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


Python QDialog.show方法代码示例

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


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

示例1: deleteTab

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
 def deleteTab(self):
     
     dialog = QDialog( self )
     dialog.setWindowTitle( "Remove Tab" )
     dialog.resize( 300, 50 )
     
     mainLayout = QVBoxLayout(dialog)
     
     description = QLabel( "'%s' ���� �����Ͻð� ���ϱ�?".decode('utf-8') % self.tabText( self.currentIndex() ) )
     layoutButtons = QHBoxLayout()
     buttonDelete = QPushButton( "�����".decode('utf-8') )
     buttonCancel = QPushButton( "���".decode('utf-8') )
     
     layoutButtons.addWidget( buttonDelete )
     layoutButtons.addWidget( buttonCancel )
     
     mainLayout.addWidget( description )
     mainLayout.addLayout( layoutButtons )
     
     dialog.show()
     
     def cmd_delete():
         self.removeTab( self.indexOf( self.currentWidget() ) )
         dialog.close()
     
     def cmd_cancel():
         dialog.close()
         
     QtCore.QObject.connect( buttonDelete, QtCore.SIGNAL('clicked()'), cmd_delete )
     QtCore.QObject.connect( buttonCancel, QtCore.SIGNAL('clicked()'), cmd_cancel )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:32,代码来源:createRenderLayer.py

示例2: settings

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
	def settings(self):
		if self.settings_window is None:
			window = QDialog(self)
			self.settings_window = window
		else: window = self.settings_window
		window = self.settings_window
		window.setWindowTitle('Settings')
		
		window.notelabel = QLabel("Currently these settings are only guaranteed to work prior to loading the first MIDI!\nYou'll have to restart ADLMIDI pyGui to change them again if they stop working. \n\nSorry! This will be fixed soon!")
		window.notelabel.setWordWrap(True)
		window.notelabel.setStyleSheet("font-size: 8pt; border-style: dotted; border-width: 1px; padding: 12px;")
		window.banklabel = QLabel("<B>Choose Instrument Bank</B>")
		window.space     = QLabel("")
		window.optlabel  = QLabel("<B>Options</B>")
		
		window.combo = QComboBox()
		window.combo.addItems(self.banks)
		#window.combo.setMaximumWidth(350)
		window.combo.setMaxVisibleItems(12)
		window.combo.setStyleSheet("combobox-popup: 0;")
		window.combo.setCurrentIndex(int(self.progset.value("sound/bank", 1)))
		window.combo.currentIndexChanged.connect(self.saveSettings)
		
		window.perc		= QCheckBox("Adlib Percussion Instrument Mode")
		#window.perc.stateChanged.connect(self.checkOpts)
		window.tremamp  = QCheckBox("Tremolo Amplification Mode")
		#window.tremamp.stateChanged.connect(self.checkOpts)
		window.vibamp   = QCheckBox("Vibrato Amplification Mode")
		#window.vibamp.stateChanged.connect(self.checkOpts)
		window.modscale = QCheckBox("Scaling of Modulator Volume")
		#window.modscale.stateChanged.connect(self.checkOpts)
		
		window.okButton = QPushButton('OK')
		window.okButton.clicked.connect(window.hide)
		
		vbox = QVBoxLayout()
		vbox.addWidget(window.space)
		vbox.addWidget(window.banklabel)
		vbox.addWidget(window.combo)
		vbox.addWidget(window.space)
		vbox.addWidget(window.optlabel)
		vbox.addWidget(window.perc)
		vbox.addWidget(window.tremamp)
		vbox.addWidget(window.vibamp)
		vbox.addWidget(window.modscale)
		vbox.addWidget(window.notelabel)
		
		hbox = QHBoxLayout()
		hbox.addStretch(1)
		hbox.addWidget(window.okButton)
		
		vbox.addLayout(hbox)
		window.setLayout(vbox) 
		
		window.setFixedSize(530, 369)
		window.show()
		window.activateWindow()
		window.raise_()
开发者ID:KittyTristy,项目名称:ADLMIDI-pyGUI,代码行数:60,代码来源:gui.py

示例3: _showpostviewerdialog

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
 def _showpostviewerdialog(self, post):
     d = QDialog(self)
     d.resize(1024, 768)
     l = QVBoxLayout()
     w = PostViewerWidget(post, self._backend, self._masterobserver, self)
     w.nextpostrequested.connect(self._putnextpost)
     w.previouspostrequested.connect(self._putpreviouspost)
     w.closing.connect(d.close)
     l.addWidget(w)
     d.setLayout(l)
     d.setModal(False)
     d.show()
开发者ID:Hydrael,项目名称:4ca,代码行数:14,代码来源:mainwindow.py

示例4: addTab

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
    def addTab(self):
        
        dialog = QDialog( self )
        dialog.setWindowTitle( 'Add Tab' )
        dialog.resize( 300, 50 )
        
        mainLayout = QVBoxLayout( dialog )
        
        tabNameLayout = QHBoxLayout()
        labelTabName = QLabel( 'Tab Name : ' )
        lineEditTabName = QLineEdit()
        tabNameLayout.addWidget( labelTabName )
        tabNameLayout.addWidget( lineEditTabName )
        
        buttonsLayout = QHBoxLayout()
        buttonCreate = QPushButton( "Create" )
        buttonCancel  = QPushButton( "Cancel")
        buttonsLayout.addWidget( buttonCreate )
        buttonsLayout.addWidget( buttonCancel )
        
        mainLayout.addLayout( tabNameLayout )
        mainLayout.addLayout( buttonsLayout )
        
        dialog.show()

        def cmd_create():            
            tabName = lineEditTabName.text()
            if not tabName:
                msgbox = QMessageBox( self )
                msgbox.setText( "�̸��� �������ּ���".decode( 'utf-8' ) )
                msgbox.exec_()
                return

            self.tabWidget.addTab( tabName )
            dialog.close()
        
        def cmd_cancel():
            dialog.close()
        
        QtCore.QObject.connect( lineEditTabName, QtCore.SIGNAL( 'returnPressed()' ), cmd_create )
        QtCore.QObject.connect( buttonCreate, QtCore.SIGNAL( 'clicked()' ), cmd_create )
        QtCore.QObject.connect( buttonCancel, QtCore.SIGNAL( 'clicked()' ), cmd_cancel )
开发者ID:jonntd,项目名称:mayadev-1,代码行数:44,代码来源:createRenderLayer.py

示例5: createProject

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
class createProject():
    def __init__(self, parent):
        
        self.parent = parent
        
        self.directory = ""      
        
        self.dialog = QDialog(parent.parent)
        
        mainLayout = QVBoxLayout()
        
        aux = QHBoxLayout()
        name = QLabel("Project Name: ")
        self.textBox = QLineEdit()
        
        aux.addWidget(name)
        aux.addWidget(self.textBox)
        aux2 = QWidget()
        aux2.setLayout(aux)
        mainLayout.addWidget(aux2)       
        
                    
        auxBox = QHBoxLayout()
        self.directoryLabel = QLabel("Directory: ")
        button = QPushButton("...")
        button.clicked.connect(self.fileChoosing)
        auxBox.addWidget(self.directoryLabel)
        auxBox.addWidget(button)
        auxWidget = QWidget()
        auxWidget.setLayout(auxBox)
        mainLayout.addWidget(auxWidget) 
        
        buttonOk = QPushButton("Create Project")
        buttonOk.clicked.connect(self.okClicked)
        mainLayout.addWidget(buttonOk)
        
        self.dialog.setLayout(mainLayout)
        self.dialog.show()
        
    def fileChoosing(self):
                
        filePicker = QFileDialog()
        self.directory = filePicker.getExistingDirectory(self.parent, "Get Directory")
        self.directoryLabel.setText("Directory: " + self.directory)            
        filePicker.destroy()
        
    def okClicked(self):
               
        if self.directory != "" and self.textBox.text() != "":
            try:
                if self.parent.parent.platform == "linux2":
                    os.mkdir(self.directory + "/"+ self.textBox.text())
                    self.parent.parent.project = Project(self.directory + "/"+ self.textBox.text(), self.textBox.text(), "linux2")
                                                
                elif self.parent.parent.platform == "win32":
                    os.mkdir(self.directory + "\\"+ self.textBox.text())
                    self.parent.parent.project = Project(self.directory + "\\"+ self.textBox.text(), self.textBox.text(), "win32")
                                                                                                    
                self.parent.parent.project.save()
                self.dialog.setVisible(False)
                
                self.parent.parent.fileMenu.saveProjectAction.setEnabled(True)
                self.parent.parent.signalMenu.addSignalAction.setEnabled(True)
                self.parent.parent.signalMenu.applyOperationAction.setEnabled(True)
                
                msg = QMessageBox(self.parent.parent)
                msg.setText("Project created")
                msg.show()
                                  
                               
            except OSError:
                msg = QErrorMessage(self.parent.parent)            
                msg.showMessage("Project already exists")
开发者ID:antiface,项目名称:DSP-Tool,代码行数:75,代码来源:createProject.py

示例6: addSignal

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
class addSignal():
    def __init__(self, parent):
        
        self.parent = parent
        
        self.dialog = QDialog(self.parent.parent)
        
        mainLayout = QVBoxLayout()
        
        aux = QHBoxLayout()
        name = QLabel("Signal Name: ")
        self.nameBox = QLineEdit()
        aux.addWidget(name)
        aux.addWidget(self.nameBox)
        aux2 = QWidget()
        aux2.setLayout(aux)
        mainLayout.addWidget(aux2)   
        
                                       
        auxBox = QHBoxLayout()
        self.fileLabel = QLabel("File: ")
        button = QPushButton("...")
        button.clicked.connect(self.fileChoosing)
        auxBox.addWidget(self.fileLabel)
        auxBox.addWidget(button)
        auxWidget = QWidget()
        auxWidget.setLayout(auxBox)
        mainLayout.addWidget(auxWidget)
        
        
        hBox = QHBoxLayout()
        hBox.addWidget(QLabel("Sample Rate (Hz): "))
        self.sampleRate = QLineEdit()
        self.sampleRate.setText("60")
        hBox.addWidget(self.sampleRate)
        auxW = QWidget()
        auxW.setLayout(hBox)
        mainLayout.addWidget(auxW)      
        
        
        auxBox = QHBoxLayout()
        commentaryLabel = QLabel("Commentary: ")
        self.commentaryBox = QTextEdit()
        auxBox.addWidget(commentaryLabel)
        auxBox.addWidget(self.commentaryBox)
        auxWidget = QWidget()
        auxWidget.setLayout(auxBox)
        mainLayout.addWidget(auxWidget)
        
        
        buttonOk = QPushButton("Add Signal")
        buttonOk.clicked.connect(self.addSignalClicked)
        mainLayout.addWidget(buttonOk)
        
        self.dialog.setLayout(mainLayout)
        self.dialog.show()
        
    def fileChoosing(self):
                        
            filePicker = QFileDialog()
            self.fileName = filePicker.getOpenFileName(self.parent, 'Select File')[0]
            filePicker.destroy() 
            self.fileLabel.setText("File: " + self.fileName)            
            filePicker.destroy()
        
    def addSignalClicked(self):
                
        if self.fileName != "" and self.nameBox.text() != "":
            self.parent.parent.project.addSignal(self.nameBox.text(), self.fileName, self.commentaryBox.toPlainText(), self.sampleRate.text())
            self.dialog.setVisible(False)
            label = self.parent.parent.project.signalList[-1][0].getImage()
            
            if self.parent.parent.table.columnCount() == 0: self.parent.parent.table.setColumnCount(1)
            
            self.parent.parent.table.setRowCount(self.parent.parent.table.rowCount() + 1)
            
            self.parent.parent.table.setCellWidget(len(self.parent.parent.project.signalList)-1,0,label)
            self.parent.parent.table.resizeColumnsToContents()
            self.parent.parent.table.resizeRowsToContents()
            self.parent.parent.setLabels()
                            
            msg = QMessageBox(self.parent.parent)
            msg.setText("Signal added")
            msg.show()       
开发者ID:antiface,项目名称:DSP-Tool,代码行数:86,代码来源:addSignal.py

示例7: UiMain

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
class UiMain(QMainWindow):

    """ The main gui interface, invokes all windows and ties everything
     together
    """

    def __init__(self):
        """ automatically called __init__ function """

        super(UiMain, self).__init__()

        # initialize all the variables that are going to be defined in the
        # future
        self.update_dialog = None
        self.update_dialog_lbl = None
        self.app_select_box = None
        self.selector_lbl = None
        self.current_playing_lbl = None
        self.current_playing = None
        self.misc_messages = None
        self.start_btn = None
        self.output_dir_lbl = None
        self.select_output_dir_btn = None
        self.output_cur_dir_lbl = None
        self.active_items_list = None
        self.inactive_items_list = None
        self.switch_active_item_button_off = None
        self.switch_active_item_button_on = None
        self.switch_output_split_btn = None
        self.switch_output_split_lbl = None

        # initialize the system tray
        # self.system_tray = QSystemTrayIcon(self)
        # self.system_tray.setIcon(QIcon(resource_path('icon.png')))
        # self.system_tray.show()
        # self.system_tray.setToolTip('SMG')
        # self.system_tray.activated.connect(self.on_systray_activated)

        # initialize the main window
        self.setObjectName('self')
        self.setWindowTitle('SMG - By Azeirah')
        self.resize(400, 250)

        # Gives the self an icon
        self.setWindowIcon(QIcon(resource_path('icon.png')))

        # create the tabs
        # the tab widget itself
        self.tabbed_windows = QTabWidget(self)
        self.tabbed_windows.resize(400, 300)

        # tab 1, contains the music player selection
        self.music_players = QFrame()

        # tab 2, contains options
        self.options = QFrame()
        self.tabbed_windows.addTab(self.music_players, 'Music players')
        self.tabbed_windows.addTab(self.options, 'Options')

        # initializes the two tabs, with all the code down below
        self.tab_music_players()
        self.tab_options()

        # shows the main window
        self.show()
        
    def closeEvent(self, event):
        """ an automatically called function when the program is about to
        close.
        """
        # Stops all Threads. These would continue to run in the background
        # Even if the window was closed.
        Main.running = False
        # close the ZuneNowPlaying.exe process
        if Constants.SUBP:
            Constants.SUBP.kill()

    def changeEvent(self, event):
        # if event.type() == QEvent.WindowStateChange:
        #     if self.isMinimized():
        #         event.ignore()
        #         self.hide()
        #         self.system_tray.showMessage('Running', 'Running in the
        #           background.')
        #         return

        super(UiMain, self).changeEvent(event)

    def on_systray_activated(self, reason):
        if reason == QSystemTrayIcon.DoubleClick:
            self.show()

    @staticmethod
    def toggle_split(event):
        # 0 = Qt.Unchecked The item is unchecked.
        # 1 = Qt.PartiallyChecked The item is partially checked. Items in
        # hierarchical models may be partially checked if some, but not all,
        # of
        # their children are checked.
        # 2 = Qt.Checked The item is checked.
#.........这里部分代码省略.........
开发者ID:dylziez,项目名称:SMG,代码行数:103,代码来源:guiv2.py

示例8: __init__

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
 def __init__(self, parent):
     
     dialog = QDialog(parent.parent)
     
     mainLayout = QVBoxLayout()
     
     aux = QHBoxLayout()
     name = QLabel("Signal Name: ")
     nameBox = QLineEdit()
     aux.addWidget(name)
     aux.addWidget(nameBox)
     aux2 = QWidget()
     aux2.setLayout(aux)
     mainLayout.addWidget(aux2)
     
     def fileChoosing():
         global fileName
         
         filePicker = QFileDialog()
         fileName = filePicker.getOpenFileName(parent, 'Select File')[0]
         filePicker.destroy() 
         fileLabel.setText("File: " + fileName)            
         filePicker.destroy()
     
     def addSignalClicked():
         global directory
         
         if fileName != "" and nameBox.text() != "":
             parent.parent.project.addSignal(nameBox.text(), fileName, commentaryBox.toPlainText())
             dialog.setVisible(False)
             label = parent.parent.project.signalList[-1][0].getImage()
             
             if parent.parent.mainWidget.columnCount() == 0: parent.parent.mainWidget.setColumnCount(1)
             
             parent.parent.mainWidget.setRowCount(parent.parent.mainWidget.rowCount() + 1)
             
             parent.parent.mainWidget.setCellWidget(len(parent.parent.project.signalList)-1,0,label)
             parent.parent.mainWidget.resizeColumnsToContents()
             parent.parent.mainWidget.resizeRowsToContents()
                             
             msg = QMessageBox(parent.parent)
             msg.setText("Signal added")
             msg.show()
             
                                    
     auxBox = QHBoxLayout()
     fileLabel = QLabel("File: ")
     button = QPushButton("...")
     button.clicked.connect(fileChoosing)
     auxBox.addWidget(fileLabel)
     auxBox.addWidget(button)
     auxWidget = QWidget()
     auxWidget.setLayout(auxBox)
     mainLayout.addWidget(auxWidget)
     
     auxBox = QHBoxLayout()
     commentaryLabel = QLabel("Commentary: ")
     commentaryBox = QTextEdit()
     auxBox.addWidget(commentaryLabel)
     auxBox.addWidget(commentaryBox)
     auxWidget = QWidget()
     auxWidget.setLayout(auxBox)
     mainLayout.addWidget(auxWidget)
     
     
     buttonOk = QPushButton("Add Signal")
     buttonOk.clicked.connect(addSignalClicked)
     mainLayout.addWidget(buttonOk)
     
     dialog.setLayout(mainLayout)
     dialog.show()  
开发者ID:hectorpinheiro,项目名称:DSP-Tool,代码行数:73,代码来源:addSignal.py

示例9: __init__

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import show [as 别名]
 def __init__(self, parent):
             
     directory = ""      
     
     dialog = QDialog(parent.parent)
     
     mainLayout = QVBoxLayout()
     
     aux = QHBoxLayout()
     name = QLabel("Project Name: ")
     textBox = QLineEdit()
     
     aux.addWidget(name)
     aux.addWidget(textBox)
     aux2 = QWidget()
     aux2.setLayout(aux)
     mainLayout.addWidget(aux2)
     
     def fileChoosing():
         global directory
         
         filePicker = QFileDialog()
         directory = filePicker.getExistingDirectory(parent, "Get Directory")
         directoryLabel.setText("Directory: " + directory)            
         filePicker.destroy()
     
     def okClicked():
         global directory
         
         if directory != "" and textBox.text() != "":
             try:
                 os.mkdir(directory + "/"+ textBox.text())
                 parent.parent.project = Project(directory + "/"+ textBox.text(), textBox.text())
                 parent.parent.project.save()
                 dialog.setVisible(False)
                 
                 parent.parent.fileMenu.saveProjectAction.setEnabled(True)
                 parent.parent.signalMenu.addSignalAction.setEnabled(True)
                 parent.parent.signalMenu.applyOperationAction.setEnabled(True)
                 
                 msg = QMessageBox(parent.parent)
                 msg.setText("Project created")
                 msg.show()
                                   
                                
             except OSError:
                 msg = QErrorMessage(parent.parent)            
                 msg.showMessage("Project already exists")
                 
     auxBox = QHBoxLayout()
     directoryLabel = QLabel("Directory: ")
     button = QPushButton("...")
     button.clicked.connect(fileChoosing)
     auxBox.addWidget(directoryLabel)
     auxBox.addWidget(button)
     auxWidget = QWidget()
     auxWidget.setLayout(auxBox)
     mainLayout.addWidget(auxWidget) 
     
     buttonOk = QPushButton("Create Project")
     buttonOk.clicked.connect(okClicked)
     mainLayout.addWidget(buttonOk)
     
     dialog.setLayout(mainLayout)
     dialog.show() 
开发者ID:hectorpinheiro,项目名称:DSP-Tool,代码行数:67,代码来源:createProject.py


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