Answer the question
In order to leave comments, you need to log in
How to save data to QString from qlineedit on button click?
Maine has this code
QApplication app(argc, argv);
QWidget wgt;
QString str;
QLineEdit* line_edit_1 = new QLineEdit;
QPushButton* push_but = new QPushButton;
QHBoxLayout* phbxLayout = new QHBoxLayout;
phbxLayout->setContentsMargins(10, 10, 10, 10);
phbxLayout->setSpacing(20);
phbxLayout->addWidget(line_edit_1);
wgt.setLayout(phbxLayout);
wgt.show();
Answer the question
In order to leave comments, you need to log in
You need to create your own slot in which to connect the click, and get the text from the button there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question