本文整理汇总了Python中PySide.QtGui.QFrame.findChild方法的典型用法代码示例。如果您正苦于以下问题:Python QFrame.findChild方法的具体用法?Python QFrame.findChild怎么用?Python QFrame.findChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QFrame
的用法示例。
在下文中一共展示了QFrame.findChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: window
# 需要导入模块: from PySide.QtGui import QFrame [as 别名]
# 或者: from PySide.QtGui.QFrame import findChild [as 别名]
#.........这里部分代码省略.........
if self.new_tab_behavior == "insert":
self.tabs.insertTab(self.tabs.currentIndex()+1, complete_tab_widget,
unicode(new_tab.title()))
elif self.new_tab_behavior == "append":
self.tabs.appendTab(complete_tab_widget, unicode(new_tab.title()))
self.tabs.setUpdatesEnabled(True)
new_tab.titleChanged.connect(self.change_tab)
new_tab.urlChanged.connect(self.change_tab)
new_tab.loadStarted.connect(self.load_start)
new_tab.loadFinished.connect(self.load_finish)
new_tab.loadProgress.connect(self.pbar.setValue)
new_tab.page().linkHovered.connect(self.linkHover)
inspector.setPage(new_tab.page())
for index, tab in enumerate(saved_tabs['tabs']):
self.tabs.setTabText(index, tab['history'][tab['current_history']]['title'])
self.tabs.setCurrentIndex(saved_tabs['current_tab'])
else:
self.new_tab()
tabs_layout = QVBoxLayout()
tabs_layout.setSpacing(0)
tabs_layout.setContentsMargins(0, 0, 0, 0)
tabs_layout.addWidget(self.tabs)
self.tabs_widget = QFrame()
self.tabs_widget.setObjectName("TabLine")
self.tabs_widget.setStyleSheet(self.style_sheet)
self.tabs_widget.setLayout(tabs_layout)
self.tabs_widget.setVisible(True)
# Webkit settings
gsettings = self.tabs.currentWidget().findChild(QFrame, unicode('pageWidget')).findChild(QWebView, unicode('webView')).settings().globalSettings()
# Basic settings
gsettings.setAttribute(QWebSettings.AutoLoadImages, True)
gsettings.setAttribute(QWebSettings.JavascriptEnabled, True)
gsettings.setAttribute(QWebSettings.JavascriptCanOpenWindows, False)
gsettings.setAttribute(QWebSettings.JavascriptCanAccessClipboard, False)
gsettings.setAttribute(QWebSettings.PluginsEnabled, False) # Flash isn't stable at present
gsettings.setAttribute(QWebSettings.JavaEnabled, False) # Java applet's aren't supported by PySide
gsettings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
gsettings.setAttribute(QWebSettings.AcceleratedCompositingEnabled,
True)
# Performace settings
gsettings.setAttribute(QWebSettings.DnsPrefetchEnabled, True)
gsettings.setAttribute(QWebSettings.AcceleratedCompositingEnabled, True)
gsettings.setAttribute(QWebSettings.DnsPrefetchEnabled, True)
# Other settings
gsettings.setAttribute(QWebSettings.PrivateBrowsingEnabled, False)
# Create a vertical layout and add widgets
vlayout = QVBoxLayout()
vlayout.setSpacing(0)
vlayout.setContentsMargins(0, 0, 0, 0)
# toolbar.addWidget(self.input_widget)
vlayout.addWidget(self.input_widget)
vlayout.addWidget(self.bookmarks_widget)
vlayout.addWidget(self.tabs_widget)
# create a widget to hold the vertical layout
wrapper_widget = QWidget()
wrapper_widget.setLayout(vlayout)
self.setCentralWidget(wrapper_widget)
self.bbutton.clicked.connect(self.tabs.currentWidget().findChild(QFrame, unicode('pageWidget')).findChild(QWebView, unicode('webView')).back)