Python PyQt4.QtGui 模块,QMainWindow() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PyQt4.QtGui.QMainWindow()

项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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);")
        '''
项目:nettools    作者:germandutchwindtunnels    | 项目源码 | 文件源码
def __init__(self, hostname, username, password):
        self.username = username
        self.password = password
        self.hostname = hostname
        self.patchports = None
        self.vlans = None

        #super(PortConfigGui, self).__init__()
        QtGui.QMainWindow.__init__(self)

        install_dir = os.path.dirname(os.path.realpath(__file__))
        uic.loadUi(os.path.join(install_dir, 'PortConfigGui.ui'), self)
        self.statusbar.hide()

        self.buttonReload.clicked.connect(self._reload_data)
        self.buttonClearAll.clicked.connect(self._clear_pressed)
        self.buttonBugreport.clicked.connect(self.send_bug_report)
        self.buttonSubmitAll.clicked.connect(self._submit_all)
        self.setWindowTitle(self.windowTitle() + " " + self.hostname)
项目:CaptsLog    作者:jaehoonhwang    | 项目源码 | 文件源码
def __init__(self, parent=None):
        """Initiate GUI and Database.

        Args:
            db_handler (DBHandlerClass) : calls and initialize database.
            ui (QMainWindow) : calls and initialize main window.

        """
        self.current_selection = False
        self.db_handler = DBHandlerClass()
        super(Main, self).__init__(parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.center_widget.entry.journalEntry.textChanged.connect(self.text_triggered)
        self.ui.center_widget.journalList.currentItemChanged.connect(self.item_changed)
        self.ui.actionNew_Entry.triggered.connect(self.new_entry_action)
        self.ui.action_Save_Entry.triggered.connect(self.save_button_action)
        self.ui.action_edit_entry.triggered.connect(self.edit_button_action)
        self.ui.action_Delete_Entry.triggered.connect(self.delete_button_action)
        self.ui.action_Cancel.triggered.connect(self.action_button_action)
        self.ui.center_widget.entry.journalEntry.setReadOnly(True)
        self.refresh_list_view()
        self.refresh_list_view()
项目:FC    作者:JanusWind    | 项目源码 | 文件源码
def __init__( self, core ) :

        # Inheret all attributes of the "QMainWindow" class.

        super( custom_MainWindow, self ).__init__( )

        # Save the Janus "core" to be associated with this object.

        self.core = core

        # Prepare to respond to signals received from the core.

        self.connect( self.core, SIGNAL('janus_exit'), self.resp_exit )

        # Indicate that if a "closeEvent" is received, that a dialog
        # should be shown.

        self.show_dialog = True

    #-----------------------------------------------------------------------
    # RE-DEFINE THE RESPONSE TO THE CLOSE SIGNAL.
    #-----------------------------------------------------------------------
项目:i3-manager    作者:erayaydin    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.setWindowIcon(QtGui.QIcon(os.path.join(appPath, 'assets', 'images', 'icon.jpg')))

        self.apps = []
        self.workspaces = []
        self.keyboards = []
        self.modes = {}

        self.initConfig()
        self.prepareUi()
        self.listenButtons()

        self.show()
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def __init__(self, main):
        QtGui.QMainWindow.__init__(self, parent=None)
        load_ui(self, 'editor.ui')
        self.setContentsMargins(2, 2, 2, 2)
        pal = self.palette()
        pal.setColor(self.backgroundRole(), QtGui.QColor(20, 20, 20))
        self.setPalette(pal)

        self.main = main
        self.blofeld_library = self.main.blofeld_library
        self.midi = self.main.midi
        self.input = self.midi.input
        self.output = self.midi.output
        self.graph = self.main.graph
        self.channel = 0
        self.octave = 0
        self.params = Params
        self.send = False
        self.notify = True
        self.save = False
        self._edited = False

        self.shown = False
        self.create_layout()
        self.setSoundDump()
项目:MK8-Editor    作者:TheKoopaKingdom    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setWindowTitle("MK8-Editor")
        self.setGeometry(100,100,1080,720)

        self.setupMenu()

        self.qsettings = QtCore.QSettings("MrRean / RoadrunnerWMC","MK8 YAML Editor")
        self.restoreGeometry(self.qsettings.value("geometry").toByteArray())
        self.restoreState(self.qsettings.value("windowState").toByteArray())

        self.gamePath = self.qsettings.value('gamePath').toPyObject()
        if not self.isValidGameFolder(self.gamePath):
            self.changeGamePath(True)


        self.settings = SettingsWidget(self)
        self.setupGLScene()
        self.resizeWidgets()

        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.updateCamera)
        self.timer.start(30)

        self.show()
项目:afDist    作者:jsgounot    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setWindowTitle("Allele frequency viewer")

        self.data = None
        self.genes = {}
        self.lastopeneddir = os.path.expanduser("~")

        self.initUI()
        self.init_menu()
        self.initRegionViewer()
        self.main_widget.setFocus()
        self.setCentralWidget(self.main_widget)
        self.showMaximized()

        self.tab_names = []
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def qui_menubar(self, menu_list_str):
        if not isinstance(self, QtWidgets.QMainWindow):
            print("Warning: Only QMainWindow can have menu bar.")
            return
        menubar = self.menuBar()
        create_opt_list = [ x.strip() for x in menu_list_str.split('|') ]
        for each_creation in create_opt_list:
            ui_info = [ x.strip() for x in each_creation.split(';') ]
            menu_name = ui_info[0]
            menu_title = ''
            if len(ui_info) > 1:
                menu_title = ui_info[1]
            if menu_name not in self.uiList.keys():
                self.uiList[menu_name] = QtWidgets.QMenu(menu_title)
            menubar.addMenu(self.uiList[menu_name])
    # compatible hold function
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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
项目:MidiMemo    作者:MaurizioB    | 项目源码 | 文件源码
def eventFilter(self, source, event):
        if source not in [self.actionStop_btn, self.src_bpm_spin.lineEdit(), self.dest_bpm_spin.lineEdit()]:
            return QtGui.QMainWindow.eventFilter(self, source, event)
        if source == self.actionStop_btn:
            if event.type() not in [QtCore.QEvent.MouseButtonDblClick, QtCore.QEvent.ContextMenu]:
                return QtGui.QMainWindow.eventFilter(self, source, event)
            if event.type() == QtCore.QEvent.ContextMenu:
                return True
            if event.type() == QtCore.QEvent.MouseButtonDblClick:
                self.restart()
                return True
        elif source == self.src_bpm_spin.lineEdit() and event.type() == QtCore.QEvent.MouseButtonRelease and event.button() == 4:
            self.src_bpm_spin.setValue(120)
            return True
        elif source == self.dest_bpm_spin.lineEdit() and event.type() == QtCore.QEvent.MouseButtonRelease and event.button() == 4:
            self.dest_bpm_spin.setValue(self.src_bpm_spin.value())
            return True
        return QtGui.QMainWindow.eventFilter(self, source, event)
项目:Optics    作者:danustc    | 项目源码 | 文件源码
def __init__(self,design_path):
        # initialize the UI.
        self._app = QtGui.QApplication(sys.argv)
        self._window = QtGui.QWidget()
        self._window.closeEvent = self.shutDown

        ui_module = import_module(design_path)
        self._ui = ui_module.Ui_Form()
        try:
            self._ui.setupUi(self._window)
        except:
            self._window = QtGui.QMainWindow()
            self._ui.setupUi(self._window)

        self._window.show()
        self._app.exec_()
项目:core-framework    作者:RedhawkSDR    | 项目源码 | 文件源码
def closeEvent(self, event):
        if self.childrenActive():
            buttons = QtGui.QMessageBox.Yes | QtGui.QMessageBox.No | QtGui.QMessageBox.Cancel
            status = QtGui.QMessageBox.question(self, 'Processes active', """There are active processes. Do you want to terminate them?""", buttons)
            if status == QtGui.QMessageBox.Cancel:
                event.ignore()
                return
            elif status == QtGui.QMessageBox.Yes:
                self.terminateChildren()
        QtGui.QMainWindow.closeEvent(self, event)
项目:CPNSimulatorGui    作者:chris-kuhr    | 项目源码 | 文件源码
def __init__(self):
        super(QtGui.QMainWindow, self).__init__()    
        self.diagramScene = QtGui.QGraphicsScene(self)  
        uic.loadUi('arrow.ui', self)  
        self.graphicsView.setScene( self.diagramScene )
        t1 = QtGui.QGraphicsRectItem(QtCore.QRectF(20,20,100,50 )) 
        t1.setBrush(QtGui.QBrush(QtCore.Qt.white))
#         t1.setFlag( QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMoveable )
        self.diagramScene.addItem(t1) 
        p1 = QtGui.QGraphicsEllipseItem(QtCore.QRectF(200,200,100,50))
        p1.setBrush(QtGui.QBrush(QtCore.Qt.white))
#         p1.setFlags( QtGui.QGraphicsItem.ItemIsSelectable | QtGui.QGraphicsItem.ItemIsMoveable )
        arc1 = ArcItem(self, self.diagramScene)
        arc1.arcLine.setLine(20,20,200,200)
        arc1.setPolygon()
        self.diagramScene.addItem(p1)
        self.show()
        pass
项目:SimpleSniffer    作者:HatBoy    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setWindowTitle(u'?????')
        self.resize(700, 650)
        self.setWindowIcon(QtGui.QIcon('icons/logo.ico'))
        screen = QtGui.QDesktopWidget().screenGeometry()
        size = self.geometry()
        self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)
        self.initUI()
项目:Multiple-Uyghur-Script-Converter    作者:neouyghur    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.btnConvert.clicked.connect(self.btnConvert_clicked)
        # self.ui.btnDefault.clicked.connect(self.btnDefault_clicked)
        self.ui.actionInput_File.triggered.connect(self.selectInputFile)
        self.ui.actionOutput_File.triggered.connect(self.setOutputFile)
项目:Multiple-Uyghur-Script-Converter    作者:neouyghur    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.btnConvert.clicked.connect(self.btnConvert_clicked)
        self.ui.btnDefault.clicked.connect(self.btnDefault_clicked)
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.main =  Ui_MainWindow()
        self.flowconfig = flowconfig.FlowConfig(self)        
        self.app = None
        self.streammod = StreamTable(self)

        # Dialogs
        self.aboutdialog = AboutDialog.AboutDialog(self) 

        # Initialized after setupUi runs
        self.interfacesgui = None
        self.protocolsgui = None
        self.rulegui = None
        self.dbgui = None

        debugger_uri = "PYROLOC://127.0.0.1:7766/debugger"
        self.remote_debugger = Pyro.core.getProxyForURI(debugger_uri)

        self.main.dbname = self.remote_debugger.getdatabase()
        #self.proxy = xmlrpclib.ServerProxy("http://localhost:20757")
        #self.objectproxy = xmlrpclib.ServerProxy("http://localhost:20758")
        self.curdebugevent = ""

        self.log = logging.getLogger("mallorygui")
        config = Config()
        config.logsetup(self.log)
项目:SameKeyProxy    作者:xzhou    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.main =  Ui_MainWindow()        
        self.app = None
        self.bdata = None
        self.ready = False
项目:SWProxy-plugins    作者:lstern    | 项目源码 | 文件源码
def __init__(self, ip, port=8080, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.ipAddress.setText(ip)
        self.ui.proxyPort.setValue(port)
        self.ui.startProxy.clicked.connect(self.startStopProxy)
        self.ui.actionQuit.triggered.connect(self.quit)
        self.ui.actionAbout.triggered.connect(self.about)
        self.ui.actionOpen_PCAP.triggered.connect(self.openPCAP)
        self.proxy = None
项目:base_function    作者:Rockyzsu    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setGeometry(300, 300, 180, 380)
        self.setWindowTitle('Tetris')
        self.tetrisboard = Board(self)
        self.setCentralWidget(self.tetrisboard)
        self.statusbar = self.statusBar()
        self.connect(self.tetrisboard, QtCore.SIGNAL("messageToStatusbar(QString)"),
                     self.statusbar, QtCore.SLOT("showMessage(QString)"))
        self.tetrisboard.start()
        self.center()
项目:base_function    作者:Rockyzsu    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        Ui_MainWindow.__init__(self)
        self.setupUi(self)
        print type(Ui_MainWindow)
        print type(QtBaseClass)
        self.getName.clicked.connect(self.showName)
项目:CaptsLog    作者:jaehoonhwang    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)

        self.initUI()
项目:rec-attend-public    作者:renmengye    | 项目源码 | 文件源码
def paintEvent(self, event):
        # Create a QPainter that can perform draw actions within a widget or image
        qp = QtGui.QPainter()
        # Begin drawing in the application widget
        qp.begin(self)
        # Update scale
        self.updateScale(qp)
        # Determine the object ID to highlight
        self.getHighlightedObject(qp)
        # Draw the image first
        self.drawImage(qp)

        if self.enableDisparity and self.showDisparity:
            # Draw the disparities on top
            overlay = self.drawDisp(qp)
        else:
            # Draw the labels on top
            overlay = self.drawLabels(qp)
            # Draw the label name next to the mouse
            self.drawLabelAtMouse(qp)

        # Draw the zoom
        self.drawZoom(qp, overlay)

        # Thats all drawing
        qp.end()

        # Forward the paint event
        QtGui.QMainWindow.paintEvent(self,event)

    # Update the scaling
项目:SyncIt    作者:ITCoders    | 项目源码 | 文件源码
def create(self):
        MainWindow = QtGui.QMainWindow()
        self.ui.setupUi(MainWindow)
        self.ui.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.sync_object = sync()
        QObject.connect(self.ui.pushButton,SIGNAL("clicked()"),self.sync_object.Login)
        QObject.connect(self.ui.pushButton_5,SIGNAL("clicked()"),self.makeTreeView)
        QObject.connect(self.ui.pushButton_2,SIGNAL("clicked()"),self.select_folder)
        # QObject.connect(self.ui.pushButton_2,SIGNAL("clicked()"),self.openFileDialog)
        self.treeMenu =  QtGui.QMenu()
        self.treeAction = QtGui.QAction('Download', self.treeMenu)
        self.treeAction.triggered.connect(self.download_folder)
        self.ui.treeWidget.addAction(self.treeAction)
        MainWindow.show()
        sys.exit(app.exec_())
项目:cityscapes-api    作者:renmengye    | 项目源码 | 文件源码
def paintEvent(self, event):
        # Create a QPainter that can perform draw actions within a widget or image
        qp = QtGui.QPainter()
        # Begin drawing in the application widget
        qp.begin(self)
        # Update scale
        self.updateScale(qp)
        # Determine the object ID to highlight
        self.getHighlightedObject(qp)
        # Draw the image first
        self.drawImage(qp)

        if self.enableDisparity and self.showDisparity:
            # Draw the disparities on top
            overlay = self.drawDisp(qp)
        else:
            # Draw the labels on top
            overlay = self.drawLabels(qp)
            # Draw the label name next to the mouse
            self.drawLabelAtMouse(qp)

        # Draw the zoom
        self.drawZoom(qp, overlay)

        # Thats all drawing
        qp.end()

        # Forward the paint event
        QtGui.QMainWindow.paintEvent(self,event)

    # Update the scaling
项目:SacredBrowser    作者:michaelwand    | 项目源码 | 文件源码
def __init__(self,application):
        #Init the base class
        QtGui.QMainWindow.__init__(self, None)
        self.application = application
        self.createWidgets()
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)

        # This is always the same
        self.ui=Ui_MainWindow()
        self.ui.setupUi(self)

        self.createActions()

        self.myGraphicsScene=myGraphicsScene()
        self.myGraphicsScene.addLine()

        self.ui.mygraphicsView.setScene(self.myGraphicsScene)
        self.ui.mygraphicsView.show()
项目:dxf2gcode    作者:cnc-club    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)

        self.setGeometry(300, 300, 350, 300)
        self.setWindowTitle('OpenFile')

        self.textEdit = QtGui.QTextEdit()
        self.setCentralWidget(self.textEdit)
        self.statusBar()

        self._label = QtGui.QLabel("Einkaufszaehler")
        self.statusBar().addPermanentWidget(self._label)
        self.statusBar().addPermanentWidget(self._label)

        self._label.setText("BLA2")

        self.setFocus()

        openFile = QtGui.QAction(QtGui.QIcon('open.png'), 'Open', self)
        openFile.setShortcut('Ctrl+O')
        openFile.setStatusTip('Open new File')
        self.connect(openFile, QtCore.SIGNAL('triggered()'), self.showDialog)

        menubar = self.menuBar()
        fileMenu = menubar.addMenu('&File')
        fileMenu.addAction(openFile)
项目:DicomBrowser    作者:ericspod    | 项目源码 | 文件源码
def keyPressEvent(self,e):
        '''Close the window if escape is pressed, otherwise do as inherited.'''
        if e.key() == Qt.Key_Escape:
            self.close()
        else:
            QtGui.QMainWindow.keyPressEvent(self,e)
项目:DicomBrowser    作者:ericspod    | 项目源码 | 文件源码
def show(self):
        '''Calls the inherited show() method then sets the splitter positions.'''
        QtGui.QMainWindow.show(self)
        self.listSplit.moveSplitter(100,1)
        self.seriesSplit.moveSplitter(80,1)
        self.viewMetaSplitter.moveSplitter(600,1)
项目:ImgAnnotaPyQt4    作者:ZhengRui    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.setupUi(self)
        self.ith = None
        self.labels = pd.DataFrame(index=[], columns=['image', 'cateid', 'tlx', 'tly', 'width', 'height'])
        self.labelsBuf = pd.DataFrame(index=[], columns=['image', 'cateid', 'tlx', 'tly', 'width', 'height'])
        self.labelFile = ''
        self._penwidth = 2 # even value
        self._offset = self._penwidth/2
        self.initializeTasks()
项目:cityscapesScripts    作者:mcordts    | 项目源码 | 文件源码
def paintEvent(self, event):
        # Create a QPainter that can perform draw actions within a widget or image
        qp = QtGui.QPainter()
        # Begin drawing in the application widget
        qp.begin(self)
        # Update scale
        self.updateScale(qp)
        # Determine the object ID to highlight
        self.getHighlightedObject(qp)
        # Draw the image first
        self.drawImage(qp)

        if self.enableDisparity and self.showDisparity:
            # Draw the disparities on top
            overlay = self.drawDisp(qp)
        else:
            # Draw the labels on top
            overlay = self.drawLabels(qp)
            # Draw the label name next to the mouse
            self.drawLabelAtMouse(qp)

        # Draw the zoom
        self.drawZoom(qp, overlay)

        # Thats all drawing
        qp.end()

        # Forward the paint event
        QtGui.QMainWindow.paintEvent(self,event)

    # Update the scaling
项目:cityscapesScripts    作者:mcordts    | 项目源码 | 文件源码
def paintEvent(self, event):
        # Create a QPainter that can perform draw actions within a widget or image
        qp = QtGui.QPainter()
        # Begin drawing in the application widget
        qp.begin(self)
        # Update scale
        self.updateScale(qp)
        # Determine the object ID to highlight
        self.getHighlightedObject(qp)
        # Draw the image first
        self.drawImage(qp)
        # Draw the labels on top
        overlay = self.drawLabels(qp)
        # Draw the user drawn polygon
        self.drawDrawPoly(qp)
        self.drawDrawRect(qp)
        # Draw the label name next to the mouse
        self.drawLabelAtMouse(qp)
        # Draw the zoom
        # self.drawZoom(qp, overlay)
        self.drawZoom(qp,None)

        # Thats all drawing
        qp.end()

        # Forward the paint event
        QtGui.QMainWindow.paintEvent(self,event)

    # Update the scaling
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def getMayaWindow():
    """
    Get the main Maya window as a QtGui.QMainWindow instance
    @return: QtGui.QMainWindow instance of the top level Maya windows
    """
    ptr = apiUI.MQtUtil.mainWindow()
    if ptr is not None:
        return sip.wrapinstance(long(ptr), QtCore.QObject)
项目:Modular_Rigging_Thesis    作者:LoganKelly    | 项目源码 | 文件源码
def getMayaWindow(self):
        """
        Get the main Maya window as a QtGui.QMainWindow instance
        @return: QtGui.QMainWindow instance of the top level Maya windows
        """
        ptr = apiUI.MQtUtil.mainWindow()
        if ptr is not None:
            return sip.wrapinstance(long(ptr), QObject)
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def CreateSeq16(self):
        window = QtGui.QMainWindow()    
        ui = seq16.Ui_MainWindow()
        ui.setupUi(window,True)
        self.mdiArea.addSubWindow(window)
        self.windows[window] = ui
        window.resize(940,600)
        window.show()
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def CreateSeq16x8(self):
        window = QtGui.QMainWindow()    
        ui = seq16x8.Ui_MainWindow()
        ui.setupUi(window,True)
        self.mdiArea.addSubWindow(window)
        self.windows[window] = ui
        window.show()
项目:ProStep    作者:Gaultus    | 项目源码 | 文件源码
def CreateProSeq16x8(self):

        window = QtGui.QMainWindow()    
        ui = proseq16x8.Ui_MainWindow()
        ui.setupUi(window,True)
        self.mdiArea.addSubWindow(window)
        self.windows[window] = ui
        window.show()
项目:PyQt-Image-Viewer    作者:ap193uee    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QMainWindow.__init__(self, parent)
        self.setupUi(self)

        self.cntr, self.numImages = -1, -1  # self.cntr have the info of which image is selected/displayed

        self.image_viewer = ImageViewer(self.qlabel_image)
        self.__connectEvents()
        self.showMaximized()
项目:PyQt5_stylesheets    作者:RedFalsh    | 项目源码 | 文件源码
def main():
    """
    Application entry point
    """
    logging.basicConfig(level=logging.DEBUG)
    # create the application and the main window
    app = QtGui.QApplication(sys.argv)
    window = QtGui.QMainWindow()

    # setup ui
    ui = example_ui.Ui_MainWindow()
    ui.setupUi(window)
    ui.bt_delay_popup.addActions([
        ui.actionAction,
        ui.actionAction_C
    ])
    ui.bt_instant_popup.addActions([
        ui.actionAction,
        ui.actionAction_C
    ])
    ui.bt_menu_button_popup.addActions([
        ui.actionAction,
        ui.actionAction_C
    ])
    window.setWindowTitle("QDarkStyle example")

    # tabify dock widgets to show bug #6
    window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)

    # setup stylesheet
    app.setStyleSheet(qdarkstyle.load_stylesheet(pyside=False))

    # auto quit after 2s when testing on travis-ci
    if "--travis" in sys.argv:
        QtCore.QTimer.singleShot(2000, app.exit)

    # run
    window.show()
    app.exec_()
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def setWindowTitle(self, name=None):
        if name is None:
            name = self.name_edit.text()
        saved = '' if self.save_state else ' (edited)'
        QtGui.QMainWindow.setWindowTitle(self, 'Wavetable editor - {}{}'.format(name, saved))
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def eventFilter(self, source, event):
        if source == self.gain_spin and event.type() == QtCore.QEvent.Wheel:
            if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ShiftModifier:
                self.gain_spin.setSingleStep(.01)
            else:
                self.gain_spin.setSingleStep(.1)
        elif ((event.type() == QtCore.QEvent.KeyPress and event.modifiers() & (QtCore.Qt.ShiftModifier|QtCore.Qt.ControlModifier)) or event.type() == QtCore.QEvent.KeyRelease) and self.wave_source_view.rect().contains(self.wave_source_view.mapFromGlobal(QtGui.QCursor().pos())):
            self.wave_source_view.event(event)
            return True
        return QtGui.QMainWindow.eventFilter(self, source, event)
项目:Bigglesworth    作者:MaurizioB    | 项目源码 | 文件源码
def eventFilter(self, source, event):
        if event.type() == QtCore.QEvent.KeyPress:
            if event.key() == QtCore.Qt.Key_F5:
                self.dump_request_create()
            elif event.key() == QtCore.Qt.Key_Escape and source == self.search_edit:
                self.search_edit.setText('')
        if source == self.search_filter_chk and event.type() == QtCore.QEvent.FocusIn and event.reason() == QtCore.Qt.OtherFocusReason:
            self.search_edit.setFocus()
        return QtGui.QMainWindow.eventFilter(self, source, event)
项目:py-ffmpeg    作者:dandydarcy    | 项目源码 | 文件源码
def __init__(self, *args):
        QtGui.QMainWindow.__init__(self, *args)
        self._i=numpy.zeros((1,1,4),dtype=numpy.uint8)
        self.i=QtGui.QImage(self._i.data,self._i.shape[1],self._i.shape[0],self.imgconvarray[self._i.shape[2]])
        self.show()
项目:py-ffmpeg    作者:dandydarcy    | 项目源码 | 文件源码
def __init__(self, *args):
            QtGui.QMainWindow.__init__(self, *args)
            self._i=numpy.zeros((1,1,4),dtype=numpy.uint8)
            self.i=QtGui.QImage(self._i.data,self._i.shape[1],self._i.shape[0],self.imgconvarray[self._i.shape[2]])
            self.show()
项目:py-ffmpeg    作者:dandydarcy    | 项目源码 | 文件源码
def __init__(self, *args):
            QtGui.QMainWindow.__init__(self, *args)
            self._i=numpy.zeros((1,1,4),dtype=numpy.uint8)
            self.i=QtGui.QImage(self._i.data,self._i.shape[1],self._i.shape[0],self.imgconvarray[self._i.shape[2]])
            self.show()
项目:py-ffmpeg    作者:dandydarcy    | 项目源码 | 文件源码
def __init__(self, *args):
            QtGui.QMainWindow.__init__(self, *args)
            self._i=numpy.zeros((1,1,4),dtype=numpy.uint8)
            self.i=QtGui.QImage(self._i.data,self._i.shape[1],self._i.shape[0],self.imgconvarray[self._i.shape[2]])
            self.show()
项目:py-ffmpeg    作者:dandydarcy    | 项目源码 | 文件源码
def __init__(self, *args):
            QtGui.QMainWindow.__init__(self, *args)
            self._i=numpy.zeros((1,1,4),dtype=numpy.uint8)
            self.i=QtGui.QImage(self._i.data,self._i.shape[1],self._i.shape[0],self.imgconvarray[self._i.shape[2]])
            self.show()
项目:123-Movies-Player    作者:six519    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        self.qtApp = QtGui.QApplication([])
        super(QtGui.QMainWindow, self).__init__(*args, **kwargs)

        self.vlcInstance = vlc.Instance()
        self.vlcMediaPlayer = self.vlcInstance.media_player_new()
        self.isFullScreen = False
        self.currentMRL = ""
        self.subtitleFile = ""
        self.initUI()
        self.originalBackground = self.palette().color(self.backgroundRole())