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


Python QtUiTools.QUiLoader类代码示例

本文整理汇总了Python中PySide.QtUiTools.QUiLoader的典型用法代码示例。如果您正苦于以下问题:Python QUiLoader类的具体用法?Python QUiLoader怎么用?Python QUiLoader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: loadCustomWidget

 def loadCustomWidget(self,UIfile):
     loader = QUiLoader()
     file_ui = QtCore.QFile(UIfile)
     file_ui.open(QtCore.QFile.ReadOnly)
     self.mainWidget = loader.load(file_ui, self)
     self.setWindowTitle("Implicit Mapper")   
     file_ui.close()
开发者ID:mghamsar,项目名称:PyImp,代码行数:7,代码来源:ui_snapshot.py

示例2: loadDialog

def loadDialog(file_name):
        loader = QUiLoader()
        the_file = QFile(file_name)
        the_file.open(QFile.ReadOnly)
        ret_val = loader.load(the_file)
        the_file.close()
        return ret_val
开发者ID:F-Secure,项目名称:dvmps,代码行数:7,代码来源:progress_dialog.py

示例3: testCase

    def testCase(self):
        w = QtGui.QWidget()
        loader = QUiLoader()

        filePath = os.path.join(os.path.dirname(__file__), 'action.ui')
        result = loader.load(filePath, w)
        self.assert_(isinstance(result.actionFoo, QtGui.QAction))
开发者ID:Hasimir,项目名称:PySide,代码行数:7,代码来源:bug_392.py

示例4: findOrSaveConfig

 def findOrSaveConfig(self):
     infile = QFile('ui/config_path.ui')
     infile.open(QFile.ReadOnly)
     loader = QUiLoader()
     dialog = loader.load(infile, self.window)
     infile.close()
     
     def browse():
         path = QFileDialog.getSaveFileName(dialog, u"Choose or create a configuration file", dialog.pathBox.text())[0]
         if path != '':
             dialog.pathBox.setText(path)
     
     def cancel():
         dialog.hide()
     
     def ok():
         autodetectPort = dialog.autodetect.checkState() == Qt.Checked
         configPath = os.path.expanduser(dialog.pathBox.text())
         dialog.hide()
         self.start(configPath, autodetectPort)
     
     dialog.show()
     dialog.pathBox.setText(os.path.expanduser('~/.config/tangelo/tangelo.conf'))
     
     dialog.browseButton.clicked.connect(browse)
     dialog.cancelButton.clicked.connect(cancel)
     dialog.okButton.clicked.connect(ok)
开发者ID:XDATA-Year-2,项目名称:tangelo-wrapper,代码行数:27,代码来源:tangelo-wrapper.py

示例5: __init__

 def __init__(self):
     loader = QUiLoader()
     filePath = os.path.join(os.path.dirname(__file__), 'bug_426.ui')
     self.widget = loader.load(filePath)
     self.group = QtGui.QActionGroup(self.widget)
     self.widget.show()
     QtCore.QTimer.singleShot(0, self.widget.close)
开发者ID:Hasimir,项目名称:PySide,代码行数:7,代码来源:bug_426.py

示例6: testCase

    def testCase(self):
        w = QtGui.QWidget()
        loader = QUiLoader()

        filePath = os.path.join(os.path.dirname(__file__), 'test.ui')
        result = loader.load(filePath, w)
        self.assert_(isinstance(result.child_object, QtGui.QFrame))
开发者ID:Hasimir,项目名称:PySide,代码行数:7,代码来源:bug_376.py

示例7: __init__

    def __init__(self):
#         super(SimplyTimer, self).__init__()

        loader = QUiLoader()
        uiFile = QtCore.QFile('./timer.ui')
        uiFile.open(QtCore.QFile.ReadOnly)
        self._myWidget = loader.load(uiFile)
        uiFile.close()

        self._tryIcon = QtGui.QSystemTrayIcon(self._myWidget)
        icon = QtGui.QIcon(QtGui.QPixmap(':/Timer.png'))
        self._myWidget.setWindowIcon(icon)
        self._tryIcon.setIcon(icon)
        self._myWidget.uiStartButton.clicked.connect(self.start)
        self._myWidget.stopButton.clicked.connect(self.stop)
        self._tryIcon.activated.connect(self.onTryClicked)

        self.__timeEdit = self._myWidget.uiTimeEdit
        self._timer = QtCore.QTimer()
        self._timer.timeout.connect(self.timerHit)

        self._updateTimer = QtCore.QTimer()
        self._updateTimer.timeout.connect(self.update)

        self._tryIcon.show()
        self._myWidget.show()
开发者ID:develru,项目名称:TimerQt,代码行数:26,代码来源:main.py

示例8: main

def main(argv=None):
    if argv is None:
        argv = sys.argv

    app = QApplication(argv)
    engine = QScriptEngine()

    if HAS_DEBUGGER:
        debugger = QScriptEngineDebugger()
        debugger.attachTo(engine)
        debugWindow = debugger.standardWindow()
        debugWindow.resize(1024, 640)

    scriptFileName = './calculator.js'
    scriptFile = QFile(scriptFileName)
    scriptFile.open(QIODevice.ReadOnly)
    engine.evaluate(unicode(scriptFile.readAll()), scriptFileName)
    scriptFile.close()

    loader = QUiLoader()
    ui = loader.load(':/calculator.ui')

    ctor = engine.evaluate('Calculator')
    scriptUi = engine.newQObject(ui, QScriptEngine.ScriptOwnership)
    calc = ctor.construct([scriptUi])

    if HAS_DEBUGGER:
        display = ui.findChild(QLineEdit, 'display')
        display.connect(display, SIGNAL('returnPressed()'),
                        debugWindow, SLOT('show()'))

    ui.show()
    return app.exec_()
开发者ID:AmerGit,项目名称:Examples,代码行数:33,代码来源:calculator.py

示例9: __init__

 def __init__(self, parent = None):
     QtGui.QWidget.__init__(self, parent)
     loader = QUiLoader()
     file = QtCore.QFile("createRoom1.ui")
     file.open(QtCore.QFile.ReadOnly)
     widget = loader.load(file, parent)
     file.close()
开发者ID:JaMeSz04,项目名称:SoftwareEngineerProject_DocV_term4,代码行数:7,代码来源:CreateRoomGUI.py

示例10: __init__

    def __init__(self):
        super(TreeviewWidgetSelectProve, self).__init__()
        ui_file_path = os.path.join(
            '/home/n130s/link/ROS/groovy_quantal/catkin_ws/src/rqt_prove',
            'resource', 'treeview_2.ui')

        loader = QUiLoader(self)
        ui_file = QFile(ui_file_path)
        self._widget_top = loader.load(ui_file, self)

        self._std_model = QStandardItemModel()
        self._rootitem = self._std_model.invisibleRootItem()

        item_r_1 = QStandardItem("r1")

        self._rootitem.appendRow(item_r_1)
        # self._rootitem.appendRow(item_r_2)
        print('_rootitem index={}'.format(self._rootitem.index()))

        self._treeview = self._widget_top.findChild(QTreeView, '_treeview')
        self._treeview.setModel(self._std_model)
        self.selectionModel = self._widget_top._treeview.selectionModel()

        print('del/sel?\tde/sel index\tde/sel.row\tde/sel.dat\tparent\tinternal id')
        self._widget_top.show()
开发者ID:130s,项目名称:rqt_prove,代码行数:25,代码来源:prv_pyside_loadui.py

示例11: __init__

	def __init__(self):
		QApplication.__init__(self, sys.argv)

		loader = QUiLoader()
		
		self.window = loader.load("interface.ui")
		self.window.progressBar.hide()
		
		self.settings = Settings()
		self.math = Math(self.settings)
		
		try:
		  self.plot = MatplotlibWidget()
		  self.window.plot.addWidget(self.plot)
		except:
		  pass
		
		self.settings.changed.connect(self.onSettingsChanged)
		
		try:
		  self.device = Device()
		except IOError, e:
		  print e
		  QMessageBox.warning(self.window, "LaserExposer", "Device not connected")
		  return
开发者ID:walmis,项目名称:LaserExposer,代码行数:25,代码来源:main.py

示例12: loadWindowFromFile

def loadWindowFromFile(file_name):
    '''Load the window definition from the resource ui file'''
    loader = QUiLoader()
    ui_file = QFile(file_name)
    ui_file.open(QFile.ReadOnly)
    the_window = loader.load(ui_file)
    ui_file.close()
    return the_window
开发者ID:F-Secure,项目名称:dvmps,代码行数:8,代码来源:kvm_ui.py

示例13: getWidget

def getWidget(path, load):

    qLoader = QUiLoader()
    qFile = QtCore.QFile(path)
    qFile.open(QtCore.QFile.ReadOnly)
    ui = qLoader.load(qFile, load)
    qFile.close()
    return ui
开发者ID:hdkkato,项目名称:qtsample,代码行数:8,代码来源:sample3.py

示例14: testPythonCustomWidgets

    def testPythonCustomWidgets(self):
        w = QtGui.QWidget()
        loader = QUiLoader()
        loader.registerCustomWidget(MyWidget)

        filePath = os.path.join(os.path.dirname(__file__), 'pycustomwidget.ui')
        result = loader.load(filePath, w)
        self.assert_(isinstance(result.custom, MyWidget))
        self.assert_(result.custom.isPython())
开发者ID:Hasimir,项目名称:PySide,代码行数:9,代码来源:bug_392.py

示例15: loadHyperlinkDialog

 def loadHyperlinkDialog(self):
     ''' Load dialog from ui file for defining hyperlink '''
     loader = QUiLoader()
     ui_file = QFile(':/hyperlink.ui')  # UI_DIALOG_FILE)
     ui_file.open(QFile.ReadOnly)
     self.hyperlink_dialog = loader.load(ui_file)
     ui_file.close()
     self.hyperlink_dialog.accepted.connect(self.hyperlinkChanged)
     self.hlink_field = self.hyperlink_dialog.findChild(QLineEdit, 'hlink')
开发者ID:blipvert,项目名称:opengeode,代码行数:9,代码来源:genericSymbols.py


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