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. Responsive layout with QFrame
Forum Updated to NodeBB v4.3 + New Features

Responsive layout with QFrame

Scheduled Pinned Locked Moved Solved General and Desktop
23 Posts 4 Posters 6.6k 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.
  • mrjjM mrjj

    @Tyskie
    Hi
    How do you remove the item ?
    It should not crash. Also notice that Qt has a owner system that delete Widgets when parent is deleted
    so its important not to delete the children manually.
    I assume you simply remove the ListWidgetItem ?

    http://doc.qt.io/qt-5/objecttrees.html

    T Offline
    T Offline
    Tyskie
    wrote on last edited by
    #14

    Hi, @mrjj how would delete the widget if not by deleting itself (the widget directly - not ListWidgetItem)?

    mrjjM 1 Reply Last reply
    0
    • T Tyskie

      Hi, @mrjj how would delete the widget if not by deleting itself (the widget directly - not ListWidgetItem)?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #15

      @Tyskie
      Hi and welcome back
      You mean take the widget back from the ListWidgetItem and delete it ?
      (but leave ListWidgetItem alone ) ?

      T 1 Reply Last reply
      0
      • mrjjM mrjj

        @Tyskie
        Hi and welcome back
        You mean take the widget back from the ListWidgetItem and delete it ?
        (but leave ListWidgetItem alone ) ?

        T Offline
        T Offline
        Tyskie
        wrote on last edited by Tyskie
        #16

        @mrjj thx, didn't had much time to get back to it yet.
        I meant to remove the whole 'item' from the list with ListWidgetItem and the widget/layout in it
        I have seem some people using takeItem/take and some with getting the model and removing item from it with removeRow, any best practice for that use case maybe?

        mrjjM 1 Reply Last reply
        0
        • T Tyskie

          @mrjj thx, didn't had much time to get back to it yet.
          I meant to remove the whole 'item' from the list with ListWidgetItem and the widget/layout in it
          I have seem some people using takeItem/take and some with getting the model and removing item from it with removeRow, any best practice for that use case maybe?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #17

          @Tyskie
          there is
          http://doc.qt.io/qt-5/qlistwidget.html#removeItemWidget
          to remove whole widget ( and all it owns)
          or
          http://doc.qt.io/qt-5/qlistwidget.html#takeItem

          im not sure if u want both gone. (item and widget) or just widget

          1 Reply Last reply
          1
          • T Offline
            T Offline
            Tyskie
            wrote on last edited by
            #18

            Oh right I missed the removeItemWidget - my bad, thanks again !

            1 Reply Last reply
            1
            • T Offline
              T Offline
              Tyskie
              wrote on last edited by Tyskie
              #19

              mhm I start to think that QListWidget/View is not what I am looking for :D
              It's been really hard to handle the clicked.connect of my button in the widget that is associated with the QListWidgetItem.
              I am for example unable to find the QListWidgetItem which has the widget button in it that I am clicking on. I can surely click on the text to make it the selected QListWidgetItem and then click the button (having the delete slot method removing the current selected item) but that not really convenient.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tyskie
                wrote on last edited by Tyskie
                #20

                OK I gave up too early - I finally succeed to make it work :D thanks a lot @mrjj

                mrjjM 1 Reply Last reply
                1
                • T Tyskie

                  OK I gave up too early - I finally succeed to make it work :D thanks a lot @mrjj

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #21

                  @Tyskie

                  Super :)

                  alt text

                  JonBJ 1 Reply Last reply
                  1
                  • mrjjM mrjj

                    @Tyskie

                    Super :)

                    alt text

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

                    @mrjj

                    Never ever give up

                    Is that from the frog's or the stork(?)'s POV, or both? ;-)
                    (And the pic makes me think of Windows programming!)
                    Where do you come across this kind of illustration in the first place? :)

                    mrjjM 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @mrjj

                      Never ever give up

                      Is that from the frog's or the stork(?)'s POV, or both? ;-)
                      (And the pic makes me think of Windows programming!)
                      Where do you come across this kind of illustration in the first place? :)

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #23

                      @JonB
                      He he - good thinking.
                      Its was meant for the frog but your
                      comment make me think- it could also apply to the stork
                      as in never give up trying to swallow the frog.
                      I just use google image search as its brilliant nowadays.

                      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