Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Custom TableView (horizontal/Vertical Headers)
Forum Updated to NodeBB v4.3 + New Features

Custom TableView (horizontal/Vertical Headers)

Scheduled Pinned Locked Moved Solved Italian
3 Posts 2 Posters 1.0k 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.
  • B Offline
    B Offline
    Bruschetta
    wrote on last edited by
    #1

    Salve a tutti.
    Vorrei creare una TableView custom da poter generare dimamicamente.
    Nella tabella vorrei poter settare sia gli Horizontal che i Vertical Headers.
    Fondamentalmente vossrei scrivere una cosa del genere:
    Label1 | Label 2 .... Label n
    X
    Y
    Z

    X,Y,Z sono label costanti che voglio mettere come header verticali , label1...N valori che mi vengono passati dinamicamente da query al DB.
    Che scrumenti potrei usare? Avete consigli da darmi?

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      La view non ha nulla a che fare con quello che vuoi, e' il modello che conta.
      Direi che QStandardItemModel sia perfetto per quello che vuoi fare.

      Se hai gia' l'interno della tabella e vuoi modificare solo gli headers ti conviene prendere QIdentityProxyModel e reimplementare headerData()

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      B 1 Reply Last reply
      1
      • VRoninV VRonin

        La view non ha nulla a che fare con quello che vuoi, e' il modello che conta.
        Direi che QStandardItemModel sia perfetto per quello che vuoi fare.

        Se hai gia' l'interno della tabella e vuoi modificare solo gli headers ti conviene prendere QIdentityProxyModel e reimplementare headerData()

        B Offline
        B Offline
        Bruschetta
        wrote on last edited by
        #3

        @VRonin
        Grazie era esattamente quello che cercavo!

        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