Stuart Berg
Stuart Berg

Reputation: 18151

Qt: Iterate over all top-level windows

How can I iterate over all top-level windows (i.e. widgets which have parent==0) in my Qt4 application?

(Both C++ and Python examples are acceptable.)

Upvotes: 0

Views: 1406

Answers (1)

cmannett85
cmannett85

Reputation: 22346

Use QApplication::topLevelWidgets(). Docs here.

Upvotes: 2

Related Questions