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 double header

Qtableview double header

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 2.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.
  • N Offline
    N Offline
    n-2204
    wrote on last edited by
    #1

    How to add double header for 3 columns in a Qtableview
    model2->setHeaderData(0, Qt::Horizontal, tr(" Mesh "));
    model2->setHeaderData(1, Qt::Horizontal, tr(" Driver"));
    model2->setHeaderData(2, Qt::Horizontal, tr(" Driven"));
    i neeed one more header on these column how to do please suggest?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      What you mean with double header ?

      You can do

      model2->setHeaderData(1, Qt::Horizontal, tr(" test1\ntest1"));
      

      alt text

      N 1 Reply Last reply
      2
      • mrjjM mrjj

        Hi
        What you mean with double header ?

        You can do

        model2->setHeaderData(1, Qt::Horizontal, tr(" test1\ntest1"));
        

        alt text

        N Offline
        N Offline
        n-2204
        wrote on last edited by
        #3

        @mrjj 5ae17006-abbf-40a4-bfa1-6e393b6ea938-image.png
        I need to set on multiple columns like image attached (Driver header for 3 column and below one more header on each column same for Driven)
        I am using Qtableview

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Already asked a week ago - the search function is your friend...

          https://forum.qt.io/topic/125490/qtablewidget-with-2-headers/

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          N 1 Reply Last reply
          3
          • Christian EhrlicherC Christian Ehrlicher

            Already asked a week ago - the search function is your friend...

            https://forum.qt.io/topic/125490/qtablewidget-with-2-headers/

            N Offline
            N Offline
            n-2204
            wrote on last edited by
            #5

            @Christian-Ehrlicher Thanks but there is no working example

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @n-2204 said in Qtableview double header:

              Thanks but there is no working example

              And you think someone here found a solution in the last week??

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              N 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                @n-2204 said in Qtableview double header:

                Thanks but there is no working example

                And you think someone here found a solution in the last week??

                N Offline
                N Offline
                n-2204
                wrote on last edited by
                #7

                @Christian-Ehrlicher no

                mrjjM 1 Reply Last reply
                0
                • N n-2204

                  @Christian-Ehrlicher no

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @n-2204
                  Hi
                  But did you try
                  https://stackoverflow.com/questions/22755171/spanning-horizontal-header-in-qt/22756565#22756565
                  as listed in the other thread ?

                  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