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. QTreeWidget - Header always invisible
QtWS25 Last Chance

QTreeWidget - Header always invisible

Scheduled Pinned Locked Moved Solved General and Desktop
qtreewidget
13 Posts 2 Posters 4.9k 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by
    #1

    In the designer I have enabled "headerVisible" and I see the header in the preview, but not in the running program.
    Whats the problem?

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

      Hi,

      Did you configure your QTreeWidgets with rows and columns ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Andy314A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Did you configure your QTreeWidgets with rows and columns ?

        Andy314A Offline
        Andy314A Offline
        Andy314
        wrote on last edited by
        #3

        Yes !

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you show how ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          Andy314A 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you show how ?

            Andy314A Offline
            Andy314A Offline
            Andy314
            wrote on last edited by Andy314
            #5

            I have configured it with the pure designer - no code behind.

            It seem to be a bug, because I found the following:
            Disabling the header visible property disables it for ever. No effect by enabling it again.
            (The preview shows no columns too, now.)

            Second bug: Changing the font changes only the row height of the data not of the headers.

            and an other question: How can I change the width of the columns during design time?

            Andy314A 1 Reply Last reply
            0
            • Andy314A Andy314

              I have configured it with the pure designer - no code behind.

              It seem to be a bug, because I found the following:
              Disabling the header visible property disables it for ever. No effect by enabling it again.
              (The preview shows no columns too, now.)

              Second bug: Changing the font changes only the row height of the data not of the headers.

              and an other question: How can I change the width of the columns during design time?

              Andy314A Offline
              Andy314A Offline
              Andy314
              wrote on last edited by Andy314
              #6

              I found something more.
              It seems the setHeaderVisible(true) function has a bug. It updates not correct.
              The "set to default" which is the true value, triggered by the default button in the property explorer works.

              Maybe it has to do with the opposite value of the QTreeView branch headerHidden.
              Here works the switching.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Did you add some data to your QTreeWidget ?

                I don't remember if it's possible to change the width at design time.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                Andy314A 1 Reply Last reply
                0
                • SGaistS SGaist

                  Did you add some data to your QTreeWidget ?

                  I don't remember if it's possible to change the width at design time.

                  Andy314A Offline
                  Andy314A Offline
                  Andy314
                  wrote on last edited by
                  #8

                  Yes, I added some demo rows with the designer.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Can you share somewhere your project to make it possible to test it ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    Andy314A 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      Can you share somewhere your project to make it possible to test it ?

                      Andy314A Offline
                      Andy314A Offline
                      Andy314
                      wrote on last edited by
                      #10

                      I use Creator 3.5.4 MSVC 5.5.1 32-bit
                      There is nothing special in my project, but when you cannot reproduce it I will send it.
                      Produce the bug:
                      Put a QTreeWidget on a dialog. The designer shows the columnname "1". The preview shows the same.
                      Disable and reenable the headerVisible: The designer shows the header but the preview and the running program not !
                      Click on the default Button for headerVisible: all works again.
                      (The effect in independent of the count of items in the view.)

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        Can you test that again with Qt 5.6 Beta/RC ?

                        I just tried following your instructions (on OS X with a more recent build of Qt) and it didn't misbehave.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        Andy314A 2 Replies Last reply
                        0
                        • SGaistS SGaist

                          Can you test that again with Qt 5.6 Beta/RC ?

                          I just tried following your instructions (on OS X with a more recent build of Qt) and it didn't misbehave.

                          Andy314A Offline
                          Andy314A Offline
                          Andy314
                          wrote on last edited by
                          #12

                          Ok, it seem to be fixed !? I will test it if I have time. In the moment I am a little bit in stress with my current project.

                          1 Reply Last reply
                          0
                          • SGaistS SGaist

                            Can you test that again with Qt 5.6 Beta/RC ?

                            I just tried following your instructions (on OS X with a more recent build of Qt) and it didn't misbehave.

                            Andy314A Offline
                            Andy314A Offline
                            Andy314
                            wrote on last edited by
                            #13

                            With my new installation Creator 3.6.0 (new version) and Qt 5.5.1 (same version as before) it works now.

                            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