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


Python QButtonGroup.setObjectName方法代码示例

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


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

示例1: AddAccountDialog

# 需要导入模块: from PyQt4.QtGui import QButtonGroup [as 别名]
# 或者: from PyQt4.QtGui.QButtonGroup import setObjectName [as 别名]
class AddAccountDialog(base_class, ui_class):
    __metaclass__ = QSingleton

    implements(IObserver)

    def __init__(self, parent=None):
        super(AddAccountDialog, self).__init__(parent)
        with Resources.directory:
            self.setupUi(self)
        self.background_frame.setStyleSheet("")
        self.button_group = QButtonGroup(self)
        self.button_group.setObjectName("button_group")
        self.button_group.addButton(self.add_account_button, self.panel_view.indexOf(self.add_account_panel))
        self.button_group.addButton(self.create_account_button, self.panel_view.indexOf(self.create_account_panel))
        font = self.title_label.font()
        font.setPointSizeF(self.info_label.fontInfo().pointSizeF() + 3)
        font.setFamily("Sans Serif")
        self.title_label.setFont(font)
        font_metrics = self.create_status_label.fontMetrics()
        self.create_status_label.setMinimumHeight(
            font_metrics.height() + 2 * (font_metrics.height() + font_metrics.leading())
        )  # reserve space for 3 lines
        font_metrics = self.email_note_label.fontMetrics()
        self.email_note_label.setMinimumWidth(
            font_metrics.width(u"The E-mail address is used when sending voicemail")
        )  # hack to make text justification look nice everywhere
        self.add_account_button.setChecked(True)
        self.panel_view.setCurrentWidget(self.add_account_panel)
        self.new_password_editor.textChanged.connect(self._SH_PasswordTextChanged)
        self.button_group.buttonClicked[int].connect(self._SH_PanelChangeRequest)
        self.accept_button.clicked.connect(self._SH_AcceptButtonClicked)
        self.display_name_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.name_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.username_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.sip_address_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.password_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.new_password_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.verify_password_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.email_address_editor.statusChanged.connect(self._SH_ValidityStatusChanged)
        self.display_name_editor.regexp = re.compile("^.*$")
        self.name_editor.regexp = re.compile("^.+$")
        self.username_editor.regexp = re.compile(
            "^\w(?<=[^0_])[\w.-]{4,31}(?<=[^_.-])$", re.IGNORECASE
        )  # in order to enable unicode characters add re.UNICODE to flags
        self.sip_address_editor.regexp = re.compile("^[^@\s][email protected][^@\s]+$")
        self.password_editor.regexp = re.compile("^.*$")
        self.new_password_editor.regexp = re.compile("^.{8,}$")
        self.verify_password_editor.regexp = re.compile("^$")
        self.email_address_editor.regexp = re.compile("^[^@\s][email protected][^@\s]+$")

        account_manager = AccountManager()
        notification_center = NotificationCenter()
        notification_center.add_observer(self, sender=account_manager)

    def _get_display_name(self):
        if self.panel_view.currentWidget() is self.add_account_panel:
            return unicode(self.display_name_editor.text())
        else:
            return unicode(self.name_editor.text())

    def _set_display_name(self, value):
        self.display_name_editor.setText(value)
        self.name_editor.setText(value)

    def _get_username(self):
        return unicode(self.username_editor.text())

    def _set_username(self, value):
        self.username_editor.setText(value)

    def _get_sip_address(self):
        return unicode(self.sip_address_editor.text())

    def _set_sip_address(self, value):
        self.sip_address_editor.setText(value)

    def _get_password(self):
        if self.panel_view.currentWidget() is self.add_account_panel:
            return unicode(self.password_editor.text())
        else:
            return unicode(self.new_password_editor.text())

    def _set_password(self, value):
        self.password_editor.setText(value)
        self.new_password_editor.setText(value)

    def _get_verify_password(self):
        return unicode(self.verify_password_editor.text())

    def _set_verify_password(self, value):
        self.verify_password_editor.setText(value)

    def _get_email_address(self):
        return unicode(self.email_address_editor.text())

    def _set_email_address(self, value):
        self.email_address_editor.setText(value)

    display_name = property(_get_display_name, _set_display_name)
    username = property(_get_username, _set_username)
#.........这里部分代码省略.........
开发者ID:grengojbo,项目名称:sipclients,代码行数:103,代码来源:accounts.py

示例2: createLabelAndList

# 需要导入模块: from PyQt4.QtGui import QButtonGroup [as 别名]
# 或者: from PyQt4.QtGui.QButtonGroup import setObjectName [as 别名]
def createLabelAndList(labelText):
    widget, label = _createLabelInWidget(labelText, QGridLayout)
    buttonGroup = QButtonGroup(widget)
    buttonGroup.setObjectName('buttonGroup')
    buttonGroup.setExclusive(False)
    return (widget, label, buttonGroup)
开发者ID:maximerobin,项目名称:Ufwi,代码行数:8,代码来源:NuConfPageKit.py


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