Add some asserts
This commit is contained in:
parent
e56099e0ec
commit
293ebc8d46
@ -93,6 +93,8 @@ class CompletionView(QTreeView):
|
|||||||
"""
|
"""
|
||||||
width = e.size().width()
|
width = e.size().width()
|
||||||
cols = self.model.columnCount()
|
cols = self.model.columnCount()
|
||||||
|
assert cols >= 1
|
||||||
|
assert width / cols > 1
|
||||||
for i in range(cols):
|
for i in range(cols):
|
||||||
self.setColumnWidth(i, width / cols)
|
self.setColumnWidth(i, width / cols)
|
||||||
super().resizeEvent(e)
|
super().resizeEvent(e)
|
||||||
@ -130,6 +132,8 @@ class CompletionView(QTreeView):
|
|||||||
bottomright = geom.topRight()
|
bottomright = geom.topRight()
|
||||||
delta = QPoint(0, 200)
|
delta = QPoint(0, 200)
|
||||||
topleft = bottomleft - delta
|
topleft = bottomleft - delta
|
||||||
|
assert topleft.x() < bottomright.x()
|
||||||
|
assert topleft.y() < bottomright.y()
|
||||||
self.setGeometry(QRect(topleft, bottomright))
|
self.setGeometry(QRect(topleft, bottomright))
|
||||||
|
|
||||||
def cmd_text_changed(self, text):
|
def cmd_text_changed(self, text):
|
||||||
|
Loading…
Reference in New Issue
Block a user