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


Python QScrollArea.setObjectName方法代码示例

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


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

示例1: get_notes_mail_widget

# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import setObjectName [as 别名]
    def get_notes_mail_widget(self):
        """
        Return QWidget with notes and email areas and edition buttons

        :return: notes and email QWidget
        :rtype: QWidget
        """

        notes_widget = QWidget()
        notes_layout = QGridLayout(notes_widget)

        # Notes title and button
        notes_label = QLabel(_('Notes:'))
        notes_label.setObjectName('subtitle')
        notes_layout.addWidget(notes_label, 0, 0, 1, 1)

        notes_btn = QPushButton()
        notes_btn.setIcon(QIcon(settings.get_image('edit')))
        notes_btn.setToolTip(_("Edit your notes."))
        notes_btn.setFixedSize(32, 32)
        notes_btn.clicked.connect(lambda: self.patch_data('notes'))
        notes_layout.addWidget(notes_btn, 0, 2, 1, 1)

        # Notes scroll area
        self.labels['notes'].setText(data_manager.database['user'].data['notes'])
        self.labels['notes'].setWordWrap(True)
        self.labels['notes'].setTextInteractionFlags(Qt.TextSelectableByMouse)
        notes_scrollarea = QScrollArea()
        notes_scrollarea.setWidget(self.labels['notes'])
        notes_scrollarea.setWidgetResizable(True)
        notes_scrollarea.setObjectName('notes')
        notes_layout.addWidget(notes_scrollarea, 1, 0, 1, 3)

        # Mail
        mail_label = QLabel(_('Email:'))
        mail_label.setObjectName('subtitle')
        notes_layout.addWidget(mail_label, 2, 0, 1, 1)
        self.labels['email'].setObjectName('edit')
        notes_layout.addWidget(self.labels['email'], 2, 1, 1, 1)

        mail_btn = QPushButton()
        mail_btn.setIcon(QIcon(settings.get_image('edit')))
        mail_btn.setFixedSize(32, 32)
        mail_btn.clicked.connect(lambda: self.patch_data('email'))
        notes_layout.addWidget(mail_btn, 2, 2, 1, 1)

        notes_layout.setAlignment(Qt.AlignTop)

        return notes_widget
开发者ID:Alignak-monitoring-contrib,项目名称:alignak-app,代码行数:51,代码来源:profile.py

示例2: get_notes_output_widget

# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import setObjectName [as 别名]
    def get_notes_output_widget(self):
        """
        Return QWidget with output and notes data

        :return: widget with host output and notes
        :rtype: QWidget
        """

        widget = QWidget()
        layout = QGridLayout()
        widget.setLayout(layout)

        # Output
        output_title = QLabel(_("Output"))
        output_title.setObjectName('title')
        layout.addWidget(output_title, 0, 0, 1, 1)

        self.labels['ls_output'].setWordWrap(True)
        self.labels['ls_output'].setTextInteractionFlags(Qt.TextSelectableByMouse)
        output_scrollarea = QScrollArea()
        output_scrollarea.setWidget(self.labels['ls_output'])
        output_scrollarea.setWidgetResizable(True)
        output_scrollarea.setObjectName('output')
        layout.addWidget(output_scrollarea, 1, 0, 1, 2)

        # Notes
        notes_title = QLabel(_("Notes:"))
        notes_title.setObjectName('title')
        layout.addWidget(notes_title, 0, 2, 1, 1)

        notes_btn = QPushButton()
        notes_btn.setIcon(QIcon(settings.get_image('edit')))
        notes_btn.setToolTip(_("Edit host notes."))
        notes_btn.setFixedSize(32, 32)
        notes_btn.clicked.connect(self.patch_data)
        layout.addWidget(notes_btn, 0, 3, 1, 1)

        self.labels['notes'].setWordWrap(True)
        self.labels['notes'].setTextInteractionFlags(Qt.TextSelectableByMouse)
        notes_scrollarea = QScrollArea()
        notes_scrollarea.setWidget(self.labels['notes'])
        notes_scrollarea.setWidgetResizable(True)
        notes_scrollarea.setObjectName('notes')
        layout.addWidget(notes_scrollarea, 1, 2, 1, 2)

        return widget
开发者ID:Alignak-monitoring-contrib,项目名称:alignak-app,代码行数:48,代码来源:host.py

示例3: get_last_check_widget

# 需要导入模块: from PyQt5.Qt import QScrollArea [as 别名]
# 或者: from PyQt5.Qt.QScrollArea import setObjectName [as 别名]
    def get_last_check_widget(self):
        """
        Return QWidget with last check data

        :return: widget with last check data
        :rtype: QWidget
        """

        widget = QWidget()
        layout = QGridLayout()
        widget.setLayout(layout)

        # Title
        check_title = QLabel(_('My last check'))
        check_title.setObjectName('itemtitle')
        check_title.setFixedHeight(30)
        layout.addWidget(check_title, 0, 0, 1, 2)

        # When last check
        when_title = QLabel(_("When:"))
        when_title.setObjectName('title')
        layout.addWidget(when_title, 2, 0, 1, 1)

        layout.addWidget(self.labels['ls_last_check'], 2, 1, 1, 1)

        # Output
        output_title = QLabel(_("Output"))
        output_title.setObjectName('title')
        layout.addWidget(output_title, 3, 0, 1, 1)

        self.labels['ls_output'].setWordWrap(True)
        self.labels['ls_output'].setTextInteractionFlags(Qt.TextSelectableByMouse)
        output_scrollarea = QScrollArea()
        output_scrollarea.setWidget(self.labels['ls_output'])
        output_scrollarea.setWidgetResizable(True)
        output_scrollarea.setObjectName('output')
        layout.addWidget(output_scrollarea, 3, 1, 1, 1)

        return widget
开发者ID:Alignak-monitoring-contrib,项目名称:alignak-app,代码行数:41,代码来源:service.py


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