PDA

View Full Version : How to enable a different QPlainTextEdit by clicking a PushButton?



llorenzi
25th February 2016, 15:54
I tried many times to enable a different QPlainTextEdit by clicking two different PushButtons.
Here part of my code:



// MERGE
descriptionEdit->setPlainText("Select the two fragments.");
connect(b_merge, SIGNAL(triggered()), descriptionEdit, SLOT(on_pushButton_clicked()));

// SPLIT
descriptionEdit->setPlainText("Draw a polyline.");
connect(b_split, SIGNAL(triggered()), descriptionEdit, SLOT(on_pushButton_clicked()));


It gives me only the second one (SPLIT), and without any clicking.
I just want that by clicking one of the two buttons also the text sholud be change.

anda_skoa
25th February 2016, 16:01
I am not sure what you mean.

So you set up to connections to the same receiver object, same slot.
Does that slot make the distinction between the two senders?

Maybe you can show the implementation of that slot?

Cheers,
_

llorenzi
26th February 2016, 08:14
I found the problem: it was in the function on_pushButton_clicked()
thanks anyway