I want to display the text in the LineEdit using Qt.
but when i use the code an empty string wiil be displayed.
The following is my code.
{// it's a "QPushButton", do something with pb here
popup1->setWindowTitle("Rename the folder");
connect( lb, SIGNAL( returnPressed() ), lb, SLOT( hide() ) );
lb->setFocus();
lb->show();
qDebug()<<lb->text();
button->setText(lb->text());
button->setObjectName(lb->text());
} }
if( QPushButton *button = (QPushButton *)sender())
{// it's a "QPushButton", do something with pb here
QFrame* popup1 = new QFrame(this, Qt::Tool | Qt::Window );
popup1->setWindowTitle("Rename the folder");
QLineEdit *lb=new QLineEdit(popup1);
connect( lb, SIGNAL( returnPressed() ), lb, SLOT( hide() ) );
lb->setFocus();
lb->show();
lb->move(QCursor::pos());
qDebug()<<lb->text();
button->setText(lb->text());
button->setObjectName(lb->text());
} }
To copy to clipboard, switch view to plain text mode
Can any one help me.
Thanks in advance.
Bookmarks