Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置QTextEdit的部分字符只读 #65

Closed
dongzhang0725 opened this issue Jul 15, 2019 · 2 comments
Closed

设置QTextEdit的部分字符只读 #65

dongzhang0725 opened this issue Jul 15, 2019 · 2 comments
Labels

Comments

@dongzhang0725
Copy link

Environment : / 环境

  • OS: Win 10 [e.g. Win 10]
  • Python: 3.6.4 [e.g. 3.6.4 X64]
  • PyQt5: 5.10.1 [e.g. 5.10.1]

请问有没有办法只设置QTextEdit的部分字符只读?如图,我想设置inlutFile只读和可选,而其他字符串可以修改。

image

@892768447
Copy link
Member

好像没有直接的方法可以这样,不过可以结合多个信号或者函数来达到类似的效果,比如selectionChanged 信号 https://doc.qt.io/qt-5/qtextedit.html#selectionChanged ,setReadonly等等。需要自己实现这样的逻辑

@dongzhang0725
Copy link
Author

好的,多谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants