本文整理匯總了Python中cola.widgets.text.HintedLineEdit.selectAll方法的典型用法代碼示例。如果您正苦於以下問題:Python HintedLineEdit.selectAll方法的具體用法?Python HintedLineEdit.selectAll怎麽用?Python HintedLineEdit.selectAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cola.widgets.text.HintedLineEdit
的用法示例。
在下文中一共展示了HintedLineEdit.selectAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Grep
# 需要導入模塊: from cola.widgets.text import HintedLineEdit [as 別名]
# 或者: from cola.widgets.text.HintedLineEdit import selectAll [as 別名]
#.........這裏部分代碼省略.........
self.mainlayout = qtutils.vbox(defs.margin, defs.no_spacing,
self.input_layout, self.result_txt,
self.bottom_layout)
self.setLayout(self.mainlayout)
self.worker_thread = GrepThread(self)
self.connect(self.worker_thread,
SIGNAL('result(PyQt_PyObject,PyQt_PyObject,PyQt_PyObject)'),
self.process_result, Qt.QueuedConnection)
self.connect(self.input_txt, SIGNAL('textChanged(QString)'),
lambda s: self.search())
self.connect(self.regexp_combo, SIGNAL('currentIndexChanged(int)'),
lambda x: self.search())
self.connect(self.result_txt, SIGNAL('leave()'),
lambda: self.input_txt.setFocus())
qtutils.add_action(self.input_txt, 'Focus Results', self.focus_results,
hotkeys.DOWN, *hotkeys.ACCEPT)
qtutils.add_action(self, 'Focus Input', self.focus_input, hotkeys.FOCUS)
qtutils.connect_toggle(self.shell_checkbox, lambda x: self.search())
qtutils.connect_button(self.close_button, self.close)
qtutils.add_close_action(self)
if not self.restore_state():
width, height = qtutils.default_size(parent, 666, 420)
self.resize(width, height)
def focus_input(self):
self.input_txt.setFocus()
self.input_txt.selectAll()
def focus_results(self):
self.result_txt.setFocus()
def done(self, exit_code):
self.save_state()
return Dialog.done(self, exit_code)
def regexp_mode(self):
idx = self.regexp_combo.currentIndex()
data = self.regexp_combo.itemData(idx, Qt.UserRole).toPyObject()
return ustr(data)
def search(self):
self.edit_group.setEnabled(False)
self.refresh_group.setEnabled(False)
query = self.input_txt.value()
if len(query) < 2:
self.result_txt.set_value('')
return
self.worker_thread.query = query
self.worker_thread.shell = self.shell_checkbox.isChecked()
self.worker_thread.regexp_mode = self.regexp_mode()
self.worker_thread.start()
def search_for(self, txt):
self.input_txt.set_value(txt)
def text_scroll(self):
scrollbar = self.result_txt.verticalScrollBar()
if scrollbar:
return scrollbar.value()