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. TableView with header and footer for sums, avg and so on

TableView with header and footer for sums, avg and so on

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 4.5k 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.
  • jensen82J Offline
    jensen82J Offline
    jensen82
    wrote on last edited by
    #1

    Hi!

    I want to create a TableView with Header, Data and Footer (SUM, AVG, etc.). I want to scroll the data-values and/or header and footer.

    Pictures say more than just words. Here is a drawing of that.

    !http://img854.imageshack.us/img854/3628/tableexample.jpg!

    I want to set a model via setModel(mymodel).

    In this model i want to calculate a new value for the rows...example(pseudo-code):

    @
    if(model.currentrow.currency == USD)
    {
    CalcUSDToEuro(currentrow); // calc euro and show in table
    }
    else if(model.currentrow.currency == GBP)
    {
    CalcGBPToEuro(currentrow); // calc euro and show in table
    }@

    Is it somehow possible?

    I'm very new to qt...sorry.

    Thank you for your help!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Not with the standard item views. You need a 3rd party component, or make it yourself. ICS has a table view that can do all you want (and more), and I am pretty sure there are other offerings as well.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        You can take some ideas from http://doc.trolltech.com/4.7-snapshot/itemviews-frozencolumn.html

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • jensen82J Offline
          jensen82J Offline
          jensen82
          wrote on last edited by
          #4

          Thanks....i can't get it working. Maybe my QT-Knowledge is not that good.

          Any other ideas or some code?

          Thank you very much!!!!

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            Do you have any specific questions? What did you try? What did not work? Did you look at the mentioned alternatives?

            1 Reply Last reply
            0
            • G Offline
              G Offline
              giesbert
              wrote on last edited by
              #6

              this goes in directtion of "this":http://developer.qt.nokia.com/forums/viewthread/1978/ topic. From my point of view, you need external tools (like that from ICS), as I think the sollution proposed in the docs (2 views, on rfixed, one scrolling) has some unusual behavior issues (moving focus by keys to the fixed rows etc.).

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              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