当前位置: 首页>>代码示例>>Python>>正文


Python QWebEngineView.setFixedHeight方法代码示例

本文整理汇总了Python中PyQt5.QtWebEngineWidgets.QWebEngineView.setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:Python QWebEngineView.setFixedHeight方法的具体用法?Python QWebEngineView.setFixedHeight怎么用?Python QWebEngineView.setFixedHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtWebEngineWidgets.QWebEngineView的用法示例。


在下文中一共展示了QWebEngineView.setFixedHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: X0h

# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedHeight [as 别名]

#.........这里部分代码省略.........
                               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")

        left_box_5 = oasysgui.widgetBox(left_box_1, "Database Options for dispersion corrections df1, df2", addSpace=True, orientation="vertical", width=380, height=185)

        gui.radioButtons(left_box_5, self, "df1df2", ["Auto (Henke at low energy, X0h at mid, Brennan-Cowan\nat high)",
                                                      "Use X0h data (5-25 keV or 0.5-2.5 A), recommended for\nBragg diffraction",
                                                      "Use Henke data (0.01-30 keV or 0.4-1200 A),\nrecommended for soft x-rays",
                                                      "Use Brennan-Cowan data (0.03-700 keV or 0.02-400 A)",
                                                      "Compare results for all of the above sources"])

        left_box_6 = oasysgui.widgetBox(left_box_1, "Output Options", addSpace=True, orientation="vertical", width=380, height=50)

        gui.checkBox(left_box_6, self, "detail", "Print atomic coordinates", labelWidth=250)

        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(640)
        self.x0h_output.setFixedWidth(740)

    def getLeftPartWidth(self):
        return 415

    def set_xway(self):
        self.box_wave.setVisible(self.xway!=2)
        self.box_line.setVisible(self.xway==2)

    def set_coway(self):
        self.box_crystal.setVisible(self.coway==0)
        self.box_other.setVisible(self.coway==1)
        self.box_chemical.setVisible(self.coway==2)

    def set_rho(self):
        if not self.chem is None:
            if not self.chem.strip() == "":
                self.chem = self.chem.strip()
                self.rho = XRayServerPhysics.getMaterialDensity(self.chem)
开发者ID:lucarebuffi,项目名称:XRayServer,代码行数:69,代码来源:ow_x0h.py

示例2: X0p

# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedHeight [as 别名]

#.........这里部分代码省略.........
        gui.separator(left_box_5)

        oasysgui.lineEdit(left_box_5, self, "prcmin", label="Minimum |xh/x0| (%)", labelWidth=250, addSpace=False, valueType=float, orientation="horizontal")

        left_box_5_1 = oasysgui.widgetBox(left_box_5, "Database Options for dispersion corrections df1, df2", addSpace=True, orientation="vertical", width=370, height=185)

        gui.radioButtons(left_box_5_1, self, "df1df2", ["Auto (Henke at low energy, X0h at mid, Brennan-Cowan\nat high)",
                                                      "Use X0h data (5-25 keV or 0.5-2.5 A), recommended for\nBragg diffraction",
                                                      "Use Henke data (0.01-30 keV or 0.4-1200 A),\nrecommended for soft x-rays",
                                                      "Use Brennan-Cowan data (0.03-700 keV or 0.02-400 A)"])

        left_box_6 = oasysgui.widgetBox(tab_2, "", addSpace=True, orientation="vertical", width=370, height=255)

        gui.separator(left_box_6)

        left_box_6_1 = oasysgui.widgetBox(left_box_6, "", addSpace=False, orientation="horizontal", width=370, height=30)

        oasysgui.lineEdit(left_box_6_1, self, "base1", label="Surface Plane Indices", labelWidth=200, addSpace=False, valueType=int, orientation="horizontal")
        oasysgui.lineEdit(left_box_6_1, self, "base2", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")
        oasysgui.lineEdit(left_box_6_1, self, "base3", label=" ", labelWidth=1, addSpace=False, valueType=int, orientation="horizontal")

        gui.radioButtons(left_box_6, self, "modesearch", ["Planes make angles from Theta1 to Theta2",
                                                      "Planes make angles from Theta1 to (Bragg_Angle - Theta2)",
                                                      "Planes make angles from (Bragg_Angle - Theta1)\nto (Bragg_Angle - Theta2)"])

        gui.separator(left_box_6, height=10)

        left_box_6_2 = oasysgui.widgetBox(left_box_6, "", addSpace=True, orientation="horizontal", width=370, height=30)

        oasysgui.lineEdit(left_box_6_2, self, "q1", label="Theta1", labelWidth=80, addSpace=False, valueType=float, orientation="horizontal")
        oasysgui.lineEdit(left_box_6_2, self, "q2", label="  Theta2", labelWidth=80, addSpace=False, valueType=float, orientation="horizontal")

        button = gui.button(self.controlArea, self, "Find Planes!", callback=self.submit)
        button.setFixedHeight(30)

        gui.rubber(self.controlArea)

        self.tabs_widget = oasysgui.tabWidget(self.mainArea)
        self.tab_output = oasysgui.createTabPage(self.tabs_widget, "X-ray Server Ouput")

        self.x0h_output = QWebView(self.tab_output)

        self.tab_output.layout().addWidget(self.x0h_output)

        self.x0h_output.setFixedHeight(640)
        self.x0h_output.setFixedWidth(740)

    def set_xway(self):
        self.box_wave.setVisible(self.xway!=2)
        self.box_line.setVisible(self.xway==2)


    def submit(self):
        self.progressBarInit()
        self.setStatusMessage("Submitting Request")
        
        self.checkFields()

        parameters = {}

        parameters.update({"xway" : str(self.xway + 1)})
        parameters.update({"wave" : str(self.wave)})
        parameters.update({"line" : self.line})
        parameters.update({"code" : self.code})
        parameters.update({"hkl11" : str(self.hkl11)})
        parameters.update({"hkl12" : str(self.hkl12)})
开发者ID:lucarebuffi,项目名称:XRayServer,代码行数:70,代码来源:ow_x0p.py

示例3: X0h

# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import setFixedHeight [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

#.........这里部分代码省略.........
开发者ID:lucarebuffi,项目名称:XRayServer,代码行数:103,代码来源:ow_x0h_NEW.py


注:本文中的PyQt5.QtWebEngineWidgets.QWebEngineView.setFixedHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。