I have a very basic doubt regarding QGridLayout
.
For adding a widget in QGridLayout
we give QWidget *
that should be added along with the row
& column
no (some other args as well).
Now for removing a widget there is no function to remove a widget according to row & column no i.e. something like this:
int row, column;
gridObj->remove(row, column);
I think QGridLayout
must be maintaining a sort of QList
to store references of Widgets & there positions. So why is there no function for removing widgets by position only?
It only has 1 remove function for which we need to specify the reference of QWidget
object.
If this is a limitation somehow then is there a workaround for this problem? Maintaining a QList by myself is a solution but it is pretty tedious. Thank You
I might be mistaken here, but from skimming the documentation, try this:
I've always had trouble reordering widgets in layouts, removing widgets from layouts, and etc... Oftentimes, I just resort to deleting the layout and re-adding the widgets. =(
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With