【问题标题】:Retrieving information from QLineEdit as soon as there is input? [duplicate]输入后立即从 QLineEdit 检索信息? [复制]
【发布时间】:2018-04-19 19:00:48
【问题描述】:

我有以下 PyQT 代码:

self.datestartbox = QLineEdit(self) # Create a textbox
self.dateendbox = QLineEdit(self) # Create a textbox

当字段中有文本时,如何获取用户输入?目前我只能在用户单击按钮然后使用时才能获得它

self.datestartbox.text()

干杯!

【问题讨论】:

    标签: python pyqt pyqt5 qlineedit


    【解决方案1】:

    为此,您必须使用:

    self.datestartbox.textChanged.connect(function_to_call_when_text_change)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-02
      • 2021-10-05
      • 1970-01-01
      • 1970-01-01
      • 2018-10-03
      • 1970-01-01
      • 2015-02-21
      相关资源
      最近更新 更多