PDA

View Full Version : QTableWidget : insert multiple widgets in one cell..



halberdier83
26th November 2007, 15:56
Hi all,

I want to insert a lineEdit and a pushButton into one cell. When pushButton is clicked, the calling slot will set a text to the lineEdit. I can use setCellWidget() method of QTableWidget. But it takes one widget. So i need a widget which contains multiple widgets. Do you have any idae to implement this problem?

Thanks,

jacek
26th November 2007, 15:58
Subclass QFrame or QWidget and make your own custom widget.

halberdier83
26th November 2007, 16:06
Thanks jacek,

But i know this. I need some advices in implementation. Actually, i need a class which is derived from QWidget or QFrame as you said. Each class object should include a layouted pushButton and lineEdit. Then i will add this object to the tablewidget. is that right? it would be better if you provide some code..

Thanks,

wysota
26th November 2007, 16:15
Since you know everything, what is the question? Why don't you just sit down, do it, see if it works and if not, ask for specific help here?