Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTableView add row via QLineEdit in last row

QTableView add row via QLineEdit in last row

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 177 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    just-ero
    wrote on last edited by
    #1

    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 this QLineEdit 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):
    qt_mockup

    JonBJ 1 Reply Last reply
    0
    • J just-ero

      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 this QLineEdit 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):
      qt_mockup

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @just-ero
      QTableView on editing last row add new line
      In Qt, create a table with an blank editable row

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved