Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator QTableView horizontalHeader()

Qt Creator QTableView horizontalHeader()

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
4 Posts 2 Posters 703 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.
  • OscarTheGrouchO Offline
    OscarTheGrouchO Offline
    OscarTheGrouch
    wrote on last edited by OscarTheGrouch
    #1

    Can't set a minimum width (or vertical height) for the Table headers.
    Use this before (Qt Creator 4 .. I think) ..
    view->horizontalHeader()->setMinimumSectionsSize(1);
    view->verticalHeader()->setMinimumSectionsSize(1);
    but get error now with Qt Creator 6.0 "member access into incomplete type 'QHeaderView'

    I want to set the Row and Col to 1 (very small) but can't seem to get there.
    Help greatly appreciated
    OtG.

    JonBJ 1 Reply Last reply
    0
    • OscarTheGrouchO OscarTheGrouch

      Can't set a minimum width (or vertical height) for the Table headers.
      Use this before (Qt Creator 4 .. I think) ..
      view->horizontalHeader()->setMinimumSectionsSize(1);
      view->verticalHeader()->setMinimumSectionsSize(1);
      but get error now with Qt Creator 6.0 "member access into incomplete type 'QHeaderView'

      I want to set the Row and Col to 1 (very small) but can't seem to get there.
      Help greatly appreciated
      OtG.

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

      @OscarTheGrouch
      This does not look like "Qt Creator", assuming by that you meant the Designer component. This looks like code you write in your .cpp file. You may happen to use Qt Creator's IDE to edit your files, but this is no Creator issue.

      You will get the incomplete type 'QHeaderView' error if you have failed to precede your lines by #include <QHeaderView>, which you should do.

      I do not know why you are using Qt 6, if that's what you are saying. It has only just been released, and may have issues. I would be using Qt 5.

      OscarTheGrouchO 2 Replies Last reply
      2
      • JonBJ JonB

        @OscarTheGrouch
        This does not look like "Qt Creator", assuming by that you meant the Designer component. This looks like code you write in your .cpp file. You may happen to use Qt Creator's IDE to edit your files, but this is no Creator issue.

        You will get the incomplete type 'QHeaderView' error if you have failed to precede your lines by #include <QHeaderView>, which you should do.

        I do not know why you are using Qt 6, if that's what you are saying. It has only just been released, and may have issues. I would be using Qt 5.

        OscarTheGrouchO Offline
        OscarTheGrouchO Offline
        OscarTheGrouch
        wrote on last edited by
        #3

        @JonB said in Qt Creator QTableView horizontalHeader():

        @OscarTheGrouch
        This does not look like "Qt Creator", assuming by that you meant the Designer component. This looks like code you write in your .cpp file. You may happen to use Qt Creator's IDE to edit your files, but this is no Creator issue.

        You will get the incomplete type 'QHeaderView' error if you have failed to precede your lines by #include <QHeaderView>, which you should do.

        I do not know why you are using Qt 6, if that's what you are saying. It has only just been released, and may have issues. I would be using Qt 5.

        It is Qt Creator Code. It was written in 2018. I was using Linux Mint 18 MATE at the time. After installing LM 20 MATE all that was installed was Qt Designer. I hadn't work on this code in quite some time, I'm pretty sure it was done with Netbeans as a Qt Project. It complied and ran without that header included at that point. ALMOST ALL the code connected with the Data Modeling and Table View worked with the includes I had in the original project. It was based on Example code from the Help files.

        Qt 6 is what the web site offers for download. They don't make it easy to figure out what version it is either. Because I'm only interested as a hobbyist, I used the Open Source version. It is even confusing when you check the version from "About" it says

        Qt Creator 4.13.3
        Based on Qt 5.15.2 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

        Built on Nov 13 2020 12:29:31

        Tools->Options->Kits show 'Desktop Qt 6.0.0 GCC 64bit'

        So they are pretty confusing in a number of ways IMO, but Netbeans can't do C++ right now and I find no other platform for doing Desktop code for Linux.

        I will add the Header file and see if that solves the issue. Thanks for the reply.
        OtG

        1 Reply Last reply
        0
        • JonBJ JonB

          @OscarTheGrouch
          This does not look like "Qt Creator", assuming by that you meant the Designer component. This looks like code you write in your .cpp file. You may happen to use Qt Creator's IDE to edit your files, but this is no Creator issue.

          You will get the incomplete type 'QHeaderView' error if you have failed to precede your lines by #include <QHeaderView>, which you should do.

          I do not know why you are using Qt 6, if that's what you are saying. It has only just been released, and may have issues. I would be using Qt 5.

          OscarTheGrouchO Offline
          OscarTheGrouchO Offline
          OscarTheGrouch
          wrote on last edited by
          #4

          @JonB That worked, my TableView header size is correct. Still have other issues yet to figure out, like the Table View doesn't close when I close the App and the goes behind the Main Window when I Select something from the MenuBar.
          Thanks again,
          OtG

          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