我正在尝试过滤我桌子的一列,但由于某种原因,我收到的超出范围'错误按摩。
我在做什么:
tagName
我的表格如何在列中显示: 一个websiteID,B failureLogID,C FailureLogStart D FailureLogEnd
使用上面的代码我想过滤C列
答案 0 :(得分:0)
假设您要使用# Python import
import sys
# PYQT Imports
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
# from QtWebEngineWidgets.QWebEngineView import QWebEngineView
# UI IMPORT
import UI_Sailor
class WebPage(QtWebEngineWidgets.QWebEnginePage):
def chooseFile(self, frame=None, path=''):
print ('Called this')
return
class Sailor(QtWidgets.QMainWindow, UI_Sailor.Ui_Sailor):
def __init__(self):
super(self.__class__, self).__init__()
self.setupUi(self)
# self.setWindowIcon(QtGui.QIcon(':/Icons/Icons/Icon_Small.png'))
self.setWindowTitle('Sailor - 1.0.0')
glob_settings = QtWebEngineWidgets.QWebEngineSettings.globalSettings()
self.setWebSettings(glob_settings)
self.create_connections()
def setWebSettings(self, object_settings):
print ('Called')
# Global web settings
object_settings.setAttribute(1, True) # JaveScript
object_settings.setAttribute(3, False) # Clipboard (JaveScript)
object_settings.setAttribute(5, False) # Local Storage
object_settings.setAttribute(6, False) # LocalContentCanAccessRemoteUrls
object_settings.setAttribute(7, False) # XSSAuditingEnabled
object_settings.setAttribute(9, False) # LocalContentCanAccessFileUrls
object_settings.setAttribute(11, True) # ScrollAnimatorEnabled
object_settings.setAttribute(14, True) # FullScreenSupportEnabled
# Check that the options are applied
# print (object_settings.testAttribute(1)) # JaveScript
# print (object_settings.testAttribute(2)) # JaveScript
# print (object_settings.testAttribute(3)) # Clipboard (JaveScript)
# print (object_settings.testAttribute(5)) # Local Storage
# print (object_settings.testAttribute(6)) # LocalContentCanAccessRemoteUrls
# print (object_settings.testAttribute(7)) # XSSAuditingEnabled
# print (object_settings.testAttribute(9)) # LocalContentCanAccessFileUrls
# print (object_settings.testAttribute(11)) # ScrollAnimatorEnabled
# print (object_settings.testAttribute(14)) # FullScreenSupportEnabled
def create_connections(self):
self.TXT_Address.returnPressed.connect(self.web_load_url)
# self.WEB_View.urlChanged.connect(self.debug)
def web_load_url(self):
# Creates the proper url
url_base = str(self.TXT_Address.text())
url_clean = self.url_handler(url_base)
# Loads the url
# self.WEB_View.setUrl(QtCore.QUrl(url_clean))
self.WEB_View.setPage(WebPage(self.WEB_View))
self.WEB_View.load(QtCore.QUrl(url_clean))
self.setWebSettings(self.WEB_View.settings())
def debug(self):
print ('called')
def url_handler(self, url):
if 'http' not in url:
return 'http://{}'.format(url)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
form = Sailor()
form.show()
app.exec_()
的值过滤第3列中的表:
TextBox5