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. [SOLVED]switch columns in a QSqlRelationalTableModel
Forum Update on Monday, May 27th 2025

[SOLVED]switch columns in a QSqlRelationalTableModel

Scheduled Pinned Locked Moved General and Desktop
5 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.
  • F Offline
    F Offline
    fluca1978
    wrote on 10 Oct 2011, 15:40 last edited by
    #1

    Hi,
    is it possible to change the order of columns into a QSqlRelationalTableModel without having to manually specify a query? For instance, if I've got a table with (surname, name) and I want to display it as (name, surname), is there an easy and handy way?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 10 Oct 2011, 17:54 last edited by
      #2

      You can do it on the view level.

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eddy
        wrote on 10 Oct 2011, 18:45 last edited by
        #3

        void QHeaderView::moveSection ( int from, int to )

        Qt Certified Specialist
        www.edalsolutions.be

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fluca1978
          wrote on 11 Oct 2011, 06:19 last edited by
          #4

          [quote author="Eddy" date="1318272331"]void QHeaderView::moveSection ( int from, int to )[/quote]

          Thanks, this is perfect!

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Eddy
            wrote on 11 Oct 2011, 06:43 last edited by
            #5

            Great!

            Could you edit your title and add [solved] in front of it? Thanks.

            Qt Certified Specialist
            www.edalsolutions.be

            1 Reply Last reply
            0

            1/5

            10 Oct 2011, 15:40

            • Login

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