Python PyQt5.QtWidgets.QButtonGroup() Examples

The following are 24 code examples for showing how to use PyQt5.QtWidgets.QButtonGroup(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: pyleecan   Author: Eomys   File: SidebarWindow.py    License: Apache License 2.0 5 votes vote down vote up
def __init__(self):
        # === App-Init ===
        super(SidebarWindow, self).__init__()
        self._title = "Pyleecan"
        self.setWindowTitle(self._title)
        self._main = QtWidgets.QWidget()
        self.setCentralWidget(self._main)

        # === Main Widgets ===
        # Navigation Panel with Button Group
        self.nav_panel = QtWidgets.QFrame()

        self.nav_btn_grp = QtWidgets.QButtonGroup()
        self.nav_btn_grp.setExclusive(True)
        self.nav_btn_grp.buttonClicked[int].connect(self.switch_stack)
        self.btn_grp_fct = []

        self.nav_layout = QtWidgets.QVBoxLayout(self.nav_panel)
        self.nav_layout.setContentsMargins(2, 2, 2, 2)
        self.nav_layout.addStretch(1)  # add stretch first

        # Sub Window Stack
        self.io_stack = QtWidgets.QStackedWidget(self)

        # Seperator Line
        line = QtWidgets.QFrame()
        line.setStyleSheet("QFrame { background-color: rgb(200, 200, 200) }")
        line.setFixedWidth(2)

        # === Main Layout ===
        main_layout = QtWidgets.QHBoxLayout()
        main_layout.addWidget(self.nav_panel)
        main_layout.addWidget(line)
        main_layout.addWidget(self.io_stack)

        self._main.setLayout(main_layout)

        self.show()
        self.centerOnScreen() 
Example 2
Project: DevilYuan   Author: moyuanz   File: DyStockVolatilityDistDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, name, baseDate):
        self.setWindowTitle('波动分布[{0}]'.format(name))
 
        # 控件
        forwardNTDaysLabel = QLabel('基准日期[{0}]向前N日(不包含基准日期)'.format(baseDate))
        self._forwardNTDaysLineEdit = QLineEdit('30')

        # 自身波动和绝对波动
        # 个股绝对波动 = 个股自身波动 + 大盘波动
        selfVolatilityRadioButton = QRadioButton('自身波动'); selfVolatilityRadioButton.setChecked(True)
        selfVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        absoluteVolatilityRadioButton = QRadioButton('绝对波动')
        absoluteVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        # 添加到QButtonGroup
        self._volatilityButtonGroup = QButtonGroup()
        self._volatilityButtonGroup.addButton(selfVolatilityRadioButton, 1); 
        self._volatilityButtonGroup.addButton(absoluteVolatilityRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(selfVolatilityRadioButton, 1, 0)
        grid.addWidget(absoluteVolatilityRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 3
Project: DevilYuan   Author: moyuanz   File: DyStockTableSelectDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, dlgName):
        self.setWindowTitle(dlgName)
 
        allRadioButton = QRadioButton('所有'); allRadioButton.setChecked(True)
        highlightRadioButton = QRadioButton('高亮')

        # 添加到QButtonGroup
        self._buttonGroup = QButtonGroup()
        self._buttonGroup.addButton(allRadioButton, 1); 
        self._buttonGroup.addButton(highlightRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(allRadioButton, 1, 0)
        grid.addWidget(highlightRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 4
Project: DevilYuan   Author: moyuanz   File: DyStockTableAddColumnsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, title, backward):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join([str(x) for x in self._data['days']]) if self._data else '1,2,3,4,5,10')

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后')
        if backward:
            backwardRadioButton.setChecked(True)
        else:
            forwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1)
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 5
Project: DevilYuan   Author: moyuanz   File: DyStockSelectAddColumnsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, title):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join(self._data['days']) if self._data else '1,2,3,4,5,10')

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后'); backwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1); 
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 6
Project: DevilYuan   Author: moyuanz   File: DyStockSelectSaveAsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, strategyName):
        self.setWindowTitle('[{0}]另存为'.format(strategyName))
 
        allRadioButton = QRadioButton('所有'); allRadioButton.setChecked(True)
        highlightRadioButton = QRadioButton('高亮')

        # 添加到QButtonGroup
        self._buttonGroup = QButtonGroup()
        self._buttonGroup.addButton(allRadioButton, 1); 
        self._buttonGroup.addButton(highlightRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(allRadioButton, 1, 0)
        grid.addWidget(highlightRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 7
Project: IDAtropy   Author: danigargu   File: IDAtropy.py    License: GNU General Public License v3.0 5 votes vote down vote up
def create_chart_type_group(self):
    vbox = QtWidgets.QVBoxLayout()
    self.rg_chart_type = QtWidgets.QButtonGroup()
    self.rg_chart_type.setExclusive(True)

    for i, choice in enumerate(self.config.chart_types):
      radio = QtWidgets.QRadioButton(choice)
      self.rg_chart_type.addButton(radio, i)
      if i == self.config.chart_type: 
        radio.setChecked(True)
      vbox.addWidget(radio)

    vbox.addStretch(1)
    self.rg_chart_type.buttonClicked.connect(self.bg_graph_type_changed)
    return vbox 
Example 8
Project: python101   Author: koduj-z-klasa   File: gui_z2.py    License: MIT License 5 votes vote down vote up
def setupUi(self, Widget):

        # widgety rysujące kształty, instancje klasy Ksztalt
        self.ksztalt1 = Ksztalt(self, Ksztalty.Polygon)
        self.ksztalt2 = Ksztalt(self, Ksztalty.Ellipse)
        self.ksztaltAktywny = self.ksztalt1

        # przyciski CheckBox ###
        uklad = QVBoxLayout()  # układ pionowy
        self.grupaChk = QButtonGroup()
        for i, v in enumerate(('Kwadrat', 'Koło', 'Trójkąt', 'Linia')):
            self.chk = QCheckBox(v)
            self.grupaChk.addButton(self.chk, i)
            uklad.addWidget(self.chk)
        self.grupaChk.buttons()[self.ksztaltAktywny.ksztalt].setChecked(True)
        # CheckBox do wyboru aktywnego kształtu
        self.ksztaltChk = QCheckBox('<=')
        self.ksztaltChk.setChecked(True)
        uklad.addWidget(self.ksztaltChk)

        # układ poziomy dla kształtów oraz przycisków CheckBox
        ukladH1 = QHBoxLayout()
        ukladH1.addWidget(self.ksztalt1)
        ukladH1.addLayout(uklad)
        ukladH1.addWidget(self.ksztalt2)
        # koniec CheckBox ###

        self.setLayout(ukladH1)  # przypisanie układu do okna głównego
        self.setWindowTitle('Widżety') 
Example 9
Project: DevilYuan   Author: shakenetwork   File: DyStockVolatilityDistDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, name, baseDate):
        self.setWindowTitle('波动分布[{0}]'.format(name))
 
        # 控件
        forwardNTDaysLabel = QLabel('基准日期[{0}]向前N日(不包含基准日期)'.format(baseDate))
        self._forwardNTDaysLineEdit = QLineEdit('30')

        # 自身波动和绝对波动
        # 个股绝对波动 = 个股自身波动 + 大盘波动
        selfVolatilityRadioButton = QRadioButton('自身波动'); selfVolatilityRadioButton.setChecked(True)
        selfVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        absoluteVolatilityRadioButton = QRadioButton('绝对波动')
        absoluteVolatilityRadioButton.setToolTip('个股绝对波动 = 个股自身波动 + 大盘波动')

        # 添加到QButtonGroup
        self._volatilityButtonGroup = QButtonGroup()
        self._volatilityButtonGroup.addButton(selfVolatilityRadioButton, 1); 
        self._volatilityButtonGroup.addButton(absoluteVolatilityRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(forwardNTDaysLabel, 0, 0)
        grid.addWidget(self._forwardNTDaysLineEdit, 0, 1)

        grid.addWidget(selfVolatilityRadioButton, 1, 0)
        grid.addWidget(absoluteVolatilityRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)

        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 10
Project: DevilYuan   Author: shakenetwork   File: DyStockTableSelectDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, dlgName):
        self.setWindowTitle(dlgName)
 
        allRadioButton = QRadioButton('所有'); allRadioButton.setChecked(True)
        highlightRadioButton = QRadioButton('高亮')

        # 添加到QButtonGroup
        self._buttonGroup = QButtonGroup()
        self._buttonGroup.addButton(allRadioButton, 1); 
        self._buttonGroup.addButton(highlightRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(allRadioButton, 1, 0)
        grid.addWidget(highlightRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 11
Project: DevilYuan   Author: shakenetwork   File: DyStockTableAddColumnsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, title, backward):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join([str(x) for x in self._data['days']]) if self._data else '2,3,4,5,10' )

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后');
        if backward:
            backwardRadioButton.setChecked(True)
        else:
            forwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1); 
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 12
Project: DevilYuan   Author: shakenetwork   File: DyStockSelectAddColumnsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, title):
        self.setWindowTitle('添加{0}列'.format(title))
 
        # 控件
        increaseColumnsLable = QLabel('基准日期几日{0}'.format(title))
        self._increaseColumnsLineEdit = QLineEdit(','.join(self._data['days']) if self._data else '2,3,4,5,10' )

        # 前 & 后
        forwardRadioButton = QRadioButton('向前')
        backwardRadioButton = QRadioButton('向后'); backwardRadioButton.setChecked(True)

        # 添加到QButtonGroup
        self._wardButtonGroup = QButtonGroup()
        self._wardButtonGroup.addButton(forwardRadioButton, 1); 
        self._wardButtonGroup.addButton(backwardRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(increaseColumnsLable, 0, 0, 1, 2)
        grid.addWidget(self._increaseColumnsLineEdit, 1, 0, 1, 2)

        grid.addWidget(forwardRadioButton, 2, 0)
        grid.addWidget(backwardRadioButton, 2, 1)

        grid.addWidget(okPushButton, 3, 1)
        grid.addWidget(cancelPushButton, 3, 0)
 
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 13
Project: DevilYuan   Author: shakenetwork   File: DyStockSelectSaveAsDlg.py    License: MIT License 5 votes vote down vote up
def _initUi(self, strategyName):
        self.setWindowTitle('[{0}]另存为'.format(strategyName))
 
        allRadioButton = QRadioButton('所有'); allRadioButton.setChecked(True)
        highlightRadioButton = QRadioButton('高亮')

        # 添加到QButtonGroup
        self._buttonGroup = QButtonGroup()
        self._buttonGroup.addButton(allRadioButton, 1); 
        self._buttonGroup.addButton(highlightRadioButton, 2)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(allRadioButton, 1, 0)
        grid.addWidget(highlightRadioButton, 1, 1)

        grid.addWidget(okPushButton, 2, 1)
        grid.addWidget(cancelPushButton, 2, 0)
 
        self.setLayout(grid)
        self.setMinimumWidth(QApplication.desktop().size().width()//5) 
Example 14
Project: wavelet_prosody_toolkit   Author: asuni   File: wavelet_gui.py    License: MIT License 5 votes vote down vote up
def featureCombination(self):

        groupBox = QtWidgets.QGroupBox("Feature Combination Method")

        combination_method = QtWidgets.QButtonGroup()  # Number group

        self.sum_feats = QtWidgets.QRadioButton("sum")
        self.mul_feats = QtWidgets.QRadioButton("product")

        if self.configuration["feature_combination"]["type"] == "product":
            self.mul_feats.setChecked(True)
        else:
            self.sum_feats.setChecked(True)

        combination_method.addButton(self.sum_feats)
        combination_method.addButton(self.mul_feats)
        self.sum_feats.clicked.connect(self.onSignalRate)
        self.mul_feats.clicked.connect(self.onSignalRate)
        hbox = QtWidgets.QHBoxLayout()
        hbox.addWidget(self.sum_feats)
        hbox.addWidget(self.mul_feats)
        groupBox.setLayout(hbox)
        groupBox.setVisible(True)
        return groupBox

    # reading of textgrids and lab, use previously selected tiers 
Example 15
Project: QualCoder   Author: ccbogel   File: ui_dialog_attribute_type.py    License: MIT License 5 votes vote down vote up
def setupUi(self, Dialog_attribute_type):
        Dialog_attribute_type.setObjectName("Dialog_attribute_type")
        Dialog_attribute_type.resize(400, 188)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog_attribute_type)
        self.buttonBox.setGeometry(QtCore.QRect(160, 130, 211, 32))
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.radioButton_char = QtWidgets.QRadioButton(Dialog_attribute_type)
        self.radioButton_char.setGeometry(QtCore.QRect(30, 60, 161, 22))
        self.radioButton_char.setChecked(True)
        self.radioButton_char.setObjectName("radioButton_char")
        self.buttonGroup = QtWidgets.QButtonGroup(Dialog_attribute_type)
        self.buttonGroup.setObjectName("buttonGroup")
        self.buttonGroup.addButton(self.radioButton_char)
        self.radioButton_numeric = QtWidgets.QRadioButton(Dialog_attribute_type)
        self.radioButton_numeric.setGeometry(QtCore.QRect(30, 90, 171, 22))
        self.radioButton_numeric.setObjectName("radioButton_numeric")
        self.buttonGroup.addButton(self.radioButton_numeric)
        self.label = QtWidgets.QLabel(Dialog_attribute_type)
        self.label.setGeometry(QtCore.QRect(20, 20, 241, 17))
        self.label.setObjectName("label")

        self.retranslateUi(Dialog_attribute_type)
        self.buttonBox.accepted.connect(Dialog_attribute_type.accept)
        self.buttonBox.rejected.connect(Dialog_attribute_type.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog_attribute_type) 
Example 16
Project: QualCoder   Author: ccbogel   File: ui_dialog_assign_attribute.py    License: MIT License 5 votes vote down vote up
def setupUi(self, Dialog_assignAttribute):
        Dialog_assignAttribute.setObjectName("Dialog_assignAttribute")
        Dialog_assignAttribute.resize(487, 148)
        self.radioButton_cases = QtWidgets.QRadioButton(Dialog_assignAttribute)
        self.radioButton_cases.setGeometry(QtCore.QRect(180, 19, 81, 20))
        self.radioButton_cases.setChecked(True)
        self.radioButton_cases.setObjectName("radioButton_cases")
        self.buttonGroup = QtWidgets.QButtonGroup(Dialog_assignAttribute)
        self.buttonGroup.setObjectName("buttonGroup")
        self.buttonGroup.addButton(self.radioButton_cases)
        self.radioButton_files = QtWidgets.QRadioButton(Dialog_assignAttribute)
        self.radioButton_files.setGeometry(QtCore.QRect(280, 19, 81, 20))
        self.radioButton_files.setObjectName("radioButton_files")
        self.buttonGroup.addButton(self.radioButton_files)
        self.label = QtWidgets.QLabel(Dialog_assignAttribute)
        self.label.setGeometry(QtCore.QRect(20, 20, 171, 17))
        self.label.setObjectName("label")
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog_assignAttribute)
        self.buttonBox.setGeometry(QtCore.QRect(130, 80, 221, 27))
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")

        self.retranslateUi(Dialog_assignAttribute)
        self.buttonBox.accepted.connect(Dialog_assignAttribute.accept)
        self.buttonBox.rejected.connect(Dialog_assignAttribute.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog_assignAttribute) 
Example 17
Project: screenshot   Author: SeptemberHX   File: toolbar.py    License: GNU General Public License v3.0 4 votes vote down vote up
def initDrawButtons(self, flags):
        self.drawButtonGroup = QButtonGroup(self)

        # draw action buttons
        if flags & constant.RECT:
            self.rectButton = QPushButton(self)
            self.rectButton.setIcon(QIcon(":/resource/icon/rect.png"))
            self.rectButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.rectButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.rectButton)
            self.hlayout.addWidget(self.rectButton)
            self.button_list.append(self.rectButton)

        if flags & constant.ELLIPSE:
            self.ellipseButton = QPushButton(self)
            self.ellipseButton.setIcon(QIcon(":/resource/icon/ellipse.png"))
            self.ellipseButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.ellipseButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.ellipseButton)
            self.hlayout.addWidget(self.ellipseButton)
            self.button_list.append(self.ellipseButton)

        if flags & constant.ARROW:
            self.arrowButton = QPushButton(self)
            self.arrowButton.setIcon(QIcon(":/resource/icon/arrow.png"))
            self.arrowButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.arrowButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.arrowButton)
            self.hlayout.addWidget(self.arrowButton)
            self.button_list.append(self.arrowButton)

        if flags & constant.LINE:
            self.lineButton = QPushButton(self)
            self.lineButton.setIcon(QIcon(":/resource/icon/line.png"))
            self.lineButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.lineButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.lineButton)
            self.hlayout.addWidget(self.lineButton)
            self.button_list.append(self.lineButton)

        if flags & constant.FREEPEN:
            self.freePenButton = QPushButton(self)
            self.freePenButton.setIcon(QIcon(":/resource/icon/pen.png"))
            self.freePenButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.freePenButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.freePenButton)
            self.hlayout.addWidget(self.freePenButton)
            self.button_list.append(self.freePenButton)

        if flags & constant.TEXT:
            self.textButton = QPushButton(self)
            self.textButton.setIcon(QIcon(":/resource/icon/text.png"))
            self.textButton.setFixedSize(self.iconWidth, self.iconHeight)
            self.textButton.setCheckable(True)
            self.drawButtonGroup.addButton(self.textButton)
            self.hlayout.addWidget(self.textButton)
            self.button_list.append(self.textButton)

        self.drawButtonGroup.buttonClicked.connect(self.buttonToggled) 
Example 18
Project: DevilYuan   Author: moyuanz   File: DyStockSelectIndexMaKChartStatsDlg.py    License: MIT License 4 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('指数均线K线图统计')
 
        # 控件
        startDateLable = QLabel('开始日期')
        self._startDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        endDateLable = QLabel('结束日期')
        self._endDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        # 指数和股票代码
        shIndexRadioButton = QRadioButton('上证指数'); shIndexRadioButton.setChecked(True)
        szIndexRadioButton = QRadioButton('深证成指')
        cybIndexRadioButton = QRadioButton('创业板指')
        zxbIndexRadioButton = QRadioButton('中小板指')

        hs300IndexRadioButton = QRadioButton('沪深300')
        zz500IndexRadioButton = QRadioButton('中证500')

        # 添加到QButtonGroup
        self._stocksButtonGroup = QButtonGroup()
        self._stocksButtonGroup.addButton(shIndexRadioButton, 1); 
        self._stocksButtonGroup.addButton(szIndexRadioButton, 2)
        self._stocksButtonGroup.addButton(cybIndexRadioButton, 3)
        self._stocksButtonGroup.addButton(zxbIndexRadioButton, 4)

        self._stocksButtonGroup.addButton(hs300IndexRadioButton, 4)
        self._stocksButtonGroup.addButton(zz500IndexRadioButton, 4)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(startDateLable, 0, 0)
        grid.addWidget(self._startDateLineEdit, 1, 0)

        grid.addWidget(endDateLable, 0, 1)
        grid.addWidget(self._endDateLineEdit, 1, 1)

        grid.addWidget(shIndexRadioButton, 2, 0)
        grid.addWidget(szIndexRadioButton, 2, 1)
        grid.addWidget(cybIndexRadioButton, 3, 0)
        grid.addWidget(zxbIndexRadioButton, 3, 1)

        grid.addWidget(hs300IndexRadioButton, 4, 0)
        grid.addWidget(zz500IndexRadioButton, 4, 1)

        grid.addWidget(okPushButton, 5, 1)
        grid.addWidget(cancelPushButton, 5, 0)
 
        self.setLayout(grid) 
Example 19
Project: nanovna-saver   Author: NanoVNA-Saver   File: SimplePeakSearchAnalysis.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, app):
        super().__init__(app)
        self._widget = QtWidgets.QWidget()
        outer_layout = QtWidgets.QFormLayout()
        self._widget.setLayout(outer_layout)

        self.rbtn_data_group = QtWidgets.QButtonGroup()
        self.rbtn_data_vswr = QtWidgets.QRadioButton("VSWR")
        self.rbtn_data_resistance = QtWidgets.QRadioButton("Resistance")
        self.rbtn_data_reactance = QtWidgets.QRadioButton("Reactance")
        self.rbtn_data_s21_gain = QtWidgets.QRadioButton("S21 Gain")
        self.rbtn_data_group.addButton(self.rbtn_data_vswr)
        self.rbtn_data_group.addButton(self.rbtn_data_resistance)
        self.rbtn_data_group.addButton(self.rbtn_data_reactance)
        self.rbtn_data_group.addButton(self.rbtn_data_s21_gain)

        self.rbtn_data_s21_gain.setChecked(True)

        self.rbtn_peak_group = QtWidgets.QButtonGroup()
        self.rbtn_peak_positive = QtWidgets.QRadioButton("Highest value")
        self.rbtn_peak_negative = QtWidgets.QRadioButton("Lowest value")
        self.rbtn_peak_group.addButton(self.rbtn_peak_positive)
        self.rbtn_peak_group.addButton(self.rbtn_peak_negative)

        self.rbtn_peak_positive.setChecked(True)

        self.checkbox_move_marker = QtWidgets.QCheckBox()

        outer_layout.addRow(QtWidgets.QLabel("<b>Settings</b>"))
        outer_layout.addRow("Data source", self.rbtn_data_vswr)
        outer_layout.addRow("", self.rbtn_data_resistance)
        outer_layout.addRow("", self.rbtn_data_reactance)
        outer_layout.addRow("", self.rbtn_data_s21_gain)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())
        outer_layout.addRow("Peak type", self.rbtn_peak_positive)
        outer_layout.addRow("", self.rbtn_peak_negative)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())
        outer_layout.addRow("Move marker to peak", self.checkbox_move_marker)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())

        outer_layout.addRow(QtWidgets.QLabel("<b>Results</b>"))

        self.peak_frequency = QtWidgets.QLabel()
        self.peak_value = QtWidgets.QLabel()

        outer_layout.addRow("Peak frequency:", self.peak_frequency)
        outer_layout.addRow("Peak value:", self.peak_value) 
Example 20
Project: nanovna-saver   Author: NanoVNA-Saver   File: PeakSearchAnalysis.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, app):
        super().__init__(app)

        self._widget = QtWidgets.QWidget()
        outer_layout = QtWidgets.QFormLayout()
        self._widget.setLayout(outer_layout)

        self.rbtn_data_group = QtWidgets.QButtonGroup()
        self.rbtn_data_vswr = QtWidgets.QRadioButton("VSWR")
        self.rbtn_data_resistance = QtWidgets.QRadioButton("Resistance")
        self.rbtn_data_reactance = QtWidgets.QRadioButton("Reactance")
        self.rbtn_data_s21_gain = QtWidgets.QRadioButton("S21 Gain")
        self.rbtn_data_group.addButton(self.rbtn_data_vswr)
        self.rbtn_data_group.addButton(self.rbtn_data_resistance)
        self.rbtn_data_group.addButton(self.rbtn_data_reactance)
        self.rbtn_data_group.addButton(self.rbtn_data_s21_gain)

        self.rbtn_data_vswr.setChecked(True)

        self.rbtn_peak_group = QtWidgets.QButtonGroup()
        self.rbtn_peak_positive = QtWidgets.QRadioButton("Positive")
        self.rbtn_peak_negative = QtWidgets.QRadioButton("Negative")
        self.rbtn_peak_both = QtWidgets.QRadioButton("Both")
        self.rbtn_peak_group.addButton(self.rbtn_peak_positive)
        self.rbtn_peak_group.addButton(self.rbtn_peak_negative)
        self.rbtn_peak_group.addButton(self.rbtn_peak_both)

        self.rbtn_peak_positive.setChecked(True)

        self.input_number_of_peaks = QtWidgets.QSpinBox()
        self.input_number_of_peaks.setValue(1)
        self.input_number_of_peaks.setMinimum(1)
        self.input_number_of_peaks.setMaximum(10)

        self.checkbox_move_markers = QtWidgets.QCheckBox()

        outer_layout.addRow(QtWidgets.QLabel("<b>Settings</b>"))
        outer_layout.addRow("Data source", self.rbtn_data_vswr)
        outer_layout.addRow("", self.rbtn_data_resistance)
        outer_layout.addRow("", self.rbtn_data_reactance)
        outer_layout.addRow("", self.rbtn_data_s21_gain)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())
        outer_layout.addRow("Peak type", self.rbtn_peak_positive)
        outer_layout.addRow("", self.rbtn_peak_negative)
        # outer_layout.addRow("", self.rbtn_peak_both)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())
        outer_layout.addRow("Max number of peaks", self.input_number_of_peaks)
        outer_layout.addRow("Move markers", self.checkbox_move_markers)
        outer_layout.addRow(PeakSearchAnalysis.QHLine())

        outer_layout.addRow(QtWidgets.QLabel("<b>Results</b>")) 
Example 21
Project: legion   Author: GoVanguard   File: dialogs.py    License: GNU General Public License v3.0 4 votes vote down vote up
def setupLayoutHlayout2(self):
        self.singleUserRadio = QtWidgets.QRadioButton()
        self.label4 = QtWidgets.QLabel()
        self.label4.setText('Username')
        self.label4.setFixedWidth(70)
        self.usersTextinput = QtWidgets.QLineEdit()
        self.usersTextinput.setFixedWidth(125)
        self.usersTextinput.setText(self.settings.brute_default_username)
        self.userListRadio = QtWidgets.QRadioButton()
        self.label5 = QtWidgets.QLabel()
        self.label5.setText('Username list')
        self.label5.setFixedWidth(90)
        self.userlistTextinput = QtWidgets.QLineEdit()
        self.userlistTextinput.setFixedWidth(125)
        self.browseUsersButton = QPushButton('Browse')
        self.browseUsersButton.setMaximumSize(80, 30)
        
        self.foundUsersRadio = QtWidgets.QRadioButton()
        self.label9 = QtWidgets.QLabel()
        self.label9.setText('Found usernames')
        self.label9.setFixedWidth(117)
        
        self.userGroup = QtWidgets.QButtonGroup()
        self.userGroup.addButton(self.singleUserRadio)
        self.userGroup.addButton(self.userListRadio)
        self.userGroup.addButton(self.foundUsersRadio)
        self.foundUsersRadio.toggle()

        self.warningLabel = QtWidgets.QLabel()
        self.warningLabel.setText('*Note: when using form-based services from the Service menu, select the \
            "Additional Options" checkbox and add the proper arguments for the webpage form. See Hydra \
            documentation for extra help when targeting HTTP/HTTPS forms.')
        self.warningLabel.setWordWrap(True)
        self.warningLabel.setAlignment(Qt.AlignRight)
        self.warningLabel.setStyleSheet('QLabel { color: red }')

        self.hlayout2 = QtWidgets.QHBoxLayout()
        self.hlayout2.addWidget(self.singleUserRadio)
        self.hlayout2.addWidget(self.label4)
        self.hlayout2.addWidget(self.usersTextinput)
        self.hlayout2.addWidget(self.userListRadio)
        self.hlayout2.addWidget(self.label5)
        self.hlayout2.addWidget(self.userlistTextinput)
        self.hlayout2.addWidget(self.browseUsersButton)
        self.hlayout2.addWidget(self.foundUsersRadio)
        self.hlayout2.addWidget(self.label9)
        self.hlayout2.addWidget(self.warningLabel)
        self.warningLabel.hide()
        self.hlayout2.addStretch()

        return self.hlayout2 
Example 22
Project: legion   Author: GoVanguard   File: dialogs.py    License: GNU General Public License v3.0 4 votes vote down vote up
def setupLayoutHlayout3(self):
        #add usernames wordlist
        self.singlePassRadio = QtWidgets.QRadioButton()
        self.label6 = QtWidgets.QLabel()
        self.label6.setText('Password')
        self.label6.setFixedWidth(70)
        self.passwordsTextinput = QtWidgets.QLineEdit()
        self.passwordsTextinput.setFixedWidth(125)
        self.passwordsTextinput.setText(self.settings.brute_default_password)
        self.passListRadio = QtWidgets.QRadioButton()
        self.label7 = QtWidgets.QLabel()
        self.label7.setText('Password list')
        self.label7.setFixedWidth(90)
        self.passlistTextinput = QtWidgets.QLineEdit()
        self.passlistTextinput.setFixedWidth(125)
        self.browsePasswordsButton = QPushButton('Browse')
        self.browsePasswordsButton.setMaximumSize(80, 30)
        
        self.foundPasswordsRadio = QtWidgets.QRadioButton()
        self.label10 = QtWidgets.QLabel()
        self.label10.setText('Found passwords')
        self.label10.setFixedWidth(115)
        
        self.passGroup = QtWidgets.QButtonGroup()
        self.passGroup.addButton(self.singlePassRadio)
        self.passGroup.addButton(self.passListRadio)
        self.passGroup.addButton(self.foundPasswordsRadio)
        self.foundPasswordsRadio.toggle()

        self.label8 = QtWidgets.QLabel()
        self.label8.setText('Threads')
        self.label8.setFixedWidth(60)
        self.threadOptions = []
        for i in range(1, 129):
            self.threadOptions.append(str(i))
        self.threadsComboBox = QtWidgets.QComboBox()
        self.threadsComboBox.insertItems(0, self.threadOptions)
        self.threadsComboBox.setMinimumContentsLength(3)
        self.threadsComboBox.setMaxVisibleItems(3)
        self.threadsComboBox.setStyleSheet("QComboBox { combobox-popup: 0; }")
        self.threadsComboBox.setCurrentIndex(15)
    
        self.hlayout3 = QtWidgets.QHBoxLayout()
        self.hlayout3.addWidget(self.singlePassRadio)
        self.hlayout3.addWidget(self.label6)
        self.hlayout3.addWidget(self.passwordsTextinput)
        self.hlayout3.addWidget(self.passListRadio)
        self.hlayout3.addWidget(self.label7)
        self.hlayout3.addWidget(self.passlistTextinput)
        self.hlayout3.addWidget(self.browsePasswordsButton)
        self.hlayout3.addWidget(self.foundPasswordsRadio)
        self.hlayout3.addWidget(self.label10)
        self.hlayout3.addStretch()
        self.hlayout3.addWidget(self.label8)
        self.hlayout3.addWidget(self.threadsComboBox)
        #self.hlayout3.addStretch()

        return self.hlayout3 
Example 23
Project: DevilYuan   Author: shakenetwork   File: DyStockSelectIndexMaKChartStatsDlg.py    License: MIT License 4 votes vote down vote up
def _initUi(self):
        self.setWindowTitle('指数均线K线图统计')
 
        # 控件
        startDateLable = QLabel('开始日期')
        self._startDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        endDateLable = QLabel('结束日期')
        self._endDateLineEdit = QLineEdit(datetime.now().strftime("%Y-%m-%d"))

        # 指数和股票代码
        shIndexRadioButton = QRadioButton('上证指数'); shIndexRadioButton.setChecked(True)
        szIndexRadioButton = QRadioButton('深证成指')
        cybIndexRadioButton = QRadioButton('创业板指')
        zxbIndexRadioButton = QRadioButton('中小板指')

        hs300IndexRadioButton = QRadioButton('沪深300')
        zz500IndexRadioButton = QRadioButton('中证500')

        # 添加到QButtonGroup
        self._stocksButtonGroup = QButtonGroup()
        self._stocksButtonGroup.addButton(shIndexRadioButton, 1); 
        self._stocksButtonGroup.addButton(szIndexRadioButton, 2)
        self._stocksButtonGroup.addButton(cybIndexRadioButton, 3)
        self._stocksButtonGroup.addButton(zxbIndexRadioButton, 4)

        self._stocksButtonGroup.addButton(hs300IndexRadioButton, 4)
        self._stocksButtonGroup.addButton(zz500IndexRadioButton, 4)

        cancelPushButton = QPushButton('Cancel')
        okPushButton = QPushButton('OK')
        cancelPushButton.clicked.connect(self._cancel)
        okPushButton.clicked.connect(self._ok)

        # 布局
        grid = QGridLayout()
        grid.setSpacing(10)
 
        grid.addWidget(startDateLable, 0, 0)
        grid.addWidget(self._startDateLineEdit, 1, 0)

        grid.addWidget(endDateLable, 0, 1)
        grid.addWidget(self._endDateLineEdit, 1, 1)

        grid.addWidget(shIndexRadioButton, 2, 0)
        grid.addWidget(szIndexRadioButton, 2, 1)
        grid.addWidget(cybIndexRadioButton, 3, 0)
        grid.addWidget(zxbIndexRadioButton, 3, 1)

        grid.addWidget(hs300IndexRadioButton, 4, 0)
        grid.addWidget(zz500IndexRadioButton, 4, 1)

        grid.addWidget(okPushButton, 5, 1)
        grid.addWidget(cancelPushButton, 5, 0)
 
        self.setLayout(grid) 
Example 24
Project: flare-ida   Author: fireeye   File: struct_typer_widget.py    License: Apache License 2.0 4 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(502, 364)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.rb_useStackFrame = QtWidgets.QRadioButton(Dialog)
        self.rb_useStackFrame.setObjectName("rb_useStackFrame")
        self.buttonGroup = QtWidgets.QButtonGroup(Dialog)
        self.buttonGroup.setObjectName("buttonGroup")
        self.buttonGroup.addButton(self.rb_useStackFrame)
        self.verticalLayout.addWidget(self.rb_useStackFrame)
        self.rb_useStruct = QtWidgets.QRadioButton(Dialog)
        self.rb_useStruct.setChecked(True)
        self.rb_useStruct.setObjectName("rb_useStruct")
        self.buttonGroup.addButton(self.rb_useStruct)
        self.verticalLayout.addWidget(self.rb_useStruct)
        self.listWidget = QtWidgets.QListWidget(Dialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
        self.listWidget.setSizePolicy(sizePolicy)
        self.listWidget.setObjectName("listWidget")
        self.verticalLayout.addWidget(self.listWidget)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.checkBox = QtWidgets.QCheckBox(Dialog)
        self.checkBox.setObjectName("checkBox")
        self.horizontalLayout.addWidget(self.checkBox)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.lineEdit = QtWidgets.QLineEdit(Dialog)
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout.addWidget(self.lineEdit)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(Dialog)

        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)

        QtCore.QMetaObject.connectSlotsByName(Dialog)