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. Designer Table Widget features limitations
QtWS25 Last Chance

Designer Table Widget features limitations

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 2.0k 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.
  • JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #1

    Trying to use Qt Designer (in Creator). Have a number of tables to design with design-time fixed information and column widths.

    For one table I need multiple columns which each have different length text in them. Here is what does not seem doable at design-time:

    1. I cannot set individual column (or cell) widths via any properties (only overall column default/minimum, which does me no good).

    2. I cannot set "stretch columns to fit content".

    3. From the Edit Table Widget > Items tab I can drag column widths just like I want, which is great, but that does not "stick"/get saved to file, it's lost immediately on exiting that dialog.

    4. I could try forcing some newlines into text in cells. I can't actually type a newline, but I can type \n into it at design-time. This is supposed to work if I did it from code, but whatever reads the .ui (uic) treats it as a literal string not as a newline. (EDIT: OK, I have found I can achieve this one by setting as Rich Text. Unfortunately this was a by-the-by point, it's #1--3 I really want.)

    Are all of the above limitations of Qt Designer or of my ability to use it?

    Pl45m4P 1 Reply Last reply
    0
    • JonBJ JonB

      Trying to use Qt Designer (in Creator). Have a number of tables to design with design-time fixed information and column widths.

      For one table I need multiple columns which each have different length text in them. Here is what does not seem doable at design-time:

      1. I cannot set individual column (or cell) widths via any properties (only overall column default/minimum, which does me no good).

      2. I cannot set "stretch columns to fit content".

      3. From the Edit Table Widget > Items tab I can drag column widths just like I want, which is great, but that does not "stick"/get saved to file, it's lost immediately on exiting that dialog.

      4. I could try forcing some newlines into text in cells. I can't actually type a newline, but I can type \n into it at design-time. This is supposed to work if I did it from code, but whatever reads the .ui (uic) treats it as a literal string not as a newline. (EDIT: OK, I have found I can achieve this one by setting as Rich Text. Unfortunately this was a by-the-by point, it's #1--3 I really want.)

      Are all of the above limitations of Qt Designer or of my ability to use it?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @JonB said in Designer Table Widget features limitations:

      I cannot set individual column (or cell) widths via any properties (only overall column default/minimum, which does me no good).

      Yes, true :)

      @JonB said in Designer Table Widget features limitations:

      I cannot set "stretch columns to fit content".

      This stretch - ResizeMode is a QHeaderView property. Some (bool stretchLastSection) are accessible in QtDesigner directly, but the stretch-to-content - mode or the ResizeMode-enum in general isn't.
      https://doc.qt.io/qt-5/qheaderview.html#ResizeMode-enum

      @JonB said in Designer Table Widget features limitations:

      From the Edit Table Widget > Items tab I can drag column widths just like I want, which is great, but that does not "stick"/get saved to file, it's lost immediately on exiting that dialog.

      This "feature" is just a preview. It does not change any of your QTableWidget properties

      @JonB said in Designer Table Widget features limitations:

      Are all of the above limitations of Qt Designer or of my ability to use it?

      All three can not be done with QtDesigner.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      JonBJ 1 Reply Last reply
      3
      • Pl45m4P Pl45m4

        @JonB said in Designer Table Widget features limitations:

        I cannot set individual column (or cell) widths via any properties (only overall column default/minimum, which does me no good).

        Yes, true :)

        @JonB said in Designer Table Widget features limitations:

        I cannot set "stretch columns to fit content".

        This stretch - ResizeMode is a QHeaderView property. Some (bool stretchLastSection) are accessible in QtDesigner directly, but the stretch-to-content - mode or the ResizeMode-enum in general isn't.
        https://doc.qt.io/qt-5/qheaderview.html#ResizeMode-enum

        @JonB said in Designer Table Widget features limitations:

        From the Edit Table Widget > Items tab I can drag column widths just like I want, which is great, but that does not "stick"/get saved to file, it's lost immediately on exiting that dialog.

        This "feature" is just a preview. It does not change any of your QTableWidget properties

        @JonB said in Designer Table Widget features limitations:

        Are all of the above limitations of Qt Designer or of my ability to use it?

        All three can not be done with QtDesigner.

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

        @Pl45m4
        LOL, thanks. So basically: "Yes/No, you can indeed not do any of the things you want at design-time", right? :)

        I'm new to Designer, having done everything in code before. It seems (compared to other UI designers I have used, e.g. Visual Studio) that it has a lot of design-time limitations if you expect what you design to be like what you will see....

        Pl45m4P 1 Reply Last reply
        0
        • JonBJ JonB

          @Pl45m4
          LOL, thanks. So basically: "Yes/No, you can indeed not do any of the things you want at design-time", right? :)

          I'm new to Designer, having done everything in code before. It seems (compared to other UI designers I have used, e.g. Visual Studio) that it has a lot of design-time limitations if you expect what you design to be like what you will see....

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @JonB said in Designer Table Widget features limitations:

          So basically: "Yes/No, you can indeed not do any of the things you want at design-time", right? :)

          Well... YES :-)

          @JonB said in Designer Table Widget features limitations:

          I'm new to Designer, having done everything in code before.

          IMO the QtDesigner is great to create a, more or less, simple GUI (at least the template for a more complex one - You start with Designer and continue with code afterwards). Further specifictions you have to do in your code.

          Why you want to do all this things with QtDesigner, if you can (need to) code them anyway?


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          JonBJ 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @JonB said in Designer Table Widget features limitations:

            So basically: "Yes/No, you can indeed not do any of the things you want at design-time", right? :)

            Well... YES :-)

            @JonB said in Designer Table Widget features limitations:

            I'm new to Designer, having done everything in code before.

            IMO the QtDesigner is great to create a, more or less, simple GUI (at least the template for a more complex one - You start with Designer and continue with code afterwards). Further specifictions you have to do in your code.

            Why you want to do all this things with QtDesigner, if you can (need to) code them anyway?

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

            @Pl45m4 said in Designer Table Widget features limitations:

            Why you want to do all this things with QtDesigner, if you can (need) to code them anyway?

            I meant, I have coded everything dynamically in the past, no Designer. Not on this project. I did not say that hand-coding UI layouts was quick/productive/satisfying! :) Trying to guess what something will look like, and especially moving things around and trying to get the desired layout etc. from code, is a frustrating experience. So it's time to use Qt Designer for me!

            In this particular case, I have quite a number of printed tables with content which must be put into app, and visually approximate the printed layout. In general doing it via Designer is proving better/faster than hand-coding. Except when I get to the bits I know I could do so easily in code but I'd like to be able to do & see at design-time, but Designer is not offering the facilities as per my question. Then I get frustrated again :)

            Yes, I am now combing some design-time layout with some support run-time coding as I go, but it's a shame when I don't get the visual effect at design-time.

            Pl45m4P 1 Reply Last reply
            0
            • JonBJ JonB

              @Pl45m4 said in Designer Table Widget features limitations:

              Why you want to do all this things with QtDesigner, if you can (need) to code them anyway?

              I meant, I have coded everything dynamically in the past, no Designer. Not on this project. I did not say that hand-coding UI layouts was quick/productive/satisfying! :) Trying to guess what something will look like, and especially moving things around and trying to get the desired layout etc. from code, is a frustrating experience. So it's time to use Qt Designer for me!

              In this particular case, I have quite a number of printed tables with content which must be put into app, and visually approximate the printed layout. In general doing it via Designer is proving better/faster than hand-coding. Except when I get to the bits I know I could do so easily in code but I'd like to be able to do & see at design-time, but Designer is not offering the facilities as per my question. Then I get frustrated again :)

              Yes, I am now combing some design-time layout with some support run-time coding as I go, but it's a shame when I don't get the visual effect at design-time.

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by
              #6

              @JonB said in Designer Table Widget features limitations:

              I meant, I have coded everything dynamically in the past, no Designer

              I know that you can, that's why I asked.

              @JonB said in Designer Table Widget features limitations:

              In general doing it via Designer is proving better/faster than hand-coding

              That's exactly the thing. The Designer saves at lot of time, when creating GUIs, but it's not meant to replace most of the coding work. We have to accept, that most Qt widget things can't be done in QtDesigner. This is where you close the window and go back to your code :-)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              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