Ticket #70 (closed bug: fixed)

Opened 7 years ago

Last modified 7 years ago

OWToolbar builtinFunctions

Reported by: gregor Owned by: janez
Milestone: 1.0 Component: library
Severity: major Keywords:
Cc: Blocking:
Blocked By:

Description

scatterplot se mi usuje, ko se klice activateLoadedSettings, kjer se

tezava je v init od OWToolbar-a pri uporabi default buttons spremenljivke.

v vrstici 47 se namrec nastavi: self.functions = [type(f) == int and self.builtinFunctions[f] or f for f in buttons]

to nastavi vrednost self.functions na:

[('Zooming', 'buttonZoom', 'activateZooming', <qt.QPixmap instance at 0x0A5D05F8>, <qt.QCursor instance at 0x00F7E760>, 1),
('Rectangle selection', 'buttonSelectRect', 'activateRectangleSelection', <qt.QPixmap instance at 0x0A5D0698>, <qt.QCursor instance at 0x00F7EA30>, 1),
('Polygon selection', 'buttonSelectPoly', 'activatePolygonSelection', <qt.QPixmap instance at 0x0A5D06C0>, <qt.QCursor instance at 0x00F7EA30>, 1),
0,
('Remove last selection', 'buttonRemoveLastSelection', 'removeLastSelection', <qt.QPixmap instance at 0x0A5D06E8>, None, 0),
('Remove all selections', 'buttonRemoveAllSelections', 'removeAllSelections', <qt.QPixmap instance at 0x0A5D0710>, None, 0),
('Send selections', 'buttonSendSelections', , <qt.QPixmap instance at 0x0A5D0738>, None, 0)]

kot vidis so povsod vrednosti razen pri indeksu 3. tam je vrednost 0. Ko se kasneje klice funkcija actionRectangleSelection(), ta poklice self.action(3), ki uporabi tocno indeks 3. Funkcija action nato crkne, ker pricakuje, da bo dobila na indeksu 3 od self.functions <tuple>, namesto tega pa dobi <int>.

To bi popravil sam, pa ne vem kako bi moralo to delat, tako da te prosim, ce pogledas ti.

cel trace je naslednji:

File: debugOne.py in line 56 Function name: <module> Code: instance = module.GUIApplication(debugMode = 1, debugFileName = debugFileName, verbosity = verbosity)

File: visualizations.py in line 144 Function name: init Code: self.loadSettings()

File: visualizations.py in line 197 Function name: loadSettings Code: self.owScatterplot.activateLoadedSettings()

File: OWScatterPlot.py in line 192 Function name: activateLoadedSettings Code: apply([self.zoomSelectToolbar.actionZooming, self.zoomSelectToolbar.actionRectangleSelection, self.zoomSelectToolbar.actionPolygonSelection][self.toolbarSelection], [])

File: OWToolbars.py in line 80 Function name: actionRectangleSelection Code: def actionRectangleSelection(self): self.action(3)

File: OWToolbars.py in line 62 Function name: action Code: if f[5]: Exception type: <type 'exceptions.TypeError'> Exception value: 'int' object is unsubscriptable

Change History

comment:1 Changed 7 years ago by janez

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.