本文整理汇总了Python中PyQt5.QtWebEngineWidgets.QWebEngineView.setFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:Python QWebEngineView.setFixedWidth方法的具体用法?Python QWebEngineView.setFixedWidth怎么用?Python QWebEngineView.setFixedWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWebEngineWidgets.QWebEngineView
的用法示例。
在下文中一共展示了QWebEngineView.setFixedWidth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: X0h
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedWidth [as 别名]
class X0h(XrayServerWidget):
name = "X0h"
description = "X0h"
icon = "icons/x0h.png"
maintainer = "Luca Rebuffi"
maintainer_email = "luca.rebuffi(@[email protected])elettra.eu"
priority = 1
category = "X0h"
keywords = ["data", "file", "load", "read"]
want_main_area = 1
outputs = [{"name": "xrayserver_data",
"type": DataExchangeObject,
"doc": "xrayserver_data",
"id": "xrayserver_data"}, ]
xway = Setting(2)
wave = Setting(0.0)
line = Setting("Cu-Ka1")
coway = Setting(0)
code = Setting("Silicon")
amor = Setting("")
chem = Setting("")
rho = Setting(0.0)
i1 = Setting(1)
i2 = Setting(1)
i3 = Setting(1)
df1df2 = Setting(1)
detail = Setting(1)
def __init__(self):
super().__init__()
left_box_1 = oasysgui.widgetBox(self.controlArea, "X0h Request Form", addSpace=True, orientation="vertical",
width=400, height=630)
left_box_2 = oasysgui.widgetBox(left_box_1, "X-rays", addSpace=True, orientation="horizontal", width=380, height=110)
left_box_2_1 = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="vertical", width=150, height=110)
gui.radioButtons(left_box_2_1, self, "xway", ["Wavelength (Å)", "Energy (keV)", "Characteristic line"], callback=self.set_xway )
self.box_wave = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="vertical", width=190)
gui.separator(self.box_wave, height=10)
oasysgui.lineEdit(self.box_wave, self, "wave", label="", labelWidth=0, addSpace=False, valueType=float, orientation="horizontal")
self.box_line = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="horizontal", width=190, height=110)
gui.separator(self.box_line, height=120)
XRayServerGui.combobox_text(self.box_line, self, "line", label="", labelWidth=0,
items=self.get_lines(),
sendSelectedValue=True, orientation="horizontal", selectedValue=self.line)
button = gui.button( self.box_line, self, "?", callback=self.help_lines)
button.setFixedWidth(15)
self.set_xway()
left_box_3 = oasysgui.widgetBox(left_box_1, "Target", addSpace=True, orientation="horizontal", width=380, height=140)
left_box_3_1 = oasysgui.widgetBox(left_box_3, "", addSpace=True, orientation="vertical", width=125, height=110)
gui.radioButtons(left_box_3_1, self, "coway", ["Crystal", "Other Material", "Chemical Formula"], callback=self.set_coway )
self.box_crystal = oasysgui.widgetBox(left_box_3, "", addSpace=True, orientation="horizontal", width=210)
XRayServerGui.combobox_text(self.box_crystal, self, "code", label="", labelWidth=0,
items=self.get_crystals(),
sendSelectedValue=True, orientation="horizontal", selectedValue=self.code)
button = gui.button( self.box_crystal, self, "?", callback=self.help_crystals)
button.setFixedWidth(15)
self.box_other = oasysgui.widgetBox(left_box_3, "", addSpace=True, orientation="horizontal", width=210)
gui.separator(self.box_other, height=75)
XRayServerGui.combobox_text(self.box_other, self, "amor", label="", labelWidth=0,
items=self.get_others(),
sendSelectedValue=True, orientation="horizontal", selectedValue=self.amor)
button = gui.button( self.box_other, self, "?", callback=self.help_others)
button.setFixedWidth(15)
self.box_chemical = oasysgui.widgetBox(left_box_3, "", addSpace=True, orientation="vertical", width=210, height=140)
gui.separator(self.box_chemical, height=50)
oasysgui.lineEdit(self.box_chemical, self, "chem", label=" ", labelWidth=1, addSpace=False, valueType=str, orientation="horizontal", callback=self.set_rho)
oasysgui.lineEdit(self.box_chemical, self, "rho", label=u"\u03C1" + " (g/cm3)", labelWidth=60, addSpace=False, valueType=float, orientation="horizontal")
self.set_coway()
left_box_4 = oasysgui.widgetBox(left_box_1, "Reflection", addSpace=True, orientation="horizontal", width=380, height=60)
oasysgui.lineEdit(left_box_4, self, "i1", label="Miller indices", labelWidth=200, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "i2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "i3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
#.........这里部分代码省略.........
示例2: X0p
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedWidth [as 别名]
class X0p(XrayServerWidget):
name = "X0h Search"
description = "X0p"
icon = "icons/x0p.png"
maintainer = "Luca Rebuffi"
maintainer_email = "luca.rebuffi(@[email protected])elettra.eu"
priority = 2
category = "X0h"
keywords = ["data", "file", "load", "read"]
want_main_area = 1
xway = Setting(2)
wave = Setting(0.0)
line = Setting("Cu-Ka1")
code = Setting("Silicon")
hkl11 = Setting(-5)
hkl12 = Setting(-5)
hkl13 = Setting(-5)
hkl21 = Setting(5)
hkl22 = Setting(5)
hkl23 = Setting(5)
qb1 = Setting(0.0)
qb2 = Setting(90.0)
prcmin = Setting(0.0)
df1df2 = Setting(1)
base1 = Setting(1)
base2 = Setting(0)
base3 = Setting(0)
modesearch = Setting(0)
q1 = Setting(0.0)
q2 = Setting(180.0)
def __init__(self):
super().__init__()
left_box_1 = oasysgui.widgetBox(self.controlArea, "X0h-Search Request Form", addSpace=True, orientation="vertical",
width=400, height=630)
left_box_2 = oasysgui.widgetBox(left_box_1, "X-rays", addSpace=True, orientation="horizontal", width=380, height=110)
left_box_2_1 = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="vertical", width=150, height=110)
gui.radioButtons(left_box_2_1, self, "xway", ["Wavelength (Å)", "Energy (keV)", "Characteristic line"], callback=self.set_xway )
self.box_wave = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="vertical", width=190)
gui.separator(self.box_wave, height=10)
oasysgui.lineEdit(self.box_wave, self, "wave", label="", labelWidth=0, addSpace=False, valueType=float, orientation="horizontal")
self.box_line = oasysgui.widgetBox(left_box_2, "", addSpace=True, orientation="horizontal", width=190, height=110)
gui.separator(self.box_line, height=120)
XRayServerGui.combobox_text(self.box_line, self, "line", label="", labelWidth=0,
items=self.get_lines(),
sendSelectedValue=True, orientation="horizontal", selectedValue=self.line)
button = gui.button( self.box_line, self, "?", callback=self.help_lines)
button.setFixedWidth(15)
self.set_xway()
left_box_3 = oasysgui.widgetBox(left_box_1, "Crystal", addSpace=True, orientation="horizontal", width=380, height=60)
self.box_crystal = oasysgui.widgetBox(left_box_3, "", addSpace=True, orientation="horizontal", width=210)
XRayServerGui.combobox_text(self.box_crystal, self, "code", label="", labelWidth=0,
items=self.get_crystals(),
sendSelectedValue=True, orientation="horizontal", selectedValue=self.code)
button = gui.button( self.box_crystal, self, "?", callback=self.help_crystals)
button.setFixedWidth(15)
left_box_4 = oasysgui.widgetBox(left_box_1, "Bragg Planes Range", addSpace=True, orientation="horizontal", width=380, height=60)
oasysgui.lineEdit(left_box_4, self, "hkl11", label="From", labelWidth=50, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "hkl12", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "hkl13", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "hkl21", label=" To", labelWidth=50, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "hkl22", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
oasysgui.lineEdit(left_box_4, self, "hkl23", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
left_box_7 = oasysgui.widgetBox(left_box_1, "Bragg Angle Range", addSpace=True, orientation="horizontal", width=380, height=60)
oasysgui.lineEdit(left_box_7, self, "qb1", label="From", labelWidth=80, addSpace=False, valueType=float, orientation="horizontal")
oasysgui.lineEdit(left_box_7, self, "qb2", label=" To", labelWidth=80, addSpace=False, valueType=float, orientation="horizontal")
tab_central = oasysgui.tabWidget(left_box_1)
tab_1 = oasysgui.createTabPage(tab_central, "Intensity Control")
tab_2 = oasysgui.createTabPage(tab_central, "Find only Bragg planes making certain angles to the surface")
#.........这里部分代码省略.........
示例3: X0h
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedWidth [as 别名]
class X0h(XrayServerWidget):
name = "X0h"
description = "X0h"
icon = "icons/x0h.png"
maintainer = "Luca Rebuffi"
maintainer_email = "luca.rebuffi(@[email protected])elettra.eu"
priority = 1
category = "X0h"
keywords = ["data", "file", "load", "read"]
want_main_area = 1
outputs = [{"name": "xrayserver_data",
"type": DataExchangeObject,
"doc": "xrayserver_data",
"id": "xrayserver_data"}, ]
def __init__(self):
super().__init__()
left_box_1 = oasysgui.widgetBox(self.controlArea, "X0h Request Form", addSpace=True, orientation="vertical",
width=610, height=640)
html = self.clear_input_form(HttpManager.send_xray_server_direct_request("/cgi/www_form.exe?template=x0h_form.htm"))
self.x0h_input = QWebView(left_box_1)
self.x0h_input.setHtml(html)
left_box_1.layout().addWidget(self.x0h_input)
self.x0h_input.setFixedHeight(540)
self.x0h_input.setFixedWidth(590)
button = gui.button(self.controlArea, self, "Get X0h!", callback=self.submit)
button.setFixedHeight(30)
gui.rubber(self.controlArea)
self.tabs = []
self.tabs_widget = oasysgui.tabWidget(self.mainArea)
self.initializeTabs()
self.x0h_output = QWebView(self.tabs[0])
self.tabs[0].layout().addWidget(self.x0h_output)
self.x0h_output.setFixedHeight(630)
self.x0h_output.setFixedWidth(740)
def clear_input_form(self, html):
temp_1 = html.split("<body onload=\"setOnloads()\">")[0]
temp_2 = html.split("<table cellspacing=0 cellpadding=0 border=0 bgcolor=\"#c1c1c1\"><tr><td>")[1]
html = temp_1 + "<body>\n<table cellspacing=0 cellpadding=0 border=0 bgcolor=\"#c1c1c1\"><tr><td>\n" + temp_2
html = html.split("<input type=SUBMIT value=\"Get X0h!\"><input type=RESET> <br>")[0]
html += "\n<input type=SUBMIT style=\"display: none;\" id=\"submit-btn\"><input type=RESET style=\"display: none;\" id=\"reset-btn\"> <br>"
html += "\n</form>"
html += "\n</td></tr></table>"
html += "\n</td></tr></table>"
html += "\n</body>"
html += "\n</html>"
temp_1, temp_2 = html.split("x0h.js")
html = temp_1 + XRAY_SERVER_URL + "/x0h.js" + temp_2
temp_1, temp_2 = html.split("/cgi/x0h_form.exe")
html = temp_1 + XRAY_SERVER_URL + "/cgi/x0h_form.exe" + temp_2
return html
def getLeftPartWidth(self):
return 620
def initializeTabs(self):
current_tab = self.tabs_widget.currentIndex()
size = len(self.tabs)
for index in range(0, size):
self.tabs_widget.removeTab(size-1-index)
self.tabs = [gui.createTabPage(self.tabs_widget, "X-ray Server Ouput"),
gui.createTabPage(self.tabs_widget, "Critical Angle for TER"),
gui.createTabPage(self.tabs_widget, "Darwin Curve (" + u"\u03C3" + " Pol.)"),
gui.createTabPage(self.tabs_widget, "Darwin Curve (" + u"\u03C0" + " Pol.)"),
]
for tab in self.tabs:
tab.setFixedHeight(650)
tab.setFixedWidth(750)
self.plot_canvas = [None, None, None]
self.tabs_widget.setCurrentIndex(current_tab)
def js_callback(self, result):
pass
#.........这里部分代码省略.........