Responsive layout with QFrame
-
wrote on 28 May 2018, 22:54 last edited by
Well actually if one item gets removed, the others does not fill the place it left. More over when I remove an item and the resize the window, I got segment fault. I guess I am not yet done with ! hehe :)
Thank you for the delegate example I will check it out and learn from it.
-
Well actually if one item gets removed, the others does not fill the place it left. More over when I remove an item and the resize the window, I got segment fault. I guess I am not yet done with ! hehe :)
Thank you for the delegate example I will check it out and learn from it.
@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 ? -
wrote on 29 May 2018, 08:14 last edited by Tyskie
Hi,
even worse :D I have a button.clicked.connect which I connected to QFrame close().
so the button close the entire QFrame when X is pressed. -
@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 ? -
Hi, @mrjj how would delete the widget if not by deleting itself (the widget directly - not ListWidgetItem)?
@Tyskie
Hi and welcome back
You mean take the widget back from the ListWidgetItem and delete it ?
(but leave ListWidgetItem alone ) ? -
@Tyskie
Hi and welcome back
You mean take the widget back from the ListWidgetItem and delete it ?
(but leave ListWidgetItem alone ) ?wrote on 6 Jun 2018, 20:43 last edited by Tyskie 6 Jun 2018, 20:45@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? -
@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?@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#takeItemim not sure if u want both gone. (item and widget) or just widget
-
wrote on 6 Jun 2018, 20:48 last edited by
Oh right I missed the removeItemWidget - my bad, thanks again !
-
wrote on 6 Jun 2018, 22:40 last edited by Tyskie 6 Jun 2018, 22:42
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. -
-
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? :)@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.