如何获得QLineEdit的内容

how to get the content of QLineEdit

本文关键字:QLineEdit 何获得      更新时间:2023-10-16

我想使用QLineEdit作为输入。我的问题是我不知道如何读取它的内容。

假设我有:

QLineEdit *edit = new QLineEdit("");

将其添加到GUI后如何获得内容?

它有一个text属性,所以只需执行:

edit->text();