Python PyQt4.uic 模块,loadUi() 实例源码

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

项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent):
        super(AutoTagProgressWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('autotagprogresswindow.ui' ), self)

        self.archiveCoverWidget = CoverImageWidget( self.archiveCoverContainer, CoverImageWidget.DataMode, False )
        gridlayout = QtGui.QGridLayout( self.archiveCoverContainer )
        gridlayout.addWidget( self.archiveCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        self.testCoverWidget = CoverImageWidget( self.testCoverContainer, CoverImageWidget.DataMode, False )
        gridlayout = QtGui.QGridLayout( self.testCoverContainer )
        gridlayout.addWidget( self.testCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        self.isdone = False

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)

        utils.reduceWidgetFontSize( self.textEdit )
项目:spyking-circus    作者:spyking-circus    | 项目源码 | 文件源码
def init_gui_layout(self):
        gui_fname = pkg_resources.resource_filename('circus',
                                                    os.path.join('qt_GUI',
                                                                 'qt_merge.ui'))
        if comm.rank == 0:
            self.ui = uic.loadUi(gui_fname, self)
            # print dir(self.ui)
            self.score_ax1 = self.ui.score_1.axes
            self.score_ax2 = self.ui.score_2.axes
            self.score_ax3 = self.ui.score_3.axes
            self.waveforms_ax  = self.ui.waveforms.axes
            self.detail_ax     = self.ui.detail.axes
            self.data_ax       = self.ui.data_overview.axes
            self.current_order = self.ui.cmb_sorting.currentIndex()
            self.mpl_toolbar = NavigationToolbar(self.ui.waveforms, None)
            self.mpl_toolbar.pan()
            self.ui.show()
        else:
            self.ui = None
项目:spyking-circus    作者:spyking-circus    | 项目源码 | 文件源码
def init_gui_layout(self):
        gui_fname = pkg_resources.resource_filename('circus',
                                                    os.path.join('qt_GUI',
                                                                 'qt_preview.ui'))
        self.ui = uic.loadUi(gui_fname, self)
        self.electrode_ax = self.ui.electrodes.axes
        self.data_x = self.ui.raw_data.axes
        if self.show_fit:
            self.ui.btn_next.clicked.connect(self.increase_time)
            self.ui.btn_prev.clicked.connect(self.decrease_time)
        else:
            self.ui.btn_next.setVisible(False)
            self.ui.btn_prev.setVisible(False)
        # Toolbar will not be displayed
        self.mpl_toolbar = NavigationToolbar(self.ui.raw_data, None)
        self.mpl_toolbar.pan()
        self.ui.show()
项目: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)
项目:pipeline    作者:liorbenhorin    | 项目源码 | 文件源码
def _pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, QtWidgets, uic

    _remap(QtCore, "Signal", QtCore.pyqtSignal)
    _remap(QtCore, "Slot", QtCore.pyqtSlot)
    _remap(QtCore, "Property", QtCore.pyqtProperty)

    _add(PyQt5, "__binding__", PyQt5.__name__)
    _add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))
    _add(PyQt5, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, n)))
    _add(PyQt5,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PyQt5)

    return PyQt5
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__( self, parent, comic_archive_list, data_style, settings ):
        super(RenameWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('renamewindow.ui' ), self)
        self.label.setText("Preview (based on {0} tags):".format(MetaDataStyle.name[data_style]))

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)

        self.settings = settings
        self.comic_archive_list = comic_archive_list
        self.data_style = data_style

        self.btnSettings.clicked.connect( self.modifySettings )
        self.configRenamer()
        self.doPreview()
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, mode, expand_on_click = True ):
        super(CoverImageWidget, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('coverimagewidget.ui' ), self)

        utils.reduceWidgetFontSize( self.label )

        self.mode = mode
        self.comicVine = ComicVineTalker()
        self.page_loader = None
        self.showControls = True

        self.btnLeft.setIcon(QIcon(ComicTaggerSettings.getGraphic('left.png')))
        self.btnRight.setIcon(QIcon(ComicTaggerSettings.getGraphic('right.png')))

        self.btnLeft.clicked.connect( self.decrementImage )
        self.btnRight.clicked.connect( self.incrementImage )
        self.resetWidget()
        if expand_on_click:
            clickable(self.lblImage).connect(self.showPopup)
        else:
            self.lblImage.setToolTip( "" )

        self.updateContent()
项目:BlendTransforms    作者:duncanskertchly    | 项目源码 | 文件源码
def __init__( self, parent = BT_GetMayaWindow() ):
        super(BT_UIForm, self).__init__(parent)

        uicPath = BT_FindUIFile()

        if not uicPath:
            return None

        self.ui = None
        if BT_MayaVersionNumber < 2014:
            self.ui = uic.loadUi(uicPath, self)
        else:
            loader = QtUiTools.QUiLoader()
            self.ui = loader.load(uicPath, self)

        self.ui.loadSelectedButton.clicked.connect(self.loadSelectedSet)
        self.ui.connectButton.clicked.connect(self.connectSetup)
        self.ui.disconnectButton.clicked.connect(self.disconnectSetup)
        self.ui.setToBaseButton.clicked.connect(self.setToBasePose)
        self.ui.setToSelectedButton.clicked.connect(self.setToPose)
        self.ui.addPoseButton.clicked.connect(self.addPose)
        self.ui.deletePoseButton.clicked.connect(self.deletePose)
        self.ui.updateSelectedButton.clicked.connect(self.updatePose)

        unitResult = BT_SetUnits()
        if unitResult:
            QtGui.QMessageBox.warning(self, "Blend Transforms", "Units set to centimetres.", "Okay")

        self.ui.show()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, window_main, mech_name=None):

        ui_name = 'view_mech.ui'
        self.wm = window_main
        self.mech_name = mech_name

        # load ui and set connection ====================

        self.w = uic.loadUi(os.path.join(window_main.dir_ui, ui_name))
        #self.w.btn_path_chem.clicked.connect(self.act_path_chem)

        # set initial values =============================

        self.w.show()
        self.w.set_soln(mech_name)
        self.w.txt_name.setText(': '+ mech_name)
        self.w.set_summary()

        # exec and return =============================

        self.w.exec_()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent):
        ui_name = 'progress.ui'
        self.parent = parent        
        self.stop = False
        self.verbose = False
        self.dir_public = self.parent.project['dir_public']
        self.f = open(os.path.join(self.dir_public,'log.txt'),'w')

        self.w = uic.loadUi(os.path.join(parent.dir_ui, ui_name))
        self.w.btn_stop.clicked.connect(self.act_stop)
        self.w.btn_verbose.clicked.connect(self.act_verbose)

        tasks = ['train','GPS','test']
        for task in tasks:
            self.set_value(task,0)

        self.parent.app.processEvents()
        self.w.show()
项目:albion    作者:Oslandia    | 项目源码 | 文件源码
def __init__(self, logger, parent=None):
        QDialog.__init__(self, parent)
        uic.loadUi(os.path.join(os.path.dirname(__file__), "res/create_layer.ui"), self)
        self.__logger = logger
        for lid, layer in QgsMapLayerRegistry.instance().mapLayers().iteritems():
            logging.info('layer name: {}'.format(layer.name()))
            if layer.type() == QgsMapLayer.VectorLayer and layer.customProperty("projected_layer") is None:
                if layer.geometryType() == QGis.Line:
                    self.geometryLayer.addItem(layer.name(), layer.id())
                self.dataLayer.addItem(layer.name(), layer.id())

        if self.dataLayer.count():
            self.__set_data_layer(self.dataLayer.currentIndex())

        if self.geometryLayer.count():
            self.__set_geometry_layer(self.geometryLayer.currentIndex())

        self.dataLayer.currentIndexChanged.connect(self.__set_data_layer)
        self.geometryLayer.currentIndexChanged.connect(self.__set_geometry_layer)
项目:spyglass    作者:Crypta-Eve    | 项目源码 | 文件源码
def __init__(self, parent, chatType, selector, chatEntries, knownPlayerNames):
        QtGui.QDialog.__init__(self, parent)
        uic.loadUi(resourcePath("vi/ui/SystemChat.ui"), self)
        self.parent = parent
        self.chatType = 0
        self.selector = selector
        self.chatEntries = []
        for entry in chatEntries:
            self.addChatEntry(entry)
        titleName = ""
        if self.chatType == SystemChat.SYSTEM:
            titleName = self.selector.name
            self.system = selector
        for name in knownPlayerNames:
            self.playerNamesBox.addItem(name)
        self.setWindowTitle("Chat for {0}".format(titleName))
        self.connect(self.closeButton, SIGNAL("clicked()"), self.closeDialog)
        self.connect(self.alarmButton, SIGNAL("clicked()"), self.setSystemAlarm)
        self.connect(self.clearButton, SIGNAL("clicked()"), self.setSystemClear)
        self.connect(self.locationButton, SIGNAL("clicked()"), self.locationSet)
项目:pyblish-starter    作者:pyblish    | 项目源码 | 文件源码
def pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, uic

    remap(QtCore, "Signal", QtCore.pyqtSignal)
    remap(QtCore, "Slot", QtCore.pyqtSlot)
    remap(QtCore, "Property", QtCore.pyqtProperty)

    add(PyQt5, "__wrapper_version__", __version__)
    add(PyQt5, "__binding__", "PyQt5")
    add(PyQt5, "__binding_version__", QtCore.PYQT_VERSION_STR)
    add(PyQt5, "__qt_version__", QtCore.QT_VERSION_STR, safe=False)
    add(PyQt5, "__added__", __added__)
    add(PyQt5, "__remapped__", __remapped__)
    add(PyQt5, "__modified__", __modified__)
    add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))

    return PyQt5
项目:kisqpy    作者:pkulev    | 项目源码 | 文件源码
def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi(config.UI["main"], self)

        self.model = Ticket

        self.action_exit.triggered.connect(self.close)

        # TODO
        self.pb_add_client.clicked.connect(lambda: ClientDialog(1).exec_())
        self.pb_add_ticket.clicked.connect(lambda: TicketDialog(1).exec_())
        self.pb_add_organisation.clicked.connect(lambda: OrganisationDialog(1).exec_())

        self.rb_client.clicked.connect(lambda: self.show_table(Client))
        self.rb_ticket.clicked.connect(lambda: self.show_table(Ticket))
        self.rb_departure.clicked.connect(lambda: self.show_table(Departure))
        self.rb_organisation.clicked.connect(lambda: self.show_table(Organisation))

        # TODO
        self.table_widget.cellClicked.connect(self.select_table_row)
        self.table_widget.cellDoubleClicked.connect(self.open_table_info)
        # TODO: get current selection or QMessageBox.error/ignore
        self.pb_view_and_modify.clicked.connect(self.table_widget.cellDoubleClicked)  # self.open_table_info)

        self.show_table(self.model)
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QDialog.__init__(self)
        self.ui = uic.loadUi("TDStoTDS3.ui", self)
        self.centerOnScreen()
        self.inputFile = ""
        self.outputFile = ""
        self.rtFileName = ""
        self.rtFileData = ""
        self.drFileName = ""
        self.drFileData = ""
        self.config = configparser.ConfigParser()
        self.config.read('TMV3.ini')
        self.tdsDate = 0

        self.ui.BtnFileTDS.clicked.connect(self.loadTDS)
        self.ui.BtnFileRT.clicked.connect(self.loadRT)
        self.ui.BtnFileDR.clicked.connect(self.loadDR)
        self.ui.BtnOk.clicked.connect(self.onBtnOk)
        self.ui.BtnCancel.clicked.connect(self.onBtnCancel)
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def __init__(self, model, title,parent=None):
        #global model
        QtGui.QDialog.__init__(self,parent)
        self.ui = uic.loadUi("Choose.ui", self)
        self.centerOnScreen()
        self.signals = Signal()
        self._config = configparser.ConfigParser()
        self._config.read('TMV3.ini')
        self.ret = False
        self.sel = []
        self.selIdx = []

        self.ui.setWindowTitle(title)
        self.ui.tableView.setModel(model)
        self.ui.BtnOk.clicked.connect(self.onBtnOk)
        self.ui.BtnCancel.clicked.connect(self.onBtnCancel)
        self.ui.tableView.doubleClicked.connect(self.onBtnOk)
        try:
            self.ui.show()
        except Exception as err:
            print(err)
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QDialog.__init__(self)
        self.ui = uic.loadUi("TLMtoTLM3.ui", self)
        self.centerOnScreen()
        self.inputFile = ""
        self.outputFile = ""
        self.tkrNo = 0
        self.tkrCount = 0
        self.valueLists = []
        self.config = configparser.ConfigParser()
        self.config.read('TMV3.ini')
        _ret = self.config['Antenna']['AntennaList']
        self.saveFlag = True
        self.ticket = Ticket()
        self.signals = Signal()

        self.ui.BtnFile.clicked.connect(self.loadTLM)
        self.ui.BtnDel.clicked.connect(self.onBtnDel)
        self.ui.BtnSave.clicked.connect(self.onBtnSave)
        self.ui.BtnOk.clicked.connect(self.onBtnOk)
        self.ui.BtnCancel.clicked.connect(self.onBtnCancel)
        self.ui.tableWidget.cellChanged.connect(self.onTableTouch)

        pass
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QWidget.__init__(self)
        self.config = configparser.ConfigParser()
        self.config.read('TMV3.ini')
        self.workBenchDB = self.config['DataBases']['workbench']
        self.ui = uic.loadUi("ViewSession.ui", self)
        sshFile = "c:/tmv3/templates/darkorange.css"
        with open (sshFile,"r") as fh:
            self.setStyleSheet(fh.read())
        self.ui.BtnNew.clicked.connect(self.onBtnNew)
        self.viewTableModel = TableModel(['ID','Title'])
        self.initTableView()
        self.sel = []
        self.ret = False
        self.new = False
        self.ui.show()
项目:TMV3    作者:HenricusRex    | 项目源码 | 文件源码
def __init__(self):
        QtGui.QDialog.__init__(self)
        self.ui = uic.loadUi("../Lib/Routing.ui", self)
        self.centerOnScreen()
        self.saveFlag = True
        self.delFlag = False
        self.ticket = Ticket()
        self.signals = Signal()
        self.antennaIDs = []
        self.cableIDs = []
        self.route = 0
        self.routesList = []
        self.tableRow = -1
        self.delList = []

        self.ui.BtnNew.clicked.connect(self.onBtnNew)
        self.ui.BtnEdit.clicked.connect(self.onBtnEdit)
        self.ui.BtnAdd.clicked.connect(self.onBtnAdd)
        self.ui.BtnDel.clicked.connect(self.onBtnDel)
        self.ui.BtnRoute.clicked.connect(self.onBtnRoute)
        self.ui.BtnOk.clicked.connect(self.onBtnOk)
        self.ui.BtnCancel.clicked.connect(self.onBtnCancel)

        self.ui.tableWidget.doubleClicked.connect(self.onTableDoubleClick)
       # self.loadRoutes()
项目:OrderScaner    作者:Nikakto    | 项目源码 | 文件源码
def __init__(self):

            # WINDOW SETTING
        super(Window_APIAdd, self).__init__()
        uic.loadUi('forms/APIManager_APIAdd.ui', self)
        self.setWindowModality(Qt.ApplicationModal)
        self.setWindowTitle('Add API')
        self.setFixedSize(self.width(),self.height())

            # VARS
        self.row = None
        self.name = ''
        self.oldName = ''
        self.key = ''
        self.vc = ''

        self.closeWithFunction = None

            # ELEMENT PROPERTIES
        self.BTN_OK.released.connect(self.APIKey_add)
        self.BTN_Cancel.released.connect(self.close)

            # FUNCTION
项目:gdebi    作者:linuxmint    | 项目源码 | 文件源码
def __init__(self, parent):
        QDialog.__init__(self, parent)
        loadUi("GDebiKDEInstallDialog.ui", self)
        self.setWindowTitle(_("Installing"))
        self.showDetailsButton.setText(__("libept","Show Details")) #FIXME check i18n
        self.closeButton.setText(__("kdelibs","&Close"))
        self.showDetailsButton.setIcon(KIcon("utilities-terminal"))
        self.closeButton.setIcon(KIcon("window-close"))
        self.closeButton.setEnabled(False)
        self.closeButton.setVisible(False)
        self.parent = parent
        self.konsole = None
        self.konsoleFrameLayout = QHBoxLayout(self.konsoleFrame)
        self.konsoleFrame.hide()
        self.newKonsole()
        kapp = KApplication.kApplication()
        kapp.processEvents()
项目:j3dview    作者:blank63    | 项目源码 | 文件源码
def __init__(self,*args,**kwargs):
        super().__init__(*args,**kwargs)

        self.ui = uic.loadUi('ui/ViewSettingsForm.ui',self)
项目:j3dview    作者:blank63    | 项目源码 | 文件源码
def __init__(self,*args,**kwargs):
        super().__init__(*args,**kwargs)

        self.ui = uic.loadUi('ui/TextureForm.ui',self)

        self.wrap_s.setItems([gx.CLAMP,gx.REPEAT,gx.MIRROR])
        self.wrap_t.setItems([gx.CLAMP,gx.REPEAT,gx.MIRROR])
        self.minification_filter.setItems([gx.NEAR,gx.LINEAR,gx.NEAR_MIP_NEAR,gx.LIN_MIP_NEAR,gx.NEAR_MIP_LIN,gx.LIN_MIP_LIN])
        self.magnification_filter.setItems([gx.NEAR,gx.LINEAR])
项目:j3dview    作者:blank63    | 项目源码 | 文件源码
def __init__(self,*args,**kwargs):
        super().__init__(*args,**kwargs)

        self.undo_stack = QtGui.QUndoStack(self,objectName='undo_stack')
        self.action_undo = self.undo_stack.createUndoAction(self)
        self.action_redo = self.undo_stack.createRedoAction(self)

        self.ui = uic.loadUi('ui/Editor.ui',self)

        self.menu_edit.addAction(self.action_undo)
        self.menu_edit.addAction(self.action_redo)

        self.menu_window.addAction(self.dock_view_settings.toggleViewAction())
        self.menu_window.addAction(self.dock_explorer.toggleViewAction())
        self.menu_window.addAction(self.dock_preview.toggleViewAction())
        self.menu_window.addAction(self.dock_texture.toggleViewAction())

        self.action_open_model.setShortcut(QtGui.QKeySequence.Open)
        self.action_save_model.setShortcut(QtGui.QKeySequence.Save)
        self.action_save_model_as.setShortcut(QtGui.QKeySequence.SaveAs)
        self.action_quit.setShortcut(QtGui.QKeySequence.Quit)
        self.action_undo.setShortcut(QtGui.QKeySequence.Undo)
        self.action_redo.setShortcut(QtGui.QKeySequence.Redo)

        self.view_settings.setViewer(self.viewer)
        self.dock_view_settings.hide()

        self.preview = PreviewWidget(shareWidget=self.viewer)
        self.dock_preview.setWidget(self.preview)

        self.texture.setUndoStack(self.undo_stack)

        self.action_open_animation.setEnabled(False)
        self.action_save_model.setEnabled(False)
        self.action_save_model_as.setEnabled(False)

        self.setWindowFilePath('')

        self.adjustSize()

        #self.readSettings()
项目: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
项目:cmt    作者:chadmv    | 项目源码 | 文件源码
def pyqt4_load_ui(fname):
    """Read Qt Designer .ui `fname`

    Args:
        fname (str): Absolute path to .ui file

    """

    from PyQt4 import uic
    return uic.loadUi(fname)
项目:cmt    作者:chadmv    | 项目源码 | 文件源码
def pyqt5_load_ui(fname):
    """Read Qt Designer .ui `fname`

    Args:
        fname (str): Absolute path to .ui file

    """

    from PyQt5 import uic
    return uic.loadUi(fname)
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, image_pixmap):
        super(ImagePopup, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('imagepopup.ui' ), self)

        QtGui.QApplication.setOverrideCursor(QtGui.QCursor(QtCore.Qt.WaitCursor))

        #self.setWindowModality(QtCore.Qt.WindowModal)
        self.setWindowFlags(QtCore.Qt.Popup)
        self.setWindowState(QtCore.Qt.WindowFullScreen)

        self.imagePixmap = image_pixmap

        screen_size = QtGui.QDesktopWidget().screenGeometry()
        self.resize(screen_size.width(), screen_size.height())
        self.move( 0, 0)

        # This is a total hack.  Uses a snapshot of the desktop, and overlays a
        # translucent screen over it.  Probably can do it better by setting opacity of a
        # widget
        self.desktopBg = QtGui.QPixmap.grabWindow(QtGui.QApplication.desktop ().winId(), 
            0,0, screen_size.width(), screen_size.height())
        bg = QtGui.QPixmap(ComicTaggerSettings.getGraphic('popup_bg.png')) 
        self.clientBgPixmap = bg.scaled(screen_size.width(), screen_size.height())      
        self.setMask(self.clientBgPixmap.mask())

        self.applyImagePixmap()
        self.showFullScreen()
        self.raise_(  )
        QtGui.QApplication.restoreOverrideCursor()
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent):
        super(IDProgressWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('progresswindow.ui' ), self)

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)

        utils.reduceWidgetFontSize( self.textEdit )
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent ):
        super(PageListEditor, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('pagelisteditor.ui' ), self)

        self.pageWidget = CoverImageWidget( self.pageContainer, CoverImageWidget.ArchiveMode )
        gridlayout = QGridLayout( self.pageContainer )
        gridlayout.addWidget( self.pageWidget )
        gridlayout.setContentsMargins(0,0,0,0)
        self.pageWidget.showControls = False

        self.resetPage()

        # Add the entries to the manga combobox
        self.comboBox.addItem( "", "" )
        self.comboBox.addItem( self.pageTypeNames[ PageType.FrontCover], PageType.FrontCover )
        self.comboBox.addItem( self.pageTypeNames[ PageType.InnerCover], PageType.InnerCover )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Advertisement], PageType.Advertisement )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Roundup], PageType.Roundup )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Story], PageType.Story )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Editorial], PageType.Editorial )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Letters], PageType.Letters )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Preview], PageType.Preview )
        self.comboBox.addItem( self.pageTypeNames[ PageType.BackCover], PageType.BackCover )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Other], PageType.Other )
        self.comboBox.addItem( self.pageTypeNames[ PageType.Deleted], PageType.Deleted )

        self.listWidget.itemSelectionChanged.connect( self.changePage )
        itemMoveEvents(self.listWidget).connect(self.itemMoveEvent)
        self.comboBox.activated.connect( self.changePageType )
        self.btnUp.clicked.connect( self.moveCurrentUp )
        self.btnDown.clicked.connect( self.moveCurrentDown )
        self.pre_move_row = -1
        self.first_front_page = None
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, series_name, issue_number, year, issue_count, cover_index_list, comic_archive, settings, autoselect=False):
        super(VolumeSelectionWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('volumeselectionwindow.ui' ), self)

        self.imageWidget = CoverImageWidget( self.imageContainer, CoverImageWidget.URLMode )
        gridlayout = QtGui.QGridLayout( self.imageContainer )
        gridlayout.addWidget( self.imageWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        utils.reduceWidgetFontSize( self.teDetails, 1 )
        utils.reduceWidgetFontSize( self.twList )       

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)

        self.settings = settings
        self.series_name = series_name
        self.issue_number = issue_number
        self.year = year
        self.issue_count = issue_count
        self.volume_id = 0
        self.comic_archive = comic_archive
        self.immediate_autoselect = autoselect
        self.cover_index_list = cover_index_list
        self.cv_search_results = None

        self.twList.resizeColumnsToContents()   
        self.twList.currentItemChanged.connect(self.currentItemChanged)
        self.twList.cellDoubleClicked.connect(self.cellDoubleClicked)
        self.btnRequery.clicked.connect(self.requery)           
        self.btnIssues.clicked.connect(self.showIssues) 
        self.btnAutoSelect.clicked.connect(self.autoSelect) 

        self.updateButtons()
        self.performQuery()
        self.twList.selectRow(0)
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, metadata):
        super(PageBrowserWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('pagebrowser.ui' ), self)

        self.pageWidget = CoverImageWidget( self.pageContainer, CoverImageWidget.ArchiveMode )
        gridlayout = QtGui.QGridLayout( self.pageContainer )
        gridlayout.addWidget( self.pageWidget )
        gridlayout.setContentsMargins(0,0,0,0)
        self.pageWidget.showControls = False

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)

        self.comic_archive = None
        self.page_count = 0
        self.current_page_num = 0
        self.metadata = metadata

        self.buttonBox.button(QtGui.QDialogButtonBox.Close).setDefault(True)    
        if platform.system() == "Darwin":
            self.btnPrev.setText("<<")
            self.btnNext.setText(">>")
        else:
            self.btnPrev.setIcon(QtGui.QIcon( ComicTaggerSettings.getGraphic('left.png' )))
            self.btnNext.setIcon(QtGui.QIcon( ComicTaggerSettings.getGraphic('right.png')))

        self.btnNext.clicked.connect( self.nextPage )
        self.btnPrev.clicked.connect( self.prevPage )
        self.show()

        self.btnNext.setEnabled( False )
        self.btnPrev.setEnabled( False )
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent):
        super(LogWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('logwindow.ui' ), self)

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, match_set_list, style, fetch_func):
        super(AutoTagMatchWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('matchselectionwindow.ui' ), self)

        self.altCoverWidget = CoverImageWidget( self.altCoverContainer, CoverImageWidget.AltCoverMode )
        gridlayout = QtGui.QGridLayout( self.altCoverContainer )
        gridlayout.addWidget( self.altCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        self.archiveCoverWidget = CoverImageWidget( self.archiveCoverContainer, CoverImageWidget.ArchiveMode )
        gridlayout = QtGui.QGridLayout( self.archiveCoverContainer )
        gridlayout.addWidget( self.archiveCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        utils.reduceWidgetFontSize( self.twList )       
        utils.reduceWidgetFontSize( self.teDescription, 1 )

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)       

        self.skipButton = QtGui.QPushButton(self.tr("Skip to Next"))
        self.buttonBox.addButton(self.skipButton, QtGui.QDialogButtonBox.ActionRole)        
        self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setText("Accept and Write Tags")       

        self.match_set_list = match_set_list
        self.style = style
        self.fetch_func = fetch_func

        self.current_match_set_idx = 0

        self.twList.currentItemChanged.connect(self.currentItemChanged) 
        self.twList.cellDoubleClicked.connect(self.cellDoubleClicked)
        self.skipButton.clicked.connect(self.skipToNext)

        self.updateData()
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, matches, comic_archive):
        super(MatchSelectionWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('matchselectionwindow.ui' ), self)

        self.altCoverWidget = CoverImageWidget( self.altCoverContainer, CoverImageWidget.AltCoverMode )
        gridlayout = QtGui.QGridLayout( self.altCoverContainer )
        gridlayout.addWidget( self.altCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        self.archiveCoverWidget = CoverImageWidget( self.archiveCoverContainer, CoverImageWidget.ArchiveMode )
        gridlayout = QtGui.QGridLayout( self.archiveCoverContainer )
        gridlayout.addWidget( self.archiveCoverWidget )
        gridlayout.setContentsMargins(0,0,0,0)

        utils.reduceWidgetFontSize( self.twList )       
        utils.reduceWidgetFontSize( self.teDescription, 1 )

        self.setWindowFlags(self.windowFlags() |
                                      QtCore.Qt.WindowSystemMenuHint |
                                      QtCore.Qt.WindowMaximizeButtonHint)       

        self.matches = matches
        self.comic_archive = comic_archive

        self.twList.currentItemChanged.connect(self.currentItemChanged) 
        self.twList.cellDoubleClicked.connect(self.cellDoubleClicked)

        self.updateData()
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent , settings ):
        super(FileSelectionList, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('fileselectionlist.ui' ), self)

        self.settings = settings

        utils.reduceWidgetFontSize( self.twList )

        self.twList.setColumnCount(6)
        #self.twlist.setHorizontalHeaderLabels (["File", "Folder", "CR", "CBL", ""])
        #self.twList.horizontalHeader().setStretchLastSection( True )       
        self.twList.currentItemChanged.connect( self.currentItemChangedCB )

        self.currentItem = None
        self.setContextMenuPolicy(Qt.ActionsContextMenu)
        self.modifiedFlag = False

        selectAllAction = QAction("Select All", self)
        removeAction = QAction("Remove Selected Items", self)
        self.separator = QAction("",self)
        self.separator.setSeparator(True)

        selectAllAction.setShortcut( 'Ctrl+A' )
        removeAction.setShortcut( 'Ctrl+X' )

        selectAllAction.triggered.connect(self.selectAll)
        removeAction.triggered.connect(self.removeSelection)

        self.addAction(selectAllAction)         
        self.addAction(removeAction)
        self.addAction(self.separator)
项目:BlendTransforms    作者:duncanskertchly    | 项目源码 | 文件源码
def __init__( self, parent = BT_GetMayaWindow() ):
        super(BT_UIForm, self).__init__(parent)

        uicPath = BT_FindUIFile()

        if not uicPath:
            return None

        self.ui = None
        if BT_MayaVersionNumber < 2014:
            self.ui = uic.loadUi(uicPath, self)
        else:
            loader = QtUiTools.QUiLoader()
            self.ui = loader.load(uicPath, self)

        self.ui.loadSelectedButton.clicked.connect(self.loadSelectedSet)
        self.ui.connectButton.clicked.connect(self.connectSetup)
        self.ui.disconnectButton.clicked.connect(self.disconnectSetup)
        self.ui.setToBaseButton.clicked.connect(self.setToBasePose)
        self.ui.setToSelectedButton.clicked.connect(self.setToPose)
        self.ui.addPoseButton.clicked.connect(self.addPose)
        self.ui.deletePoseButton.clicked.connect(self.deletePose)
        self.ui.updateSelectedButton.clicked.connect(self.updatePose)

        unitResult = BT_SetUnits()
        if unitResult:
            QtGui.QMessageBox.warning(self, "Blend Transforms", "Units set to centimetres.", "Okay")

        self.ui.show()
项目:BlendTransforms    作者:duncanskertchly    | 项目源码 | 文件源码
def __init__( self, parent = BT_GetMayaWindow() ):
        super(BT_UIForm, self).__init__(parent)

        uicPath = BT_FindUIFile()

        if not uicPath:
            return None

        self.ui = None
        if BT_MayaVersionNumber < 2014:
            self.ui = uic.loadUi(uicPath, self)
        else:
            loader = QtUiTools.QUiLoader()
            self.ui = loader.load(uicPath, self)

        self.ui.loadSelectedButton.clicked.connect(self.loadSelectedSet)
        self.ui.connectButton.clicked.connect(self.connectSetup)
        self.ui.disconnectButton.clicked.connect(self.disconnectSetup)
        self.ui.setToBaseButton.clicked.connect(self.setToBasePose)
        self.ui.setToSelectedButton.clicked.connect(self.setToPose)
        self.ui.addPoseButton.clicked.connect(self.addPose)
        self.ui.deletePoseButton.clicked.connect(self.deletePose)
        self.ui.updateSelectedButton.clicked.connect(self.updatePose)

        unitResult = BT_SetUnits()
        if unitResult:
            QtGui.QMessageBox.warning(self, "Blend Transforms", "Units set to centimetres.", "Okay")

        self.ui.show()
项目:BlendTransforms    作者:duncanskertchly    | 项目源码 | 文件源码
def __init__( self, parent = BT_GetMayaWindow() ):
        super(BT_UIForm, self).__init__(parent)

        uicPath = BT_FindUIFile()

        if not uicPath:
            return None

        self.ui = None
        if BT_MayaVersionNumber < 2014:
            self.ui = uic.loadUi(uicPath, self)
        else:
            loader = QtUiTools.QUiLoader()
            self.ui = loader.load(uicPath, self)

        self.ui.loadSelectedButton.clicked.connect(self.loadSelectedSet)
        self.ui.connectButton.clicked.connect(self.connectSetup)
        self.ui.disconnectButton.clicked.connect(self.disconnectSetup)
        self.ui.setToBaseButton.clicked.connect(self.setToBasePose)
        self.ui.setToSelectedButton.clicked.connect(self.setToPose)
        self.ui.addPoseButton.clicked.connect(self.addPose)
        self.ui.deletePoseButton.clicked.connect(self.deletePose)
        self.ui.updateSelectedButton.clicked.connect(self.updatePose)

        unitResult = BT_SetUnits()
        if unitResult:
            QtGui.QMessageBox.warning(self, "Blend Transforms", "Units set to centimetres.", "Okay")

        self.ui.show()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self,parent):

        ui_name = 'about.ui'
        self.w = uic.loadUi(os.path.join(parent.dir_ui, ui_name))
        self.w.setFixedSize(self.w.width(), self.w.height())
        self.w.exec_()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent):

        self.key = 'sk4comb'
        self.data = dict()
        self.occupied = []

        self.parent = parent
        if self.key not in self.parent.project.keys():
            self.parent.project[self.key] = dict()

        self.ui_name = 'combine_sk.ui'
        self.w = uic.loadUi(os.path.join(self.parent.dir_ui, self.ui_name))
        self.w.setFixedSize(self.w.width(), self.w.height())    

        # set connection ====================

        self.w.btn_add.clicked.connect(self.act_add)
        self.w.btn_del.clicked.connect(self.act_del)
        self.w.btn_edit.clicked.connect(self.act_edit)
        self.w.btn_comb.clicked.connect(self.act_comb_sk)
        self.w.list_sk.doubleClicked.connect(self.act_edit)


        # exec ==============================
        self.set_list()
        self.w.exec_()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent, element, title):

        ui_name = 'GPS_element.ui'
        self.element = copy.copy(element)
        self.parent = parent

        # load ui and set connection ====================

        self.w = uic.loadUi(os.path.join(self.parent.dir_ui, ui_name))  
        self.w.setFixedSize(self.w.width(), self.w.height())    
        self.w.btn_save.clicked.connect(self.act_save)
        self.w.btn_cancel.clicked.connect(self.act_cancel)
        self.w.rbtn_def.clicked.connect(self.act_def_or_cust)
        self.w.rbtn_cust.clicked.connect(self.act_def_or_cust)
        self.w.ck_hub_only.clicked.connect(self.act_hub_only)


        # set initial values =============================

        self.only_hub_old = self.element['only_hub']
        self.source_old = copy.copy(self.element['source'])
        self.target_old = copy.copy(self.element['target'])

        self.w.txt_title.setText(title)
        self.set_all()

        # exec and return =============================

        if self.w.exec_() == QDialog.Rejected:
            self.element = None
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent, data_name=None, extra=None):
        ui_name = 'GPS_traced.ui'
        self.parent = parent
        self.key = 'es'
        soln = self.parent.soln['detailed']
        self.old_name = data_name

        self.occupied = self.init_occupied()

        self.w = uic.loadUi(os.path.join(self.parent.dir_ui, ui_name))  
        self.w.setFixedSize(self.w.width(), self.w.height())    
        self.w.btn_edit.clicked.connect(self.act_edit)
        self.w.btn_save.clicked.connect(self.act_save)
        self.w.btn_cancel.clicked.connect(self.act_cancel)
        self.w.table_traced.doubleClicked.connect(self.act_edit)

        if data_name is None:
            self.data = copy.copy(self.parent.project['es']['default'])
            self.data['name'] = self.new_name('customized', self.occupied)
        else:
            self.data = copy.copy(self.parent.project['es'][data_name])

        if data_name == 'default':
            self.w.btn_save.setEnabled(False)

        self.w.txt_name.setText(self.data['name'])
        self.set_table_traced()

        if self.w.exec_() == QDialog.Rejected:
            self.data = None
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def init_ui(self):
        self.w = uic.loadUi(os.path.join(self.parent.dir_ui, self.ui_name))
        self.w.setFixedSize(self.w.width(), self.w.height())
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent, data_name=None, btn=None):

        ui_name = 'view_mech.ui'
        self.parent = parent
        self.data_name = data_name

        # load ui and set connection ====================

        self.w = uic.loadUi(os.path.join(parent.dir_ui, ui_name))
        self.w.btn_ok.clicked.connect(self.act_ok)

        # set initial values =============================

        #dir_desk = os.path.join(self.parent.project['dir_public'],data_name)
        #dir_desk_mech = os.path.join(dir_desk,'mech')
        dir_desk = self.parent.project['mech'][data_name]['desk']
        path_cti = os.path.join(dir_desk,'mech','chem.cti')
        if os.path.exists(path_cti) == False:
            msg = 'no chem.cti file\n\n'+path_cti
            QMessageBox.information(QWidget(),'',msg)
            return None

        if data_name not in self.parent.soln.keys():
            self.parent.soln[data_name] = ct.Solution(path_cti)
            self.parent.soln_in[data_name] = ct.Solution(path_cti)

        self.soln = self.parent.soln[data_name]
        self.w.txt_name.setText(': '+ data_name)
        self.set_summary()
        self.set_lists()
        if btn is not None:
            btn.setEnabled(True)
            btn.setText('view')

        # exec and return =============================

        self.w.exec_()
项目:GPS    作者:golsun    | 项目源码 | 文件源码
def __init__(self, parent):

        self.ui_name = 'post.ui'
        self.parent = parent
        self.w = uic.loadUi(os.path.join(self.parent.dir_ui, self.ui_name))
        self.w.setFixedSize(self.w.width(), self.w.height())    

        # set connection ====================

        self.w.btn_ok.clicked.connect(self.act_ok)

        self.w.btn_add.clicked.connect(self.act_add_plot)
        self.w.btn_del.clicked.connect(self.act_del_plot)
        self.w.btn_edit.clicked.connect(self.act_edit_plot)
        self.w.list_plot.doubleClicked.connect(self.act_edit_plot)
        self.w.btn_copy.clicked.connect(self.act_copy_plot)

        self.w.cb_plot.currentIndexChanged.connect(self.act_cb)


        # set variables ==============================

        self.cb_items = ['autoignition process','autoignition delay','1D flame structure','PSR S-cruve','GP edge analysis']
        self.plot_type = ['plot_ign_evolve','plot_ign_state','plot_premix_evolve','plot_psr_state','plot_GPedge']


        # set ui obj ==============================

        for item in self.cb_items:
            self.w.cb_plot.addItem(item)


        # exec ==============================

        self.w.exec_()
项目:albion    作者:Oslandia    | 项目源码 | 文件源码
def __init__(self, viewer, iface=None, parent=None):
        super(ViewerControls, self).__init__(parent)
        uic.loadUi(os.path.join(os.path.dirname(__file__), 'viewer_3d_controls.ui'), self)

        self.__viewer = viewer

        self.__viewer.setZscale(self.zScaleSlider.value())

        self.__viewer.toggle_labels(self.labelsCheckBox.isChecked())
        self.__viewer.toggle_nodes(self.nodesCheckBox.isChecked())
        self.__viewer.toggle_edges(self.edgesCheckBox.isChecked())
        self.__viewer.toggle_tops(self.topsCheckBox.isChecked())
        self.__viewer.toggle_bottoms(self.bottomsCheckBox.isChecked())
        self.__viewer.toggle_sections(self.sectionsCheckBox.isChecked())
        self.__viewer.toggle_volumes(self.volumesCheckBox.isChecked())

        self.zScaleSlider.valueChanged.connect(self.__viewer.setZscale)

        self.labelsCheckBox.toggled.connect(self.__viewer.toggle_labels)
        self.nodesCheckBox.toggled.connect(self.__viewer.toggle_nodes)
        self.edgesCheckBox.toggled.connect(self.__viewer.toggle_edges)
        self.topsCheckBox.toggled.connect(self.__viewer.toggle_tops)
        self.bottomsCheckBox.toggled.connect(self.__viewer.toggle_bottoms)
        self.sectionsCheckBox.toggled.connect(self.__viewer.toggle_sections)
        self.volumesCheckBox.toggled.connect(self.__viewer.toggle_volumes)

        self.refreshButton.clicked.connect(self.__viewer.refresh_data)

        self.__iface = iface
项目:albion    作者:Oslandia    | 项目源码 | 文件源码
def __init__(self, conn_info, parent=None):
        super(BoreHoleWindow, self).__init__(parent)
        uic.loadUi(os.path.join(os.path.dirname(__file__), 'log_strati.ui'), self)
        self.scene = BoreHoleScene(conn_info, self)
        self.graphicsView.setScene(self.scene)
        self.graphicsView.installEventFilter(self.scene.scroll_filter())


    #    id_, = cur.execute("SELECT OGC_FID FROM forages WHERE nom='{}'".format(name)).fetchone()
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
def initialize_window(self):
        uic.loadUi('resources/ui/add_s_line.ui', self)
        for stdLineType in pp.std_types.available_std_types(self.net).index:
            self.standard_type.addItem(stdLineType)
        for availableBus in self.net.bus.index:
            self.from_bus.addItem(str(availableBus))
            self.to_bus.addItem(str(availableBus))
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
def initialize_window(self):
        uic.loadUi('resources/ui/add_load.ui', self)
        for availableBus in self.net.bus.index:
            self.bus.addItem(str(availableBus))