Skip to content

Commit

Permalink
(#406) No operation editor for will_import column
Browse files Browse the repository at this point in the history
A NO_EDIT constant was added to the ``qt.conroller.table`` module.
When this is seen, the createEditor method will return None
(http://qt-project.org/forums/viewthread/9541).
  • Loading branch information
brownnrl committed Dec 27, 2014
1 parent d718cab commit c0e0ba0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qt/controller/import_/table.py
Expand Up @@ -10,13 +10,13 @@
from PyQt4.QtGui import QPixmap

from qtlib.column import Column
from ..table import Table
from ..table import Table, NO_EDIT

MIME_INDEXES = 'application/moneyguru.rowindexes'

class ImportTable(Table):
COLUMNS = [
Column('will_import', 20),
Column('will_import', 20, editor=NO_EDIT),
Column('date', 80),
Column('description', 90),
Column('amount', 90, alignment=Qt.AlignRight),
Expand Down
3 changes: 3 additions & 0 deletions qt/controller/table.py
Expand Up @@ -15,6 +15,7 @@
from ..support.date_edit import DateEdit
from ..support.item_delegate import ItemDelegate

NO_EDIT = 'no_edit'
DATE_EDIT = 'date_edit'
DESCRIPTION_EDIT = 'description_edit'
PAYEE_EDIT = 'payee_edit'
Expand Down Expand Up @@ -51,6 +52,8 @@ def createEditor(self, parent, option, index):
editType = column.editor
if editType is None:
return ItemDelegate.createEditor(self, parent, option, index)
elif editType == NO_EDIT:
return None
elif editType == DATE_EDIT:
return DateEdit(parent)
elif editType in EDIT_TYPE2COMPLETABLE_EDIT:
Expand Down

0 comments on commit c0e0ba0

Please sign in to comment.