Issue
I have a grid with a load of QFrame objects in it, let's call them "box_#".
I'm using findChildren for some behavior,
I want to add other QFrame objects to the layout.
findChildren has a QRegExp in the signature, how do I use it to filter my QFrame objects? not very faimiliar with regExp..
like so:
self.grid.parentWidget().findChildren(QtWidgets.QFrame, "box_*").
i.e. how do I get only the QFrame objects with objectName "box_1","box_2" and so on...
Solution
You have to use ^
:
self.grid.parentWidget().findChildren(QtGui.QFrame, QtCore.QRegExp("^box_"))
Answered By - eyllanesc
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.