PDA

View Full Version : how to mimic this functionality with Qt



javimoya
27th December 2010, 22:43
Hi !
(first off... sorry for my poor english)

I love the way "tablewidgets" works in Microsoft Money... and I would like to mimic his functionality...
(Microsoft Money is free... you can download here and see it by yourself: http://www.microsoft.com/money/sunset.mspx)

In this screenshot you can see what I want:
5653
you can see a normal "tablewidget"... only showing the most important fields... but when you press enter (or you click in a specific row), that row "expand"... and you can easilly edit that record (showing all the fields).

Any idea of how to accomplish that with Qt?

(as you can see in the screenshot is not a borderless window in from of the list... -the row expand-)

thank you very much

squidge
27th December 2010, 23:33
I think you'll need to show a before and after screenshot, so we can see clearly what you mean by "the row expand".

But I think you should read up on Qt delegates.

javimoya
27th December 2010, 23:58
the screenshot is a before and after example :)

in the top screenshot you can see 3 rows...
in the bottom screenshot you can see how the second row is expanded.

I think that is not possible with delegates...

wysota
28th December 2010, 00:11
If I read the screenshot correctly then what really happens in the program you mention is that the table does not expand but rather it is covered by a separate widget containing all the fields to be edited and I doubt it is done automatically. To do the same in Qt when someone request to edit a row create a widget that is a child of the table view's viewport(), have it contain widgets for editing all the fields you want and position it in the viewport using QWidget::setGeometry(), move() or equivalent. To find out where to position the widget you can use QAbstractItemView::visualRect() to find the rectangle occupied by the row that is to be edited.

javimoya
28th December 2010, 00:56
thanks...

I follow your instructions in the Qt's Address Book example... and yes... you can mimic the same effect with that.

;)

squidge
28th December 2010, 01:00
Now I understand your screenshot, and I would agree with wysota - it seems a widget is carefully positioned underneath the row for easy editing of the fields.

wysota
28th December 2010, 01:36
And to be honest I would call it a bad UI design. For me this should obviously be a plain dialog window.

javimoya
28th December 2010, 02:02
in my opinion is not a "standard" ui design... but it is more faster and convenience for the user...

you can edit faster...
less clicks...
(anyway ms money offers -if you prefer- a dialog too... or in a panel below the list.... 3 differents way)

:)

wysota
28th December 2010, 02:23
in my opinion is not a "standard" ui design... but it is more faster and convenience for the user...
It's not in any way faster than a dialog box that pops-up.


less clicks...
Really? How come? And what if you want to input a value based on the value in a row directly under the one you are currently editing?

Standards are "standard" for a reason.

squidge
28th December 2010, 05:51
If you are Microsoft (and the screenshot is from a Microsoft application), standards are meant to be broken, and then reinvented as the best way of doing something. Typically, people want to copy their practices.

I don't know why you couldn't have that edit window underneath the the list of records and have it update as you move throughout the data. To me, that would be more user friendly. (Ie, the actual screenshot being almost exactly like the one posted, which I thought it was at first)