{// 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:os());
qDebug()<<lb->text();
button->setText(lb->text());
button->setObjectName(lb->text());
} }
To copy to clipboard, switch view to plain text mode
u are not setting any text in QLineEdit in ur code .
u shuld use
lb->setText("Ur Text that u want to display");
lb->setText("Ur Text that u want to display");
To copy to clipboard, switch view to plain text mode
or else while constructing the lineEdit
QLineEdit::QLineEdit ( const QString & contents, QWidget * parent = 0 )u can set
QLineEdit *lb=new QLineEdit("Ur Text", popup1);
To copy to clipboard, switch view to plain text mode
Bookmarks