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


Python QSplitter.setOpaqueResize方法代码示例

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


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

示例1: HelpDialog

# 需要导入模块: from PyQt5.QtWidgets import QSplitter [as 别名]
# 或者: from PyQt5.QtWidgets.QSplitter import setOpaqueResize [as 别名]
class HelpDialog(QObject, LogMixin):
    """Class implementing qthelp viewer dialog"""

    def __init__(self, qthelp_file, parent = None):
        """
        Constructor of HelpDialog

        :param qthelp_file: full path to qthelp helpfile

        """
        super(HelpDialog,self).__init__(parent)

        # instantiate help engine

        helpEngine = QHelpEngine(qthelp_file)
        helpEngine.setupData()
        self._helpEngine = helpEngine

        # base dialog widget
        self.ui = QDialog(None, QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowMinMaxButtonsHint | QtCore.Qt.WindowCloseButtonHint )

        self.ui.setWindowTitle("HelpViewer")
        self.ui.setWindowIcon(QIcon(":/images/prog_icons/help/help.ico"))

        # Create webview for help information
        # and assign a custom URL scheme handler for scheme "qthelp)

        self._wv = QWebEngineView(self.ui)
        self._urlschemehandler = HelpSchemeHandler(self._helpEngine, self._wv.page().profile())
        self._wv.page().profile().installUrlSchemeHandler(b'qthelp', self._urlschemehandler)

        # get help content overview widget
        self._helpContent = self._helpEngine.contentWidget()
        self._helpIndex = self._helpEngine.indexWidget()
        self._helpSearchQuery = self._helpEngine.searchEngine().queryWidget()
        self._helpSearchResult = self._helpEngine.searchEngine().resultWidget()
        self._se = self._helpEngine.searchEngine()
        self._se.reindexDocumentation()

        self._helpSearchQuery.search.connect(self.search)

        # create QSplitter
        self._splitterMain = QSplitter(QtCore.Qt.Vertical)
        self._splitterMain.setOpaqueResize(False)
        self._splitterSearch = QSplitter(QtCore.Qt.Horizontal)
        self._splitterSearch.setOpaqueResize(False)
        self._splitterUpper = QSplitter(QtCore.Qt.Horizontal)
        self._splitterUpper.setOpaqueResize(False)
        self._splitterLower = QSplitter(QtCore.Qt.Horizontal)
        self._splitterLower.setOpaqueResize(False)

        # create horzLayout
        self._horzLayoutSearch = QHBoxLayout()
        self._horzLayoutUpper = QHBoxLayout()
        self._horzLayoutLower = QHBoxLayout()
        # create vertLayout
        self._vertLayout = QVBoxLayout()

        # main widgets
        self._upperWidget = QWidget()
        self._lowerWidget = QWidget()
        self._btnReset = QPushButton()
        self._btnReset.setMaximumHeight(23)
        self._btnReset.setMaximumWidth(100)

        # build search structure
        self._splitterSearch.insertWidget(0, self._helpSearchQuery)
        self._splitterSearch.insertWidget(1, self._btnReset)

        # build upper inner structure
        self._splitterUpper.insertWidget(0, self._helpContent)
        self._splitterUpper.insertWidget(1, self._wv)
        self._horzLayoutUpper.addWidget(self._splitterUpper)
        self._upperWidget.setLayout(self._horzLayoutUpper)

        # build lower inner structure
        self._splitterLower.insertWidget(0, self._helpIndex)
        self._splitterLower.insertWidget(1, self._helpSearchResult)
        self._horzLayoutLower.addWidget(self._splitterLower)
        self._lowerWidget.setLayout(self._horzLayoutLower)

        # build outer structure
        self._splitterMain.insertWidget(0, self._splitterSearch)
        self._splitterMain.insertWidget(1, self._upperWidget)
        self._splitterMain.insertWidget(2, self._lowerWidget)

        self._helpSearchResult.hide()
        self._btnReset.hide()

        self._vertLayout.addWidget(self._splitterMain)
        self.ui.setLayout(self._vertLayout)

        # set splitter width
        w = self._splitterUpper.geometry().width()
        self._splitterUpper.setSizes([w*(1/4), w*(3/4)])
        w = self._splitterLower.geometry().width()
        self._splitterLower.setSizes([w*(1/5), w*(4/5)])
        h = self._splitterMain.geometry().height()
        self._splitterMain.setSizes([h*(1/9), h*(7/9), h*(1/9)])

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


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