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. A few Questions about QTableView
QtWS25 Last Chance

A few Questions about QTableView

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 330 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.
  • Fuel 0F Offline
    Fuel 0F Offline
    Fuel 0
    wrote on last edited by
    #1

    I implemented a QTableView with a Model and there are some stupid Things i want to fix. At the Moment i dont know how to do it. But i will show you.

    First. I have 6 Columns configured in my Model, but with some Reason there is a small Column at the Start when i put Data in.
    Unbenannt.png

    You see what i mean? Before the Date Column.

    Some other Thing im disappointed of is when i select a Row. The Header looks then disgusting.
    Unbenannt2.png

    How can i change that?

    And the last Thing i want to ask. At the Moment the Cells are kind of fixed. As Example, when in put to much Tags in my Column Tags then the Cell doesnt grow. It just cut off the Content. Is there a Possiblity to prevent that or make the Content of that Row visible?

    I hope you know what i mean.

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

      @Fuel-0 said in A few Questions about QTableView:

      How can i change that?

      It's the vertical header, you can hide them, either programatically or in the designer.

      At the Moment the Cells are kind of fixed

      See QTableView::resizeColumnsToContents() and e.g. QHeaderView::sectionResizeMode()

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

      1 Reply Last reply
      4
      • Fuel 0F Offline
        Fuel 0F Offline
        Fuel 0
        wrote on last edited by
        #3

        Ok thanks i fixed that. The only Thing thats left is the Thing about the QHeaderView. Why it looks so stupid after i select a Row? Can i kind of style the QHeaderView when a Row is selected? I just want no Effect on the QHeaderView. My wish is that it just looks like its unselected.

        JonBJ 1 Reply Last reply
        0
        • Fuel 0F Fuel 0

          Ok thanks i fixed that. The only Thing thats left is the Thing about the QHeaderView. Why it looks so stupid after i select a Row? Can i kind of style the QHeaderView when a Row is selected? I just want no Effect on the QHeaderView. My wish is that it just looks like its unselected.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @Fuel-0
          I think that one is https://doc.qt.io/qt-5/qheaderview.html#highlightSections-prop, setHighlightSections(false). Which is the default, so I would guess code has switched it on somewhere.

          1 Reply Last reply
          3
          • Fuel 0F Offline
            Fuel 0F Offline
            Fuel 0
            wrote on last edited by
            #5

            Found it. Thanks to all now everything is fine.

            1 Reply Last reply
            2

            • Login

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