Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Custom TableView (horizontal/Vertical Headers)

    Italian
    2
    3
    726
    Loading More Posts
    • 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
      Bruschetta last edited by

      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 Reply Quote 0
      • V
        VRonin last edited by

        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 Reply Quote 1
        • B
          Bruschetta @VRonin last edited by

          @VRonin
          Grazie era esattamente quello che cercavo!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post