QTableView add row via QLineEdit in last row
-
Hi.
I plan on building a widget with which a user can add HTTP headers to a REST request. For this, I'm thinking of using a table, which in its last row, contains a
QLineEdit
with the placeholder text "New header...". The user should be able to click thisQLineEdit
widget, type in their desired header (ideally be recommended known HTTP headers) and have their new header added to the table.The value of this new header should, of course, be editable. I would also like the user to be able to change the type of the header value (string, number, date, etc.), though I'm not sure how I would design that.
For now, is such a table widget possible? How can I achieve it? I've been using the designer for now (of course, using grids and splitters appropriately), so I don't know any QML yet. If that makes it easier, I'll look into it (please, if you can, link me some relevant resources).
Thanks.
Here's a mockup of my idea (improvements welcome):
-