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. How to update height of QStandardItem/Delegate?
Forum Updated to NodeBB v4.3 + New Features

How to update height of QStandardItem/Delegate?

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++ qtdelegatesizehint
16 Posts 3 Posters 1.2k Views 2 Watching
  • 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 JonB

    @StudentScripter I only know of making sizeHint() work for the correct state.

    S Offline
    S Offline
    StudentScripter
    wrote on last edited by
    #5

    @JonB I tryed that in a later version of my code but had no success. But i'll go for the error hunt. I update with new code when i really can't figure it out myself. :) Thanks Jon.

    SGaistS 1 Reply Last reply
    0
    • S StudentScripter

      @JonB I tryed that in a later version of my code but had no success. But i'll go for the error hunt. I update with new code when i really can't figure it out myself. :) Thanks Jon.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #6

      When the editor is big and complex, it might be better to have it off cell.

      That said, I think you might be taking the wrong approach here. The inspector on the right seems to be a full fledged widget not a delegate.

      I see a combo-box at the top which is likely a selector that will trigger the selection of the current item to show. Once selected, the inspector will be loaded with the detail for this item. This could be accomplished with a QDataWidgetMapper.

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

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        When the editor is big and complex, it might be better to have it off cell.

        That said, I think you might be taking the wrong approach here. The inspector on the right seems to be a full fledged widget not a delegate.

        I see a combo-box at the top which is likely a selector that will trigger the selection of the current item to show. Once selected, the inspector will be loaded with the detail for this item. This could be accomplished with a QDataWidgetMapper.

        S Offline
        S Offline
        StudentScripter
        wrote on last edited by
        #7

        @SGaist So no listview or widget? But i want to have many of such modules which should be reorderable by drag and drop, so i thought i could harness the build in dnd functionality of qlistview or qlistwidget.

        SGaistS 1 Reply Last reply
        0
        • S StudentScripter

          @SGaist So no listview or widget? But i want to have many of such modules which should be reorderable by drag and drop, so i thought i could harness the build in dnd functionality of qlistview or qlistwidget.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #8

          @StudentScripter can you explain what you mean by module ?

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

          S 2 Replies Last reply
          0
          • SGaistS SGaist

            @StudentScripter can you explain what you mean by module ?

            S Offline
            S Offline
            StudentScripter
            wrote on last edited by
            #9

            @SGaist One Dropdown section with all the widgets that are into such a dropdown.

            So for example modul1/dropdown1:
            -4 lineedits for width, height, posx, posy

            modul2/dropdown2:
            -checkbox for hiding elements in the scene
            -lineedit for setting the name of the item ins scene

            and so on you get the point. :) Have a nice weekend.

            1 Reply Last reply
            0
            • SGaistS SGaist

              @StudentScripter can you explain what you mean by module ?

              S Offline
              S Offline
              StudentScripter
              wrote on last edited by
              #10

              @SGaist Or should i use indiviual widgets and implement drag and drop within a layout? How to make this efficient? Setting all widgets not used parent to nullptr? Or what should it do?

              SGaistS 1 Reply Last reply
              0
              • S StudentScripter

                @SGaist Or should i use indiviual widgets and implement drag and drop within a layout? How to make this efficient? Setting all widgets not used parent to nullptr? Or what should it do?

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @StudentScripter Did you consider having a "edit mode" where you move things around ?

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

                S 1 Reply Last reply
                0
                • SGaistS SGaist

                  @StudentScripter Did you consider having a "edit mode" where you move things around ?

                  S Offline
                  S Offline
                  StudentScripter
                  wrote on last edited by
                  #12

                  @SGaist Preferabily i would like to not have an edit mode, if possible. But whats your idea with an edit mode?

                  Also if not using that. Would implementing drag and drop inside they layout be the way or is there any other better methode? Thank you very much.

                  SGaistS 1 Reply Last reply
                  0
                  • S StudentScripter

                    @SGaist Preferabily i would like to not have an edit mode, if possible. But whats your idea with an edit mode?

                    Also if not using that. Would implementing drag and drop inside they layout be the way or is there any other better methode? Thank you very much.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #13

                    @StudentScripter with the edit mode, you can make your widgets look a bit like a dashboard where you move things around a bit like on iOS when you long press on the screen and things start wobbling. You can then move them around and once it's done you can again use them.

                    As for your second question, it's rather at the containing widget level that you would do that. You would move things around in the layout but it's not the layout that is responsible for the D&D part as layouts do not have a "body".

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

                    S 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      @StudentScripter with the edit mode, you can make your widgets look a bit like a dashboard where you move things around a bit like on iOS when you long press on the screen and things start wobbling. You can then move them around and once it's done you can again use them.

                      As for your second question, it's rather at the containing widget level that you would do that. You would move things around in the layout but it's not the layout that is responsible for the D&D part as layouts do not have a "body".

                      S Offline
                      S Offline
                      StudentScripter
                      wrote on last edited by
                      #14

                      @SGaist Yeah i primarily meant drag and drop within the qscrollarea where the layout is located. But is this really my best option? What to keep in mind when having many widgets? Or is removing the widgets that are currently not supposed to be shown from the layout enough? Have good 1st may.

                      SGaistS 1 Reply Last reply
                      0
                      • S StudentScripter

                        @SGaist Yeah i primarily meant drag and drop within the qscrollarea where the layout is located. But is this really my best option? What to keep in mind when having many widgets? Or is removing the widgets that are currently not supposed to be shown from the layout enough? Have good 1st may.

                        SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #15

                        @StudentScripter Things to keep in mind is that if you have a QScrollArea that contains the equivalent of multiple screens worth of widgets, then it won't be nice for your users.

                        You should start by drawing your widgets and then think about how many are necessary, how they should be shown, etc. And if possible discuss that with people from your target audience.

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

                        S 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          @StudentScripter Things to keep in mind is that if you have a QScrollArea that contains the equivalent of multiple screens worth of widgets, then it won't be nice for your users.

                          You should start by drawing your widgets and then think about how many are necessary, how they should be shown, etc. And if possible discuss that with people from your target audience.

                          S Offline
                          S Offline
                          StudentScripter
                          wrote on last edited by
                          #16

                          @SGaist Thank you very much. One last questions before closing this thread:

                          1. Does using setListWigetItem (QListWidget) make an difference in performance compared to just using the widgets inside a scrollarea or is the overhead the same?

                          Have a nice day! :)

                          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