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. Adding a notes to a TableView

Adding a notes to a TableView

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.4k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    scarleton
    wrote on last edited by
    #1

    I am working on an dialog that allows a user to modify an invoice. One of the features is that each line item can have a note, but must of the time line items will not have notes. So the question I am trying to figure out is how best to let the user know there is a note for a line item and how to manage the note (create, edit, view, and delete).

    I am wide open for suggestions. My current thought is inspired by the modern world of UI's like QML: Simply have a column in the TableView that has one of two buttons: <Add> or <Manage>. The <Add> is visible when there is no note, the <Manage> is present to view, edit, and delete the note. In either case a new Notes dialog would appear.

    If I were to get REAL fancy, when there IS a note, I would love the line item to have two rows, the first is the standard columns and the second would be simply the note. But I don't know if it is possible to have a multi-line Row in the TableView, is it?

    Does anyone have any other, ideally simpler, solutions to this issue?

    Sam

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dialingo
      wrote on last edited by
      #2

      You can write a delegate and plug it into the view.
      http://doc.qt.nokia.com/4.7/qabstractitemdelegate.html
      A delegate lets you write your own editor and viewer inside a table cell. This can be a notes editor or whatever you dream of. Qt comes with plenty of examples for writing delegates. Try to hack one of these instead of trying it all on your own.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        scarleton
        wrote on last edited by
        #3

        Two questions:

        Q1: How do I get a button to respond to the first click of the cell? Normally the first click activates the control witting the TableView.

        Q2: Do you know of any examples of multi-line rows which I can look at?

        Sam

        1 Reply Last reply
        0

        • Login

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