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


Python QtGui.QRadioButton方法代码示例

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


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

示例1: createModeGroup

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def createModeGroup(self):
        '''
        set the trask mode setting group
        :return: mode group
        '''
        self.modegroupBox = QtGui.QGroupBox("& Task Mode")
        self.modegroupBox.setCheckable(True)
        self.modegroupBox.setChecked(True)
        self.CLS_mode_rb = QtGui.QRadioButton("CLS Mode")
        self.CLS_mode_rb.clicked.connect(self.CLS_model_selected)
        self.DET_mode_rb = QtGui.QRadioButton("DET Mode")
        self.DET_mode_rb.clicked.connect(self.DET_model_selected)
        self.SEG_mode_rb = QtGui.QRadioButton("SEG Mode")
        self.SEG_mode_rb.clicked.connect(self.SEG_model_selected)
        self.BRU_mode_rb = QtGui.QRadioButton("BRU Mode")
        self.BRU_mode_rb.clicked.connect(self.BRU_model_selected)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.CLS_mode_rb)
        vbox.addWidget(self.DET_mode_rb)
        vbox.addWidget(self.SEG_mode_rb)
        vbox.addWidget(self.BRU_mode_rb)
        vbox.addStretch(True)
        self.modegroupBox.setLayout(vbox)
        return self.modegroupBox 
开发者ID:lzx1413,项目名称:LabelImgTool,代码行数:27,代码来源:settingDialog.py

示例2: screenOptions

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def screenOptions(self):
        if QtGui.QDesktopWidget().numScreens() == 1:
            self.screenFull = None
            return None
        groupBox = QtGui.QGroupBox("Screen Area")
        groupBox.setAlignment(QtCore.Qt.AlignHCenter)
        groupBox.setFixedHeight(120)
        self.screenGroup = QtGui.QButtonGroup(groupBox)
        self.displays = []
        for x in range(0, QtGui.QDesktopWidget().numScreens()):
            self.displays.append(QtGui.QRadioButton("Monitor %d" % x))
        self.screenFull = QtGui.QRadioButton("All Monitors")
        for screen in self.displays:
            self.screenGroup.addButton(screen)
        self.screenGroup.addButton(self.screenFull)
        screenLayout = QtGui.QVBoxLayout()
        for screen in self.displays:
            screenLayout.addWidget(screen)
        screenLayout.addWidget(self.screenFull)
        screenLayout.addStretch(1)
        self.screenGroup.buttonClicked.connect(self.screenChange)
        groupBox.setLayout(screenLayout)
        return groupBox 
开发者ID:tb2097,项目名称:wacom-gui,代码行数:25,代码来源:options.py

示例3: initUI

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def initUI(self):
        device_data = get_iface_name()
        iface_num = len(device_data)
        iface_keys = device_data.keys()
        #网卡列表
        self.radio_lists = []
        self.gridlayout = QtGui.QGridLayout()
        self.label_name = QtGui.QLabel(u'接口名')
        self.label_ip = QtGui.QLabel(u'IP地址')
        self.label_receive = QtGui.QLabel(u'接受流量')
        self.label_send = QtGui.QLabel(u'发送流量')
        self.gridlayout.addWidget(self.label_name, 1, 1)
        self.gridlayout.addWidget(self.label_ip, 1, 2)
        self.gridlayout.addWidget(self.label_receive, 1, 3)
        self.gridlayout.addWidget(self.label_send, 1, 4)
        self.setLayout(self.gridlayout)
        for i in range(iface_num):
            iface_name = iface_keys[i]
            self.iface_radio = QtGui.QRadioButton(iface_name)
            if iface_name == 'eth0':
                self.iface_radio.setChecked(True)
            self.gridlayout.addWidget(self.iface_radio, i+2, 1)
            self.radio_lists.append(self.iface_radio)
            self.ip_label = QtGui.QLabel(get_ip_address(iface_name))
            self.gridlayout.addWidget(self.ip_label, i+2, 2)
            data = device_data[iface_name].split(';')
            self.receive_label = QtGui.QLabel(data[0])
            self.send_label = QtGui.QLabel(data[1])
            self.gridlayout.addWidget(self.receive_label, i+2, 3)
            self.gridlayout.addWidget(self.send_label, i+2, 4)
            self.setLayout(self.gridlayout)
        #添加按钮
        self.start_but = QtGui.QPushButton(u'确定', self)
        self.start_but.clicked.connect(self.exit_me)
        self.start_but.setCheckable(False)
        self.gridlayout.addWidget(self.start_but, iface_num + 2, 2)
        self.cancel_but = QtGui.QPushButton(u'取消', self)
        self.connect(self.cancel_but, QtCore.SIGNAL('clicked()'), QtCore.SLOT('close()'))
        self.cancel_but.setCheckable(False)
        self.gridlayout.addWidget(self.cancel_but, iface_num + 2, 3) 
开发者ID:HatBoy,项目名称:SimpleSniffer,代码行数:42,代码来源:Sniffer.py

示例4: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def __init__(self, *args, **kwargs):
		super(Window, self).__init__(*args, **kwargs)
		
		self.resize(300,200)

		self.layout = QtGui.QHBoxLayout(self)

		self.modalButton = QtGui.QRadioButton("Go modal")
		self.asyncModalButton = QtGui.QRadioButton("Go async modal")
		self.nonModalButton = QtGui.QRadioButton("Go non-modal")

		self.layout.addWidget(self.modalButton)
		self.layout.addWidget(self.asyncModalButton)
		self.layout.addWidget(self.nonModalButton)

		self.buttonGroup = QtGui.QButtonGroup()
		self.buttonGroup.setExclusive(True)

		self.buttonGroup.addButton(self.modalButton)
		self.buttonGroup.addButton(self.asyncModalButton)
		self.buttonGroup.addButton(self.nonModalButton)

		# Example of a signal with multiple signatures
		# This one can either return the int id of the button, or the button
		# object itself
		self.buttonGroup.buttonClicked['QAbstractButton*'].connect(self.handle_show_dialog) 
开发者ID:justinfx,项目名称:tutorials,代码行数:28,代码来源:modal_dialogs.py

示例5: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def __init__(self, choices, orientation='horizontal', parent=None):
        """
        The choices are specified as a list of dictionaries containing:

        * 'label': Shown in the UI
        * 'value': The value returned is selected

        :param choices: List of choices. See description.
        :type choices: list
        """
        super(RadioSet, self).__init__(parent)
        self.choices = copy(choices)

        if orientation == 'horizontal':
            layout = QtGui.QHBoxLayout()
        else:
            layout = QtGui.QVBoxLayout()

        group = QtGui.QButtonGroup(self)

        for choice in self.choices:
            choice['radio'] = QtGui.QRadioButton(choice['label'])
            group.addButton(choice['radio'])
            layout.addWidget(choice['radio'], stretch=0)
            choice['radio'].toggled.connect(self.on_toggle)

        layout.setContentsMargins(0, 0, 0, 0)
        layout.addStretch()
        self.setLayout(layout)

        self.group_toggle_fn = lambda: None 
开发者ID:Denvi,项目名称:FlatCAM,代码行数:33,代码来源:GUIElements.py

示例6: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def __init__(self, parent = None):
            super(ProductionGui.GuestImageDialog, self).__init__(parent)
            
            # Get the list of available sensors
            self.radioNames = miscUtilities.getDefinedSensorNames()
            if not self.radioNames:
                raise Exception('Could not load any sensors!')
            # Set up sensor selection buttons
            self.radioButtons = []
            for name in self.radioNames:
                self.radioButtons.append(QtGui.QRadioButton(name))
            self.radioButtons[0].setChecked(True)
            
            # Set up the other controls
            self.lineIn       = QtGui.QLineEdit("Asset ID")
            self.okButton     = QtGui.QPushButton('Ok',     self)
            self.cancelButton = QtGui.QPushButton('Cancel', self)            
            self.okButton.clicked.connect(self.accept)
            self.cancelButton.clicked.connect(self.reject)
            
            # Lay everything out
            vbox = QtGui.QVBoxLayout(self)
            vbox.addWidget(self.lineIn)
            for button in self.radioButtons:
               vbox.addWidget(button)
            vbox.addWidget(self.okButton)
            vbox.addWidget(self.cancelButton)
            vbox.addStretch(1) 
开发者ID:nasa,项目名称:CrisisMappingToolkit,代码行数:30,代码来源:production_gui.py

示例7: __init__

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def __init__(self):
        super(NikeSetting, self).__init__()
        self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.setWindowTitle("可选设置")
        self.setGeometry(250, 250, 250, 200)
        self.setFixedSize(250, 200)

        self.label_mail = QtGui.QLabel("加入购物车后发送邮件", self)
        self.label_mail.setGeometry(20, 20, 50, 20)

        self.rb_mail = QtGui.QRadioButton(self)
        self.rb_mail.setGeometry(75, 20, 15, 20)

        self.text_mail = QtGui.QLineEdit(self)
        self.text_mail.setText('859905874@qq.com')

        self.label_size = QtGui.QLabel("默认尺码", self)
        self.label_size.setGeometry(20, 45, 50, 20)
        self.text_sizes = QtGui.QLineEdit(self)
        self.text_sizes.setGeometry(75, 45, 100, 20)

        self.label_pay_in_qrcode = QtGui.QLabel('二维码付款', self)
        self.rb_pay_in_qrcode = QtGui.QRadioButton(self)

        self.button = QtGui.QPushButton('确定', self)
        self.button.setGeometry(160, 150, 80, 40) 
开发者ID:nikan1996,项目名称:nike_purchase_system,代码行数:28,代码来源:mainwindow.py

示例8: createCLSoptGroup

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def createCLSoptGroup(self):
        self.clsgroupBox = QtGui.QGroupBox("& CLS options")
        #self.single_label_rb = QtGui.QRadioButton("single label")
        #self.multi_label_rb = QtGui.QRadioButton("multi label")
        vbox = QtGui.QVBoxLayout()
        #vbox.addWidget(self.single_label_rb)
        #vbox.addWidget(self.multi_label_rb)
        vbox.addStretch(True)
        self.clsgroupBox.setLayout(vbox)
        return self.clsgroupBox 
开发者ID:lzx1413,项目名称:LabelImgTool,代码行数:12,代码来源:settingDialog.py

示例9: createBRUoptGroup

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def createBRUoptGroup(self):
        self.brugroupBox = QtGui.QGroupBox("& Brush options")
        #self.single_label_rb = QtGui.QRadioButton("single label")
        #self.multi_label_rb = QtGui.QRadioButton("multi label")
        vbox = QtGui.QVBoxLayout()
        #vbox.addWidget(self.single_label_rb)
        #vbox.addWidget(self.multi_label_rb)
        vbox.addStretch(True)
        self.brugroupBox.setLayout(vbox)
        return self.brugroupBox 
开发者ID:lzx1413,项目名称:LabelImgTool,代码行数:12,代码来源:settingDialog.py

示例10: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def setupUi(self, Dialog):
        Dialog.setObjectName(_fromUtf8("Dialog"))
        Dialog.resize(534, 310)
        self.dial = QtGui.QDial(Dialog)
        self.dial.setGeometry(QtCore.QRect(120, -10, 311, 261))
        self.dial.setMaximum(100)
        self.dial.setObjectName(_fromUtf8("dial"))
        self.lcdNumber = QtGui.QLCDNumber(Dialog)
        self.lcdNumber.setGeometry(QtCore.QRect(10, 250, 71, 41))
        self.lcdNumber.setAutoFillBackground(False)
        self.lcdNumber.setFrameShape(QtGui.QFrame.StyledPanel)
        self.lcdNumber.setFrameShadow(QtGui.QFrame.Raised)
        self.lcdNumber.setDigitCount(3)
        self.lcdNumber.setSegmentStyle(QtGui.QLCDNumber.Filled)
        self.lcdNumber.setObjectName(_fromUtf8("lcdNumber"))
        self.progressBar = QtGui.QProgressBar(Dialog)
        self.progressBar.setGeometry(QtCore.QRect(90, 250, 441, 41))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName(_fromUtf8("progressBar"))
        self.groupBox = QtGui.QGroupBox(Dialog)
        self.groupBox.setGeometry(QtCore.QRect(10, 160, 71, 80))
        self.groupBox.setObjectName(_fromUtf8("groupBox"))
        self.CWButton = QtGui.QRadioButton(self.groupBox)
        self.CWButton.setGeometry(QtCore.QRect(10, 20, 82, 17))
        self.CWButton.setChecked(True)
        self.CWButton.setObjectName(_fromUtf8("CWButton"))
        self.CCWButton = QtGui.QRadioButton(self.groupBox)
        self.CCWButton.setGeometry(QtCore.QRect(10, 40, 81, 31))
        self.CCWButton.setObjectName(_fromUtf8("CCWButton"))

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
开发者ID:reza-arjmandi,项目名称:rpi-course,代码行数:34,代码来源:MotorControlModernUi.py

示例11: flipOptions

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def flipOptions(self):
        groupBox = QtGui.QGroupBox("Tablet Orientation")
        groupBox.setAlignment(QtCore.Qt.AlignHCenter)
        groupBox.setFixedHeight(120)
        self.tabletFlipGroup = QtGui.QButtonGroup(groupBox)
        self.tabletRight = QtGui.QRadioButton("Right-Handed")
        self.tabletLeft = QtGui.QRadioButton("Left-Handed")
        self.tabletFlipGroup.addButton(self.tabletRight)
        self.tabletFlipGroup.addButton(self.tabletLeft)
        flipLayout = QtGui.QVBoxLayout()
        flipLayout.addWidget(self.tabletRight)
        flipLayout.addWidget(self.tabletLeft)
        flipLayout.addStretch(1)
        getCommand = os.popen("xsetwacom --get \"%s stylus\" Rotate" % self.tabletStylus).readlines()
        # check correct button for orientation
        if getCommand[0] == "none\n":
            self.orient = "xsetwacom --set \"%s stylus\" Rotate none" % self.tabletStylus
            self.orient += "\nxsetwacom --set \"%s eraser\" Rotate none" % self.tabletEraser
            self.tabletRight.setChecked(1)
        elif getCommand[0] == "half\n":
            self.orient = "xsetwacom --set \"%s stylus\" Rotate half" % self.tabletStylus
            self.orient += "\nxsetwacom --set \"%s eraser\" Rotate half" % self.tabletEraser
            self.tabletLeft.setChecked(1)
        self.tabletFlipGroup.buttonClicked.connect(self.tabletFlipChange)
        groupBox.setLayout(flipLayout)
        return groupBox 
开发者ID:tb2097,项目名称:wacom-gui,代码行数:28,代码来源:options.py

示例12: initUI

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def initUI(self):

        # Button to search the document for something
        findButton = QtGui.QPushButton("Find",self)
        findButton.clicked.connect(self.find)

        # Button to replace the last finding
        replaceButton = QtGui.QPushButton("Replace",self)
        replaceButton.clicked.connect(self.replace)

        # Button to remove all findings
        allButton = QtGui.QPushButton("Replace all",self)
        allButton.clicked.connect(self.replaceAll)

        # Normal mode - radio button
        self.normalRadio = QtGui.QRadioButton("Normal",self)

        # Regular Expression Mode - radio button
        regexRadio = QtGui.QRadioButton("RegEx",self)

        # The field into which to type the query
        self.findField = QtGui.QTextEdit(self)
        self.findField.resize(250,50)

        # The field into which to type the text to replace the
        # queried text
        self.replaceField = QtGui.QTextEdit(self)
        self.replaceField.resize(250,50)
        
        layout = QtGui.QGridLayout()

        layout.addWidget(self.findField,1,0,1,4)
        layout.addWidget(self.normalRadio,2,2)
        layout.addWidget(regexRadio,2,3)
        layout.addWidget(findButton,2,0,1,2)
        
        layout.addWidget(self.replaceField,3,0,1,4)
        layout.addWidget(replaceButton,4,0,1,2)
        layout.addWidget(allButton,4,2,1,2)

        self.setGeometry(300,300,360,250)
        self.setWindowTitle("Find and Replace")
        self.setLayout(layout)

        # By default the normal mode is activated
        self.normalRadio.setChecked(True) 
开发者ID:goldsborough,项目名称:Writer,代码行数:48,代码来源:find.py

示例13: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def setupUi(self, frmComposerDataSource):
        frmComposerDataSource.setObjectName(_fromUtf8("frmComposerDataSource"))
        frmComposerDataSource.resize(380, 168)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(frmComposerDataSource.sizePolicy().hasHeightForWidth())
        frmComposerDataSource.setSizePolicy(sizePolicy)
        frmComposerDataSource.setMaximumSize(QtCore.QSize(16777215, 170))
        self.gridLayout = QtGui.QGridLayout(frmComposerDataSource)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.label_3 = QtGui.QLabel(frmComposerDataSource)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 2)
        self.label_2 = QtGui.QLabel(frmComposerDataSource)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setMaximumSize(QtCore.QSize(16777215, 100))
        self.label_2.setFrameShape(QtGui.QFrame.NoFrame)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 2)
        self.label = QtGui.QLabel(frmComposerDataSource)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setStyleSheet(_fromUtf8("padding: 2px; font-weight: bold; background-color: rgb(200, 200, 200);"))
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 2)
        self.rbViews = QtGui.QRadioButton(frmComposerDataSource)
        self.rbViews.setObjectName(_fromUtf8("rbViews"))
        self.gridLayout.addWidget(self.rbViews, 3, 1, 1, 1)
        self.cboDataSource = QtGui.QComboBox(frmComposerDataSource)
        self.cboDataSource.setMinimumSize(QtCore.QSize(0, 30))
        self.cboDataSource.setObjectName(_fromUtf8("cboDataSource"))
        self.gridLayout.addWidget(self.cboDataSource, 2, 0, 1, 2)
        self.rbTables = QtGui.QRadioButton(frmComposerDataSource)
        self.rbTables.setObjectName(_fromUtf8("rbTables"))
        self.gridLayout.addWidget(self.rbTables, 3, 0, 1, 1)
        self.cboReferencedTable = QtGui.QComboBox(frmComposerDataSource)
        self.cboReferencedTable.setMinimumSize(QtCore.QSize(0, 30))
        self.cboReferencedTable.setObjectName(_fromUtf8("cboReferencedTable"))
        self.gridLayout.addWidget(self.cboReferencedTable, 5, 0, 1, 2)

        self.retranslateUi(frmComposerDataSource)
        QtCore.QMetaObject.connectSlotsByName(frmComposerDataSource) 
开发者ID:gltn,项目名称:stdm,代码行数:53,代码来源:ui_composer_data_source.py

示例14: setupUi

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def setupUi(self, frmComposerDataSource):
        frmComposerDataSource.setObjectName(_fromUtf8("frmComposerDataSource"))
        frmComposerDataSource.resize(380, 130)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(frmComposerDataSource.sizePolicy().hasHeightForWidth())
        frmComposerDataSource.setSizePolicy(sizePolicy)
        frmComposerDataSource.setMaximumSize(QtCore.QSize(16777215, 130))
        self.gridLayout = QtGui.QGridLayout(frmComposerDataSource)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.label = QtGui.QLabel(frmComposerDataSource)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setStyleSheet(_fromUtf8("padding: 2px; font-weight: bold; background-color: rgb(200, 200, 200);"))
        self.label.setObjectName(_fromUtf8("label"))
        self.gridLayout.addWidget(self.label, 0, 0, 1, 2)
        self.label_2 = QtGui.QLabel(frmComposerDataSource)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setMaximumSize(QtCore.QSize(16777215, 100))
        self.label_2.setFrameShape(QtGui.QFrame.NoFrame)
        self.label_2.setWordWrap(True)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 2)
        self.cboDataSource = QtGui.QComboBox(frmComposerDataSource)
        self.cboDataSource.setMinimumSize(QtCore.QSize(0, 30))
        self.cboDataSource.setObjectName(_fromUtf8("cboDataSource"))
        self.gridLayout.addWidget(self.cboDataSource, 2, 0, 1, 2)
        self.rbTables = QtGui.QRadioButton(frmComposerDataSource)
        self.rbTables.setObjectName(_fromUtf8("rbTables"))
        self.gridLayout.addWidget(self.rbTables, 3, 0, 1, 1)
        self.rbViews = QtGui.QRadioButton(frmComposerDataSource)
        self.rbViews.setObjectName(_fromUtf8("rbViews"))
        self.gridLayout.addWidget(self.rbViews, 3, 1, 1, 1)

        self.retranslateUi(frmComposerDataSource)
        QtCore.QMetaObject.connectSlotsByName(frmComposerDataSource) 
开发者ID:gltn,项目名称:stdm,代码行数:46,代码来源:ui_composer_data_source.py

示例15: penSettings

# 需要导入模块: from PyQt4 import QtGui [as 别名]
# 或者: from PyQt4.QtGui import QRadioButton [as 别名]
def penSettings(self):
        groupBox = QtGui.QGroupBox("Mode")
        groupBox.setAlignment(QtCore.Qt.AlignCenter)
        self.penGroup = QtGui.QButtonGroup(groupBox)
        self.penAbs = QtGui.QRadioButton("Absolute")
        self.penAbs.setToolTip("%s maps 1:1 to mapped input area." % self.sensor.title())
        self.penRel = QtGui.QRadioButton("Relative")
        self.penRel.setToolTip("%s moves relative to when it is detected." % self.sensor.title())

        self.penGroup.addButton(self.penAbs)
        self.penGroup.addButton(self.penRel)
        
        penLayout = QtGui.QHBoxLayout()
        penLayout.addWidget(self.penAbs)
        penLayout.addWidget(self.penRel)
        penLayout.addStretch(1)

        #if self.sensor == 'stylus' or self.sensor == 'eraser':
        getCommand = os.popen("xsetwacom --get \"%s %s\" Mode" % (self.tabletName, self.sensor.lower())).readlines()
        #check stylus mode
        if getCommand[0] == "Absolute\n":
            self.penMode = "xsetwacom --set \"%s %s\" mode Absolute" % (self.tabletName, self.sensor.lower())
            self.penAbs.setChecked(1)
        elif getCommand[0] == "Relative\n":
            self.penMode = "xsetwacom --set \"%s %s\" mode Relative" % (self.tabletName, self.sensor.lower())
            self.penRel.setChecked(1)
        if self.sensor == 'stylus':
            #for buttons
            but1 = os.popen(("xsetwacom --get \"%s %s\" Button 2") % (self.tabletName, self.sensor.lower())).readlines()
            but2 = os.popen(("xsetwacom --get \"%s %s\" Button 3") % (self.tabletName, self.sensor.lower())).readlines()
            if but1[0].find('3') != -1 and but2[0].find('2') != -1:
                self.buttons.setChecked(True)
            #for tip touch check
            tip = os.popen("xsetwacom --get \"%s %s\" TabletPCButton" % (self.tabletName, self.sensor.lower())).readlines()
            if tip[0].find('on') != -1:
                self.tiptouch.setChecked(True)
        else:
            self.tiptouch.hide()

        self.penGroup.buttonClicked.connect(self.penChange)

        groupBox.setLayout(penLayout)

        return groupBox 
开发者ID:tb2097,项目名称:wacom-gui,代码行数:46,代码来源:pressure.py


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