本文整理汇总了Python中PyQt4.Qt.QTextEdit.setDisabled方法的典型用法代码示例。如果您正苦于以下问题:Python QTextEdit.setDisabled方法的具体用法?Python QTextEdit.setDisabled怎么用?Python QTextEdit.setDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QTextEdit
的用法示例。
在下文中一共展示了QTextEdit.setDisabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TwitterGui
# 需要导入模块: from PyQt4.Qt import QTextEdit [as 别名]
# 或者: from PyQt4.Qt.QTextEdit import setDisabled [as 别名]
#.........这里部分代码省略.........
self.set_status("Failed to post tweet, Error: " + str(abs(m_id)))
self.post_field.setEnabled(True)
def link_clicked(self, url):
if not url.host():
if url.hasQueryItem("reply-to") and url.hasQueryItem("screen-name"):
self._reply_to_id = long(convert_string(url.queryItemValue("reply-to")))
self.post_field.setPlainText("@"+convert_string(url.queryItemValue("screen-name"))+" ")
self.set_status("Reply to @"+convert_string(url.queryItemValue("screen-name")))
else:
self.logger.error("Unknown command from link: "+str(url.toString()))
else:
webbrowser.open(str(url.toString()))
def list_changed(self, list_idx):
if list_idx:
self._list = convert_string(self.lists_box.currentText())
self.userCombo.clear()
self.userCombo.addItems(self._db_conn.get_known_users())
self.userCombo.completer().setCompletionMode(QCompleter.PopupCompletion)
self.userCombo.show()
self.set_status(self._list)
else:
self.userCombo.hide()
self._list = None
self.update_view()
def post_status_clicked(self):
msg = unicode(self.post_field.toPlainText().toUtf8(), encoding="UTF-8")
if msg:
self._db_conn.insert_post_queue(msg, self._reply_to_id)
self._reply_to_id = 0
self._update_func()
self.post_field.setDisabled(True)
def start_refresh_animation(self):
self.refresh_button.setDisabled(True)
def stop_refresh_animation(self):
self.refresh_button.setEnabled(True)
def show_hide_animation(self):
if self.gridw.isHidden():
self.gridw.show()
self.showButton.setText("v")
else:
self.gridw.hide()
self.showButton.setText(chr(94))
def text_changed(self):
count = len(self.post_field.toPlainText())
if count==0:
self._reply_to_id = 0
if self._reply_to_id:
self.charCounter.setText(str(count) + " - reply to ")
else:
self.charCounter.setText(str(count))
def toggle_user_in_list(self, _):
user = convert_string(self.userCombo.currentText())
if user in self._db_conn.get_users_from_list(self._list):
self._db_conn.delete_user_from_list(user, self._list)
self.set_status("Removed user %s from list %s"%(user, self._list))
else:
self._db_conn.add_user_to_list(user, self._list)
self.set_status("Added user %s to list %s"%(user, self._list))