Python matplotlib.backends.qt_compat.QtWidgets.QComboBox() Examples
The following are 18
code examples of matplotlib.backends.qt_compat.QtWidgets.QComboBox().
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 also want to check out all available functions/classes of the module
matplotlib.backends.qt_compat.QtWidgets
, or try the search function
.
Example #1
Source File: formlayout.py From twitter-stock-recommendation with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #2
Source File: _formlayout.py From Mastering-Elasticsearch-7.0 with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect( self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #3
Source File: formlayout.py From neural-network-animation with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #4
Source File: _formlayout.py From CogAlg with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect( self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #5
Source File: formlayout.py From GraphicDesignPatternByPython with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #6
Source File: formlayout.py From python3_ios with BSD 3-Clause "New" or "Revised" License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #7
Source File: formlayout.py From ImageFusion with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #8
Source File: formlayout.py From coffeegrindsize with MIT License | 6 votes |
def __init__(self, datalist, comment="", parent=None): QtWidgets.QWidget.__init__(self, parent) layout = QtWidgets.QVBoxLayout() self.setLayout(layout) self.combobox = QtWidgets.QComboBox() layout.addWidget(self.combobox) self.stackwidget = QtWidgets.QStackedWidget(self) layout.addWidget(self.stackwidget) self.combobox.currentIndexChanged.connect(self.stackwidget.setCurrentIndex) self.widgetlist = [] for data, title, comment in datalist: self.combobox.addItem(title) widget = FormWidget(data, comment=comment, parent=self) self.stackwidget.addWidget(widget) self.widgetlist.append(widget)
Example #9
Source File: formlayout.py From ImageFusion with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = list(xrange(6, 12)) + list(xrange(12, 30, 2)) + [36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #10
Source File: formlayout.py From twitter-stock-recommendation with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = list(range(6, 12)) + list(range(12, 30, 2)) + [36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #11
Source File: _formlayout.py From CogAlg with MIT License | 5 votes |
def __init__(self, data, comment="", with_margin=False, parent=None): """ Parameters ---------- data : list of (label, value) pairs The data to be edited in the form. comment : str, optional with_margin : bool, optional, default: False If False, the form elements reach to the border of the widget. This is the desired behavior if the FormWidget is used as a widget alongside with other widgets such as a QComboBox, which also do not have a margin around them. However, a margin can be desired if the FormWidget is the only widget within a container, e.g. a tab in a QTabWidget. parent : QWidget or None The parent widget. """ QtWidgets.QWidget.__init__(self, parent) self.data = copy.deepcopy(data) self.widgets = [] self.formlayout = QtWidgets.QFormLayout(self) if not with_margin: self.formlayout.setContentsMargins(0, 0, 0, 0) if comment: self.formlayout.addRow(QtWidgets.QLabel(comment)) self.formlayout.addRow(QtWidgets.QLabel(" "))
Example #12
Source File: _formlayout.py From CogAlg with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #13
Source File: formlayout.py From coffeegrindsize with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #14
Source File: _formlayout.py From Mastering-Elasticsearch-7.0 with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #15
Source File: formlayout.py From python3_ios with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #16
Source File: formlayout.py From GraphicDesignPatternByPython with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #17
Source File: formlayout.py From neural-network-animation with MIT License | 5 votes |
def __init__(self, value, parent=None): QtWidgets.QGridLayout.__init__(self) font = tuple_to_qfont(value) assert font is not None # Font family self.family = QtWidgets.QFontComboBox(parent) self.family.setCurrentFont(font) self.addWidget(self.family, 0, 0, 1, -1) # Font size self.size = QtWidgets.QComboBox(parent) self.size.setEditable(True) sizelist = list(xrange(6, 12)) + list(xrange(12, 30, 2)) + [36, 48, 72] size = font.pointSize() if size not in sizelist: sizelist.append(size) sizelist.sort() self.size.addItems([str(s) for s in sizelist]) self.size.setCurrentIndex(sizelist.index(size)) self.addWidget(self.size, 1, 0) # Italic or not self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent) self.italic.setChecked(font.italic()) self.addWidget(self.italic, 1, 1) # Bold or not self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent) self.bold.setChecked(font.bold()) self.addWidget(self.bold, 1, 2)
Example #18
Source File: _formlayout.py From Mastering-Elasticsearch-7.0 with MIT License | 5 votes |
def __init__(self, data, comment="", with_margin=False, parent=None): """ Parameters ---------- data : list of (label, value) pairs The data to be edited in the form. comment : str, optional with_margin : bool, optional, default: False If False, the form elements reach to the border of the widget. This is the desired behavior if the FormWidget is used as a widget alongside with other widgets such as a QComboBox, which also do not have a margin around them. However, a margin can be desired if the FormWidget is the only widget within a container, e.g. a tab in a QTabWidget. parent : QWidget or None The parent widget. """ QtWidgets.QWidget.__init__(self, parent) self.data = copy.deepcopy(data) self.widgets = [] self.formlayout = QtWidgets.QFormLayout(self) if not with_margin: self.formlayout.setContentsMargins(0, 0, 0, 0) if comment: self.formlayout.addRow(QtWidgets.QLabel(comment)) self.formlayout.addRow(QtWidgets.QLabel(" "))