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 and QDataWidgetMapper question!

QtableView and QDataWidgetMapper question!

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 909 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.
  • P Offline
    P Offline
    pip010
    wrote on last edited by
    #1

    I have a bit peculiar case where i have an abstract item model attached to table view as well data mapper to several text fields. The problem is, I have 6 fields to map, 3 of the should be visible only in the table view while the rest only in the text fields (custom form) via QDataWidgetMapper.

    Regardless what I have tried either the one or the other get broken and it seems impossible to achieve it.

    So is it possible in general to have only some columns visible in the table view, while the reset get mapped to custom form via the mapper? I tried even defining two separate abstract models, but still no luck :(

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

      extremely easy! http://doc.qt.io/qt-5/qtableview.html#setColumnHidden

      "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

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mjsurette
        wrote on last edited by
        #2

        I've never had this issue. Could you provide more details? In what way does it break? What version of Qt? What platform?

        Mike

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

          extremely easy! http://doc.qt.io/qt-5/qtableview.html#setColumnHidden

          "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

          1 Reply Last reply
          1
          • P Offline
            P Offline
            pip010
            wrote on last edited by
            #4

            ahhh yes :) that did it. Somehow I assumed it must be influenced through the model. Thanks alot.

            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