本文整理汇总了Python中PyQt5.QtCore.Qt.NoFocus方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.NoFocus方法的具体用法?Python Qt.NoFocus怎么用?Python Qt.NoFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.NoFocus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, model, parent=None):
super().__init__(parent)
if not utils.is_mac:
self.setStyle(QStyleFactory.create('Fusion'))
stylesheet.set_register(self)
self.setResizeMode(QListView.Adjust)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
self.setFocusPolicy(Qt.NoFocus)
self.setFlow(QListView.LeftToRight)
self.setSpacing(1)
self._menu = None
model.rowsInserted.connect(functools.partial(update_geometry, self))
model.rowsRemoved.connect(functools.partial(update_geometry, self))
model.dataChanged.connect(functools.partial(update_geometry, self))
self.setModel(model)
self.setWrapping(True)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.show_context_menu)
self.clicked.connect(self.on_clicked)
示例2: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, target, tooltip, sequence, text=None, style=None):
"""
Initializes the button and wires its 'clicked' event.
Note that buttons that have text get one set of styling
different from ones without text.
"""
super().__init__(ICON, text, signal_name='clicked', target=target)
if text:
self.setIconSize(QtCore.QSize(15, 15))
else:
self.setFixedWidth(20)
self.setFixedHeight(20)
self.setFocusPolicy(Qt.NoFocus)
self.setShortcut(sequence)
self.setToolTip(self.tooltip_text(tooltip, sequence))
if style:
self.setStyle(style)
示例3: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, cue, **kwargs):
super().__init__(cue, **kwargs)
self.setGeometry(0, 0, self.width(), 110)
self._dbmeter_element = None
self.seekSlider = QClickSlider(self.gridLayoutWidget)
self.seekSlider.setOrientation(Qt.Horizontal)
self.seekSlider.setRange(0, cue.duration)
self.seekSlider.setFocusPolicy(Qt.NoFocus)
self.seekSlider.sliderMoved.connect(self._seek)
self.seekSlider.sliderJumped.connect(self._seek)
self.seekSlider.setVisible(False)
self.dbmeter = QDbMeter(self.gridLayoutWidget)
self.dbmeter.setVisible(False)
cue.changed('duration').connect(self._update_duration,
Connection.QtQueued)
示例4: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.setLayout(QVBoxLayout())
self.layout().setContentsMargins(0, 0, 0, 0)
self.__cue = None
# cue name
self.cueName = QLineEdit(self)
self.cueName.setFocusPolicy(Qt.NoFocus)
self.cueName.setReadOnly(True)
self.layout().addWidget(self.cueName)
# cue description
self.cueDescription = QTextEdit(self)
self.cueDescription.setObjectName('InfoPanelDescription')
self.cueDescription.setFocusPolicy(Qt.NoFocus)
self.cueDescription.setReadOnly(True)
self.layout().addWidget(self.cueDescription)
self.retranslateUi()
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, running_model, **kwargs):
super().__init__(**kwargs)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setFocusPolicy(Qt.NoFocus)
self.setSelectionMode(self.NoSelection)
self._running_cues = {}
self._running_model = running_model
self._running_model.item_added.connect(
self._item_added, Connection.QtQueued)
self._running_model.item_removed.connect(
self._item_removed, Connection.QtQueued)
self._running_model.model_reset.connect(
self._model_reset, Connection.QtQueued)
self.__dbmeter_visible = False
self.__seek_visible = False
self.__accurate_time = False
示例6: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def initUI(self):
OVER_CAPACITY = 750
sld = QSlider(Qt.Horizontal, self)
sld.setFocusPolicy(Qt.NoFocus)
sld.setRange(1, OVER_CAPACITY)
sld.setValue(75)
sld.setGeometry(30, 40, 150, 30)
self.c = Communicate()
self.wid = BurningWidget()
self.c.updateBW[int].connect(self.wid.setValue)
sld.valueChanged[int].connect(self.changeValue)
hbox = QHBoxLayout()
hbox.addWidget(self.wid)
vbox = QVBoxLayout()
vbox.addStretch(1)
vbox.addLayout(hbox)
self.setLayout(vbox)
self.setGeometry(300, 300, 390, 210)
self.setWindowTitle('Burning widget')
self.show()
示例7: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def initUI(self):
self.setWindowTitle(self.title)
self.setGeometry(self.left, self.top, self.width, self.height)
self.m = m = PlotCanvas(self, width=5, height=4)
m.move(0,0)
sld = QSlider(Qt.Vertical, self)
sld.setFocusPolicy(Qt.NoFocus)
sld.setGeometry(500, 40, 100, 90)
sld.valueChanged[int].connect(self.changeValue)
# button.setToolTip('This s an example button')
# button.move(500,0)
# button.resize(140,100)
self.show()
示例8: setParameters
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def setParameters(self, minValue, maxValue):
# Creates the slider for the OpenCV filter, with min, max, default and
# step values
self.thresh_sld = QSlider(Qt.Horizontal, self)
self.thresh_sld.setFocusPolicy(Qt.NoFocus)
self.thresh_sld.setMinimum(minValue)
self.thresh_sld.setMaximum(maxValue)
self.thresh_sld.setValue(self.k[0])
self.thresh_sld.setSingleStep(2)
示例9: newButton
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def newButton(self, icon):
button = QIconPushButton(self)
button.setFocusPolicy(Qt.NoFocus)
button.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Expanding)
button.setIcon(icon)
button.setIconSize(QSize(32, 32))
return button
示例10: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def initUI(self):
self.setWindowTitle("请稍等……")
self.setWindowIcon(QIcon(SRC_DIR + "password.ico"))
self.lb_oldpwd = QLabel()
self.lb_oldpwd.setText("当前提取码:")
self.lb_oldpwd.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
self.tx_oldpwd = QLineEdit()
# 当前提取码 只读
self.tx_oldpwd.setFocusPolicy(Qt.NoFocus)
self.tx_oldpwd.setReadOnly(True)
self.lb_newpwd = QLabel()
self.lb_newpwd.setText("新的提取码:")
self.lb_newpwd.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
self.tx_newpwd = QLineEdit()
self.buttonBox = QDialogButtonBox()
self.buttonBox.setOrientation(Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
self.buttonBox.button(QDialogButtonBox.Ok).setText("确定")
self.buttonBox.button(QDialogButtonBox.Cancel).setText("取消")
self.grid = QGridLayout()
self.grid.setSpacing(10)
self.grid.addWidget(self.lb_oldpwd, 1, 0)
self.grid.addWidget(self.tx_oldpwd, 1, 1)
self.grid.addWidget(self.lb_newpwd, 2, 0)
self.grid.addWidget(self.tx_newpwd, 2, 1)
self.grid.addWidget(self.buttonBox, 3, 0, 1, 2)
self.setLayout(self.grid)
self.buttonBox.accepted.connect(self.btn_ok)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.accepted.connect(self.set_tip)
self.buttonBox.rejected.connect(self.reject)
self.buttonBox.rejected.connect(self.set_tip)
self.setMinimumWidth(280)
示例11: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def initUI(self):
self.setWindowTitle("移动文件(夹)")
self.setWindowIcon(QIcon(SRC_DIR + "move.ico"))
self.lb_name = QLabel()
self.lb_name.setText("文件(夹)名:")
self.lb_name.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
self.tx_name = AutoResizingTextEdit()
self.tx_name.setFocusPolicy(Qt.NoFocus) # 只读
self.tx_name.setReadOnly(True)
self.lb_new_path = QLabel()
self.lb_new_path.setText("目标文件夹:")
self.lb_new_path.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter)
self.tx_new_path = QComboBox()
self.buttonBox = QDialogButtonBox()
self.buttonBox.setOrientation(Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
self.buttonBox.button(QDialogButtonBox.Ok).setText("确定")
self.buttonBox.button(QDialogButtonBox.Cancel).setText("取消")
self.grid = QGridLayout()
self.grid.setSpacing(10)
self.grid.addWidget(self.lb_name, 1, 0)
self.grid.addWidget(self.tx_name, 1, 1)
self.grid.addWidget(self.lb_new_path, 2, 0)
self.grid.addWidget(self.tx_new_path, 2, 1)
self.grid.addWidget(self.buttonBox, 3, 0, 1, 2)
self.setLayout(self.grid)
self.buttonBox.accepted.connect(self.btn_ok)
self.buttonBox.accepted.connect(self.accept)
self.buttonBox.rejected.connect(self.reject)
self.setMinimumWidth(280)
示例12: initUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def initUI(self):
sld = QSlider(Qt.Horizontal, self)
sld.setFocusPolicy(Qt.NoFocus) # 这个有什么作用?
sld.setGeometry(30, 40, 100, 30)
sld.valueChanged[int].connect(self.changeValue)
self.label = QLabel(self)
self.label.setPixmap(QPixmap('mute.png'))
self.label.setGeometry(160, 40, 80, 30)
self.setGeometry(300, 300, 280, 170)
self.setWindowTitle('QSlider')
self.show()
示例13: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, parent=None):
super(Cmdline, self).__init__(parent)
Console.lineEdit = self
self.cmdline = ''
# self.setFocusPolicy(Qt.NoFocus)
self.set_cmdline('')
示例14: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def __init__(self, parent=None):
super().__init__(parent)
self.setMinimumHeight(150)
self.setReadOnly(True)
self.setFocusPolicy(Qt.NoFocus)
示例15: createsegmenttable
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import NoFocus [as 别名]
def createsegmenttable(self):
self.segmenttable.setRowCount(8)
self.segmenttable.setColumnCount(4)
self.segmenttable.setHorizontalHeaderLabels([QApplication.translate("Table","SV",None),
QApplication.translate("Table","Ramp HH:MM",None),
QApplication.translate("Table","Soak HH:MM",None),""])
self.segmenttable.setEditTriggers(QTableWidget.NoEditTriggers)
self.segmenttable.setSelectionBehavior(QTableWidget.SelectRows)
self.segmenttable.setSelectionMode(QTableWidget.SingleSelection)
self.segmenttable.setShowGrid(True)
self.segmenttable.verticalHeader().setSectionResizeMode(2)
regextime = QRegExp(r"^-?[0-9]?[0-9]?[0-9]:[0-5][0-9]$")
#populate table
for i in range(8):
#create widgets
svkey = "segment" + str(i+1) + "sv"
rampkey = "segment" + str(i+1) + "ramp"
soakkey = "segment" + str(i+1) + "soak"
svedit = QLineEdit(str(self.aw.fujipid.PXR[svkey][0]))
svedit.setValidator(self.aw.createCLocaleDoubleValidator(0., 999., 1, svedit))
rampedit = QLineEdit(stringfromseconds(self.aw.fujipid.PXR[rampkey][0]))
rampedit.setValidator(QRegExpValidator(regextime,self))
soakedit = QLineEdit(stringfromseconds(self.aw.fujipid.PXR[soakkey][0]))
soakedit.setValidator(QRegExpValidator(regextime,self))
setButton = QPushButton(QApplication.translate("Button","Set",None))
setButton.clicked.connect(self.setsegment)
setButton.setFocusPolicy(Qt.NoFocus)
#add widgets to the table
self.segmenttable.setCellWidget(i,0,svedit)
self.segmenttable.setCellWidget(i,1,rampedit)
self.segmenttable.setCellWidget(i,2,soakedit)
self.segmenttable.setCellWidget(i,3,setButton)
#idn = id number, sv = float set value, ramp = ramp value, soak = soak value