Home > other >  PyQt dynamically created QTextEdit unable to get the input focus
PyQt dynamically created QTextEdit unable to get the input focus

Time:09-16

Self. Tmpobj=QtGui. QTextEdit (self newtab)
Self. Tmpobj. SetGeometry (i.g eometry ())
Self. Tmpobj. SetObjectName (newobjname)
Self. Tmpobj. The show ()

I use pyqt4 dynamically create a QTextEdit object, but can't input the contents on the interface, the mouse click no response for a less than focus
I set focus on the control again, but still won't do
Self. Tmpobj. SetFocusPolicy (QtCore. Qt. StrongFocus)

CodePudding user response:

Find the problem points, but don't know how to solve, the reason is that the dynamic created some decorative lines (Line), if you don't create these lines, you can edit is QTextEdit
  • Related