Skip to content

Commit 8444698

Browse files
authored
Fixed conditional in simpletreemodel example
lines[number][position] contains a bytes literal, for example the first line in default.txt would be: "b'Getting Started\t\t\t\tHow to familiarize yourself with Qt Designer'". If we compared this line with a string containing a whitespace (' '), that would evaluate false. This caused the nested structure to fail (all items were siblings of each other being only children of root item).
1 parent fd13690 commit 8444698

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/itemviews/simpletreemodel/simpletreemodel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def setupModelData(self, lines, parent):
165165
while number < len(lines):
166166
position = 0
167167
while position < len(lines[number]):
168-
if lines[number][position] != ' ':
168+
if lines[number][position] != b' ':
169169
break
170170
position += 1
171171

0 commit comments

Comments
 (0)