PDA

View Full Version : Create table and edit cells using popup dialog?



saifulkhan
24th October 2012, 01:47
Dear Qt Programmers,

I am a student and new to Qt. I really need your help urgently.

In my application I have to create a table. Each cell of the table contains several values (basically a structure). The functionalities I need is similar to MS Excel, where if we left-clik on a cell a small window popups (attached image) which allows to set the properties of the cell.

Basically what I want is a table and when I click a cell a dialog will popup. The dialog will show the currently set values (of the structure). Then I can change the values and submit also.

Thanks





8345

saifulkhan
24th October 2012, 19:55
The requirement is that I need a table. Each cell of the table contain a structure which basically holds the property of a symbol (Glyph). Each symbols property is editable. Please see the attached image.

Now I have created custom QGraphicsView where I can click and edit the symbol. So I need those views to show in a table. Any suggestions on how to embed QGraphicsView in place of QTableWidget item?

(Note: I shall be happy to acknowledge those who help me in my final report)

ChrisW67
24th October 2012, 23:46
For when the cell is not being edited I would suggest rendering the current glyph state into a pixmap and setting that on the cell for display. You can use QStyledItemDelegate to provide a custom editor for the cell. You will need hold the QGraphicsScene for each glyph so the editor can get to it when invoked.

saifulkhan
25th October 2012, 02:28
thanks for your reply. sorry i should have mentined earlier. if I render it to pixmap then I can not see the animation. those glyphs has also animation property which I should be able to change with a popup widget. now if could insert a view inside the cell problem is solved. any suggestion please?

ChrisW67
25th October 2012, 04:34
You can use QAbstractItemView::setIndexWidget() but performance will not be great if you have 500 animated widgets in the table.

saifulkhan
25th October 2012, 19:54
Thanks very much for the solution. Nice solution. We shall acknowledge your help and looking forward to get your help in future too.