本文整理匯總了Python中main_window.MainWindow.load_catalogue方法的典型用法代碼示例。如果您正苦於以下問題:Python MainWindow.load_catalogue方法的具體用法?Python MainWindow.load_catalogue怎麽用?Python MainWindow.load_catalogue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類main_window.MainWindow
的用法示例。
在下文中一共展示了MainWindow.load_catalogue方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from main_window import MainWindow [as 別名]
# 或者: from main_window.MainWindow import load_catalogue [as 別名]
def main(argv):
# load plugins
if os.path.exists(PLUGIN_FILE):
imp.load_source('hmtk.plugin', PLUGIN_FILE)
# create Qt application
# Claim to be QGIS2 so that used plugins that tries to access
# QSettings will get the QGIS2 settings
QtGui.QApplication.setApplicationName('QGIS2')
QtGui.QApplication.setOrganizationDomain('qgis.org')
if QtCore.QSettings().value('locale/userLocale') is None:
QtGui.QApplication.setOrganizationDomain('QGIS')
app = QtGui.QApplication(argv, True)
# setup QGIS
QgsApplication.setPrefixPath(os.environ['QGIS_PREFIX_PATH'], True)
QgsApplication.initQgis()
# Install a custom exception hook that prints exception into a
# MessageBox
sys.excepthook = excepthook
# create main window
wnd = MainWindow() # classname
wnd.show()
if sys.platform == "darwin":
wnd.raise_()
if len(argv) > 1:
wnd.change_model(CatalogueModel.from_csv_file(argv[1]))
if len(argv) > 2:
wnd.load_fault_source(argv[2])
else:
wnd.load_catalogue()
# Connect signal for app finish
def on_quit():
QgsApplication.exitQgis()
app.quit()
app.lastWindowClosed.connect(on_quit)
# Start the app up
ret = app.exec_()
sys.exit(ret)