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


Python QScrollArea.isHidden方法代码示例

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


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

示例1: PlotWindow

# 需要导入模块: from PyQt5.QtWidgets import QScrollArea [as 别名]
# 或者: from PyQt5.QtWidgets.QScrollArea import isHidden [as 别名]

#.........这里部分代码省略.........
                          (44, 160, 44), (152, 223, 138), (214, 39, 40), (255, 152, 150),
                          (148, 103, 189), (197, 176, 213), (140, 86, 75), (196, 156, 148),
                          (227, 119, 194), (247, 182, 210), (127, 127, 127), (199, 199, 199),
                          (188, 189, 34), (224, 198, 17), (23, 190, 207), (158, 218, 229)]

        for i, colors in enumerate(self.color_tab):
            r, g, b = colors
            self.color_tab[i] = (r / 255., g / 255., b / 255.)
        self.graph.color_tab = self.color_tab

    def getComboColor(self, index, curveName):
        combo_color = QComboBox()
        for i, colors in enumerate(self.color_tab):
            r, g, b = colors
            label = QIcon()
            color = QColor()
            color.setRgbF(r, g, b, 1.0)
            pixmap = QPixmap(20, 20)
            pixmap.fill(color)
            label.addPixmap(pixmap)
            combo_color.addItem("")
            combo_color.setItemIcon(i, label)
            combo_color.setFixedWidth(45)
        combo_color.setCurrentIndex(index % len(self.color_tab))
        combo_color.currentIndexChanged.connect(partial(self.graph.setColorLine, curveName))

        return combo_color

    def getSpinBox(self):
        integ_time = QDoubleSpinBox()
        integ_time.setMaximum(10000)
        integ_time.setValue(600)
        integ_time.setFixedWidth(80)
        return integ_time

    def getComboUnit(self, unit):
        combo = QComboBox()
        combo.addItems(["%s/%s"%(unit, t) for t in ["min", "hour"]])
        return combo



    def getButtonArrow(self):

        button_arrow = QPushButton()
        button_arrow.setIcon(self.parent.parent.icon_arrow_right)
        button_arrow.clicked.connect(partial(self.showhideConfig, button_arrow))
        button_arrow.setStyleSheet("border: 0px")

        return button_arrow

    def showhideConfig(self, button_arrow):

        if not self.scrollArea.isHidden():
            self.scrollArea.hide()
            button_arrow.setIcon(self.parent.parent.icon_arrow_left)
        else:
            self.scrollArea.show()
            button_arrow.setIcon(self.parent.parent.icon_arrow_right)

    def getVerticalCursor(self):

        button_vcursor = QPushButton()
        button_vcursor.setIcon(self.parent.parent.icon_vcursor)
        button_vcursor.setCheckable(True)
        button_vcursor.clicked.connect(partial(self.cursorOn, button_vcursor))
        button_vcursor.setStyleSheet("border: 0px")
        return button_vcursor

    def cursorOn(self, button_vcursor):
        if button_vcursor.isChecked():
            if self.graph.ax.get_lines():
                self.graph.fig.canvas.draw()
                button_vcursor.setIcon(self.parent.parent.icon_vcursor_on)
            else:
                button_vcursor.setChecked(False)

        else:
            button_vcursor.setIcon(self.parent.parent.icon_vcursor)
            if hasattr(self.graph, "linev"):
                self.graph.label_cursor.hide()
                self.graph.linev.remove()
                delattr(self.graph, "linev")
                self.graph.fig.canvas.draw()

    def clearLayout(self, layout, firstTimer=False):
        if firstTimer:
            for curve in self.graph.dictofline.itervalues():
                curve.watcher.stop()
            del (self.graph.dictofline)
        if layout is not None:
            while layout.count():
                item = layout.takeAt(0)
                widget = item.widget()
                if widget is not None:
                    widget.deleteLater()
                else:
                    self.clearLayout(item.layout())

        self.parent.delGraph(self)
开发者ID:CraigLoomis,项目名称:ics_sps_engineering_plotData,代码行数:104,代码来源:plot_window.py


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