QML - 嵌入式 QLineEdit - editFinished 仅通过按 Enter 键引发
我有一个标准的 QLineEdit,它嵌入在一个单独的包装类中的 QGraphicsProxyWidget 中,以使其可以在 QML 中访问。在我的包装类中,我重新连接信号“editingFinished”,并将信号发送到 QML 环境。在我的 QML 环境中,有一个插槽处理该信号并首先打印一些文本。
当我编辑 LineEdit 的文本并按 Enter 键时,会发出信号,插槽会收到此信号并打印出此消息。这说明信号与槽位连接正确。但是,当我编辑文本并单击 QML.Environment 中的另一个元素时,不会发出任何信号。
我该怎么做才能发出这个信号。 QML 中的焦点处理是否有错误? 感谢您的帮助
I have a standard QLineEdit that is embedded in a QGraphicsProxyWidget, in a sperate wrapperclass, to make it accessible in QML. In my wrapperclass i make a reconnect of the signal "editingFinished" and the signal goes to the QML-Environment. In my QML-Environment there is the slot that handles this signal and prints, for the first, some text out.
When I edit the text of my LineEdit and hit enter, the signal gets emitted and the slot gets this signal and print out this message. This indicates that the signal and the slot are connected correctly. But when I edit the text and click on another Element in my QML.Environment, no signal is emitted.
What can I make to get this signal emitted. Is there an error in the focus-handling in QML?
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,看起来这是 QML 的问题,正如文档中所说
但我没有太多经验。
但它也说
well, it looks like it's a problem from QML, as in the doc it says
but i dont have much experience.
but it also says