setupVertical() and setupHorizontal() methods on QuiltViewBase class, call setColumnCount(int) and setRowCount(int) passing -1 as undefined value, this makes GridLayout throw an IllegalArgumentException. Instead, these methods should pass UNDEFINED constant as undefined value.