本文整理匯總了Python中PyQt4.QtGui.QFontComboBox.setFixedWidth方法的典型用法代碼示例。如果您正苦於以下問題:Python QFontComboBox.setFixedWidth方法的具體用法?Python QFontComboBox.setFixedWidth怎麽用?Python QFontComboBox.setFixedWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt4.QtGui.QFontComboBox
的用法示例。
在下文中一共展示了QFontComboBox.setFixedWidth方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GeneralSection
# 需要導入模塊: from PyQt4.QtGui import QFontComboBox [as 別名]
# 或者: from PyQt4.QtGui.QFontComboBox import setFixedWidth [as 別名]
class GeneralSection(QWidget):
""" Clase Configuracion Editor """
def __init__(self):
super(GeneralSection, self).__init__()
main_container = QVBoxLayout(self)
# Tabs and indentation
group_indentation = QGroupBox(self.tr("Indentación y Tabs:"))
box = QGridLayout(group_indentation)
box.setContentsMargins(20, 5, 20, 5)
box.addWidget(QLabel(self.tr("Política:")), 0, 0)
self.combo_tabs = QComboBox()
self.combo_tabs.setFixedWidth(350)
self.combo_tabs.addItems([
self.tr("Solo Espacios"),
self.tr("Solo Tabulaciones"),
])
box.addWidget(self.combo_tabs, 0, 1)
self.combo_tabs.setCurrentIndex(
int(settings.get_setting('editor/usetabs')))
# Auto indent
self.check_autoindent = QCheckBox(self.tr("Indentación Automática"))
box.addWidget(self.check_autoindent, 1, 0)
box.setAlignment(Qt.AlignLeft)
self.check_autoindent.setChecked(settings.get_setting('editor/indent'))
# Minimap
group_minimap = QGroupBox(self.tr("Minimapa:"))
box = QGridLayout(group_minimap)
box.setContentsMargins(20, 5, 20, 5)
self.check_minimap = QCheckBox(
self.tr("Activar Minimapa (requiere reiniciar el Editor)"))
self.check_minimap.setChecked(settings.get_setting('editor/minimap'))
box.addWidget(self.check_minimap, 0, 0)
#self.check_minimap_animation = QCheckBox(self.tr("Enable animation"))
#self.check_minimap_animation.setChecked(
#settings.get_setting('editor/minimap-animation'))
#box.addWidget(self.check_minimap_animation, 1, 0)
#box.addWidget(QLabel(self.tr("Size Area:")), 2, 0)
#self.spin_area_minimap = QSpinBox()
#self.spin_area_minimap.setFixedWidth(350)
#box.addWidget(self.spin_area_minimap, 2, 1)
box.setAlignment(Qt.AlignLeft)
# Cursor
group_caret = QGroupBox(self.tr("Cursor:"))
box = QGridLayout(group_caret)
box.setContentsMargins(20, 5, 20, 5)
box.setAlignment(Qt.AlignLeft)
# Type
box.addWidget(QLabel(self.tr("Tipo:")), 0, 0)
self.combo_caret = QComboBox()
self.combo_caret.setFixedWidth(300)
caret_types = [
self.tr('Invisible'),
self.tr('Línea'),
self.tr('Bloque')
]
self.combo_caret.addItems(caret_types)
index = settings.get_setting('editor/cursor')
self.combo_caret.setCurrentIndex(index)
box.addWidget(self.combo_caret, 0, 1)
# Width
box.addWidget(QLabel(self.tr("Ancho:")), 1, 0)
self.spin_caret_width = QSpinBox()
self.spin_caret_width.setFixedWidth(300)
if index != 1:
self.spin_caret_width.setEnabled(False)
self.spin_caret_width.setRange(1, 3)
self.spin_caret_width.setValue(
settings.get_setting('editor/caret-width'))
box.addWidget(self.spin_caret_width, 1, 1, Qt.AlignLeft)
# Period
box.addWidget(QLabel(self.tr("Período (ms):")), 2, 0)
self.slider_caret_period = QSlider(Qt.Horizontal)
self.slider_caret_period.setMaximum(500)
self.slider_caret_period.setFixedWidth(300)
box.addWidget(self.slider_caret_period, 2, 1, Qt.AlignLeft)
lcd_caret = QLCDNumber()
lcd_caret.setSegmentStyle(QLCDNumber.Flat)
box.addWidget(lcd_caret, 2, 3)
# Font
group_typo = QGroupBox(self.tr("Fuente:"))
box = QGridLayout(group_typo)
box.setContentsMargins(20, 5, 20, 5)
box.addWidget(QLabel(self.tr("Familia:")), 0, 0)
self.combo_font = QFontComboBox()
self.combo_font.setFixedWidth(350)
box.addWidget(self.combo_font, 0, 1)
self._load_font()
box.addWidget(QLabel(self.tr("Tamaño:")), 1, 0)
self.spin_size_font = QSpinBox()
self.spin_size_font.setValue(settings.get_setting('editor/size-font'))
self.spin_size_font.setFixedWidth(350)
box.addWidget(self.spin_size_font, 1, 1)
box.setAlignment(Qt.AlignLeft)
# Scheme
#.........這裏部分代碼省略.........