本文整理匯總了Python中source.Source.open方法的典型用法代碼示例。如果您正苦於以下問題:Python Source.open方法的具體用法?Python Source.open怎麽用?Python Source.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類source.Source
的用法示例。
在下文中一共展示了Source.open方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MainWindow
# 需要導入模塊: from source import Source [as 別名]
# 或者: from source.Source import open [as 別名]
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, database, admin):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__(self)
self.setupUi(self)
self.show()
# parameters
self.admin = admin
self.database = database
# menu action signals
self.actionOpen.triggered.connect(self.open_file)
self.actionOpen_Camera.triggered.connect(\
self.open_camera)
self.actionQuit.triggered.connect(self.quit)
self.actionAbout.triggered.connect(self.about)
# objects
self.source = Source(self, database, admin)
# init settings
init_main(self)
# keyboard shortcuts
shortcuts(self)
# admin
self.admin_window = AdminWindow(self.source, self)
# notification object here
self.notification = Notification(self.source, self)
# report tab
self.report = Report(self.source, self)
# menu action
def open_file(self):
print("Clicked open file in menu")
self.source.open("file")
def open_camera(self):
print("Clicked open camera in menu")
self.source.open("camera")
def about(self):
print("Opening about window")
self.about = AboutWindow()
def quit(self):
print("Quit application")
QtCore.QCoreApplication.instance().quit()