From: Barış Metin Date: Wed, 15 Sep 2010 20:14:22 +0000 (+0200) Subject: define model before nested functions X-Git-Tag: sface-0.1-1~8^2~7 X-Git-Url: http://git.onelab.eu/?p=sface.git;a=commitdiff_plain;h=743e1ca6dc5c9d1aa98197e4fb5dfe40d13fb513 define model before nested functions --- diff --git a/sface/rspecwindow.py b/sface/rspecwindow.py index 17bef6a..45c2508 100644 --- a/sface/rspecwindow.py +++ b/sface/rspecwindow.py @@ -24,6 +24,8 @@ class RSpecView(QTreeView): self.collapseAll() self.expandToDepth(0) + model = self.model() + def recursiveExpand(index): parent = index.parent() if parent and parent.isValid(): @@ -40,7 +42,6 @@ class RSpecView(QTreeView): child_index = index.child(r, 0) search(child_index) - model = self.model() root_rows = model.rowCount() for r in range(root_rows): index = model.index(r, 0)