Skip to content

Commit

Permalink
Merge branch 'master' into merge-master-to-epd8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan March committed Mar 19, 2012
2 parents 5ac234c + 71ab42b commit 7c27077
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# file types to ignore
*.pyc
*.pyd
*.so
*.enamlc
*~
.DS_Store

# ignore the build directories
*.egg-info/
Expand Down
6 changes: 6 additions & 0 deletions docs/source/traitsui_user_manual/advanced_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@ For example::

Item('object.axle.chassis.serial_number')

where `"object"` is the literal name which refers to the top-level object being
viewed. (Note that `"object"` is **not** some user-defined attribute name like
`"axle"` in this example.) More precisely, `"object"` is the default name, in
the view's `context` dictionary, of this top-level viewed object
(see :ref:`advanced-view-concepts`).

Because an Item can refer only to a single trait, do not use extended trait
references that refer to multiple traits, since the behavior of such references
is not defined. Also, avoid extended trait references where one of the
Expand Down
3 changes: 0 additions & 3 deletions traitsui/qt4/list_str_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ def init ( self, parent ):
signal = QtCore.SIGNAL('activated(QModelIndex)')
QtCore.QObject.connect(self.list_view, signal, self._on_activate)

signal = QtCore.SIGNAL('customContextMenuRequested(QPoint)')
QtCore.QObject.connect(self.list_view, signal, self._on_context_menu)

# Initialize the editor title:
self.title = factory.title
self.sync_value(factory.title_name, 'title', 'from')
Expand Down
5 changes: 1 addition & 4 deletions traitsui/qt4/tree_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1721,24 +1721,21 @@ def startDrag(self, actions):
# Render the item being dragged as a pixmap.
nid_rect = self.visualItemRect(nid)
rect = nid_rect.intersected(self.viewport().rect())

pm = QtGui.QPixmap(rect.size())
pm.fill(self.palette().base().color())

painter = QtGui.QPainter(pm)

option = self.viewOptions()
option.state |= QtGui.QStyle.State_Selected
option.rect = QtCore.QRect(nid_rect.topLeft() - rect.topLeft(), nid_rect.size())

self.itemDelegate().paint(painter, option, self.indexFromItem(nid))

painter.end()

# Calculate the hotspot so that the pixmap appears on top of the
# original item.
rect.adjust(self.horizontalOffset(), self.verticalOffset(), 0, 0)
hspos = self.mapFromGlobal(QtGui.QCursor.pos()) - rect.topLeft()
hspos = self.mapFromGlobal(QtGui.QCursor.pos()) - nid_rect.topLeft()

# Start the drag.
drag = QtGui.QDrag(self)
Expand Down

0 comments on commit 7c27077

Please sign in to comment.