-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added value() functions to transcription search
- Loading branch information
1 parent
bbc7ed0
commit bd3c2b5
Showing
5 changed files
with
483 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from imports import QGroupBox, QVBoxLayout, QHBoxLayout, QButtonGroup, QRadioButton | ||
|
||
class LogicRadioButtonGroup(QGroupBox): | ||
def __init__(self, direction, default, title='', **kwarg): | ||
super().__init__(title) | ||
|
||
if direction == 'vertical': | ||
buttonLayout = QVBoxLayout() | ||
else: # direction == 'horizontal' | ||
buttonLayout = QHBoxLayout() | ||
|
||
self.buttonGroup = QButtonGroup() | ||
self.setLayout(buttonLayout) | ||
|
||
for short_name, text in kwarg.items(): | ||
button = QRadioButton(text) | ||
if short_name == default: | ||
button.setChecked(True) | ||
self.buttonGroup.addButton(button) | ||
buttonLayout.addWidget(button) | ||
|
||
def setToDefault(self, default_option): | ||
for option in self.buttonGroup.buttons(): | ||
if option.text() == default_option: | ||
option.setChecked(True) | ||
else: | ||
option.setChecked(False) | ||
|
||
def value(self): | ||
checked = self.buttonGroup.checkedButton() | ||
return checked.text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.