
Originally Posted by
Soumya Somasekhar Ram
Actually the text is entered at run time.
Whatever is entering at runtime, that should be displayed using text() and set as the text of the button.
u need to connect the signal of lineEdit to a slot which will update the text of QPushButton
connect( lb,
SIGNAL( textChanged
(const QString &) ), lb,
SLOT( changeButtonText
(const QString &) ) );
connect( lb, SIGNAL( textChanged (const QString &) ), lb, SLOT( changeButtonText(const QString &) ) );
To copy to clipboard, switch view to plain text mode
slot:
changeButtonText
(const QString &data
){
button->setText(data);
}
changeButtonText(const QString &data)
{
button->setText(data);
}
To copy to clipboard, switch view to plain text mode
as u used returnPressed() , remove the hide() slot
and add ur changeButtonText()
connect( lb, SIGNAL( returnPressed ( ), lb, SLOT( changeButtonText() ) )
connect( lb, SIGNAL( returnPressed ( ), lb, SLOT( changeButtonText() ) )
To copy to clipboard, switch view to plain text mode
and in
changeButtonText()
{
button->setText(lb->text());
}
changeButtonText()
{
button->setText(lb->text());
}
To copy to clipboard, switch view to plain text mode
Bookmarks