本文整理汇总了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()
示例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
示例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))
示例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)
示例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)
示例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))
示例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()
示例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_()
示例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()
示例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()
示例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
示例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
示例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
示例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())
示例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')