本文整理匯總了Python中Box.Box.__del__方法的典型用法代碼示例。如果您正苦於以下問題:Python Box.__del__方法的具體用法?Python Box.__del__怎麽用?Python Box.__del__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Box.Box
的用法示例。
在下文中一共展示了Box.__del__方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MainWindow
# 需要導入模塊: from Box import Box [as 別名]
# 或者: from Box.Box import __del__ [as 別名]
class MainWindow(QMainWindow):
def __init__(self, data = {}, parent = None):
QMainWindow.__init__(self, parent)
self.runned = False
self.tr = Translator('mailViewer')
self.autoLoadImage = False
self.privateEnable = False
self.data = data
self.setWindowTitle(self.tr._translate('Mail Viewer'))
self.setWindowIcon(QIcon().fromTheme("mail"))
self.reload_ = QAction(QIcon().fromTheme("view-refresh"), '&'+self.tr._translate('Reload Job'), self)
self.reload_.setShortcut('Ctrl+R')
self.connect(self.reload_, SIGNAL('triggered()'), self.reloadJob)
self.exit_ = QAction(QIcon().fromTheme("application-exit"), '&'+self.tr._translate('Exit'), self)
self.exit_.setShortcut('Ctrl+Q')
self.connect(self.exit_, SIGNAL('triggered()'), self._close)
self.image_ = QAction(self.tr._translate('Image AutoLoad'), self)
self.image_.setShortcut('Ctrl+I')
self.image_.setCheckable(True)
self.image_.setChecked(self.autoLoadImage)
#self.image_.setIcon(QIcon().fromTheme("arrow-down-double"))
self.connect(self.image_, SIGNAL('triggered()'), self._image)
self.priv_ = QAction(self.tr._translate('Private Browsing'), self)
self.priv_.setShortcut('Ctrl+P')
self.priv_.setCheckable(True)
self.priv_.setChecked(self.privateEnable)
#self.priv_.setIcon(QIcon().fromTheme("user-group-delete"))
self.connect(self.priv_, SIGNAL('triggered()'), self._private)
self.menubar = self.menuBar()
file_ = self.menubar.addMenu('&'+self.tr._translate('File'))
file_.addAction(self.reload_)
file_.addAction(self.exit_)
sett_ = self.menubar.addMenu('&'+self.tr._translate('Settings'))
sett_.addAction(self.image_)
sett_.addAction(self.priv_)
self.statusBar = QStatusBar(self)
self.setStatusBar(self.statusBar)
self.menuTab = Box(self.data, self)
self.setCentralWidget(self.menuTab)
def _image(self): self.regimeChange('image', self.image_.isChecked())
def _private(self): self.regimeChange('private', self.priv_.isChecked())
def regimeChange(self, parameter, state):
if parameter == 'image' :
attr = QWebSettings.AutoLoadImages
else :
attr = QWebSettings.PrivateBrowsingEnabled
for wdg in self.menuTab.webViewWDGs :
wdg.settings().setAttribute(attr, state)
wdg.reload()
def reloadJob(self):
self.menuTab = Box(self.data, self)
self.setCentralWidget(self.menuTab)
self.menuTab.startGetMail()
def _close(self): self.eventClose()
def closeEvent(self, ev):
self.menuTab.__del__()
def eventClose(self):
self.close()