- I've finally run the tests with OK result (56 tests in 102.937 sec)
- I had to play with module imports as they created a lot of error in the tests although in reality the program worked OK. - I've fixed some mistakes in TcL commands (they were testing isinstance against the like of Geometry instead of FlatCAMGeometry) - I've had to add some fixes in ObjectCollections.py (error on create_index() method but Marco already fixed this in the checkbox in project tab pull request and knew about this. - Although at some point the tests run fine, I've made some checkings on my own over the Tcl commands and discovered errors which I fixed as mentioned above. - conclusion is that tests are just a must and do not cover everything (like saving projects which at some point by juggling with imports I braked and tests were 100% OK)
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
# MIT Licence #
|
||||
############################################################
|
||||
|
||||
#from PyQt4.QtCore import QModelIndex
|
||||
from FlatCAMObj import *
|
||||
import inspect # TODO: Remove
|
||||
import FlatCAMApp
|
||||
@@ -162,13 +161,13 @@ class ObjectCollection():
|
||||
self.object_list.append(obj)
|
||||
|
||||
# Create the model item to insert into the QListView
|
||||
icon = QtGui.QIcon(self.icons[obj.kind])#self.icons["gerber"])
|
||||
item = QtGui.QStandardItem(icon, name)
|
||||
icon = QtGui.QIcon(self.icons[obj.kind]) #self.icons["gerber"])
|
||||
item = QtGui.QStandardItem(icon, str(name))
|
||||
item.setCheckable(True)
|
||||
if obj.options["plot"] == True:
|
||||
item.setCheckState(2)#Qt.Checked)
|
||||
if obj.options["plot"] is True:
|
||||
item.setCheckState(2) #Qt.Checked)
|
||||
else:
|
||||
item.setCheckState(0) #Qt.Unchecked)
|
||||
item.setCheckState(0) #Qt.Unchecked)
|
||||
|
||||
self.model.appendRow(item)
|
||||
|
||||
@@ -289,7 +288,7 @@ class ObjectCollection():
|
||||
:param name: Name of the FlatCAM Object
|
||||
:return: None
|
||||
"""
|
||||
iobj = self.createIndex(self.get_names().index(name), 0) # Column 0
|
||||
iobj = self.model.createIndex(self.get_names().index(name), 0) # Column 0
|
||||
self.view.selectionModel().select(iobj, QtGui.QItemSelectionModel.Select)
|
||||
|
||||
def set_inactive(self, name):
|
||||
@@ -300,7 +299,7 @@ class ObjectCollection():
|
||||
:param name: Name of the FlatCAM Object
|
||||
:return: None
|
||||
"""
|
||||
iobj = self.createIndex(self.get_names().index(name), 0) # Column 0
|
||||
iobj = self.model.createIndex(self.get_names().index(name), 0) # Column 0
|
||||
self.view.selectionModel().select(iobj, QtGui.QItemSelectionModel.Deselect)
|
||||
|
||||
def set_all_inactive(self):
|
||||
|
||||
Reference in New Issue
Block a user