PDA

View Full Version : Sending text from QTextEdit to QListWidget on pushing QPushButton - Qt



TheIndependentAquarius
23rd February 2012, 07:26
So, I have the following design:

List box
Text box
Push button


When I push the button, the text from the text box should go to the list box.

QTextEdit has the following signal:

void QTextEdit::textChanged () [signal]

But, doesn't this mean that when user presses an alphabet, a signal will be sent? But, I want the whole paragraph to go to the list box (at once) on the push of the button.

Should I send the data from text box to button and then from button to list box? Or there another way out?

mentalmushroom
23rd February 2012, 07:33
Connect QPushButton's clicked signal to some slot where you read the text from text edit and add it to the QListWidget, QListView whatever.