Is there any way to clear the implicit text on a QTextEdit widget in Qt?

30 Views Asked by At
LogInPage::LogInPage(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::LogInPage)
{
    ui->setupUi(this);
    
    connect(ui->username, &QTextEdit::textChanged, this,
            &LogInPage::clearTextEdit);
}

void LogInPage::clearTextEdit()
{
    ui->username->clear();
}

I have tried this code, but with no success. Do you guys have any other suggestions? I have also tried this:

void on_username_clicked() in the private slots of the header with the same clear function, but it did not work.

0

There are 0 best solutions below