It's hard to tell, but I would first address the fact that you are
using global references to all your objects to remove that as being
any factor. The problem with using globals is that they can just come
from anywhere. I can't look at this code and know where they really
live.

The insertWidget call would most likely handle if you are adding a bad
type of object to the layout.

yea I would probably have to look at the entire context of the code.


On Thu, Oct 11, 2012 at 3:35 PM, Berg Jones <bergjo...@gmail.com> wrote:
> I agree. I have a lot of redundancies. My coding style isn't that clean. I'm
> definitely going to look into fixing this once I have the functionality that
> I'm looking for with the small number of test lights. I can replace _1 with
> _2.
>
> Right now Im having a problem with maya hanging when I do the insertWidget
> command. I can post a longer code sample if that could help.
>
>
>     def eventFilter(self, obj, event):
>         if event.type() == QEvent.KeyPress:
>             key = event.key()
>             if key in (QtCore.Qt.Key_Up, QtCore.Qt.Key_Down):
>                 if obj == dynamicSidebarScroll_1:
>                     self.moveRequested.emit(event.key(), '1')
>                     return True
>                 if obj == dynamicSidebarScroll_2:
>                     self.moveRequested.emit(event.key(), '2')
>                     return True
>
>         return False
>
>
>     def moveLightItem(self, direction, widget): #obj
>         obj = self.sender()
>
>
>         if widget == '1':
>             selected_splitter = splitter_1
>         elif widget == '2':
>             selected_splitter = splitter_2
>
>         idx = insideTab_vertLayout.indexOf(selected_splitter) #obj
>
>         print idx
>         print 'Move in direction %s' % (direction)
>         if direction == QtCore.Qt.Key_Up:
>             print 'up press'
>             idx = max(idx-1, 0)
>         elif direction == QtCore.Qt.Key_Down:
>             print 'down press'
>             idx = min(idx+1, insideTab_vertLayout.count()-1)
>
>         insideTab_vertLayout.insertWidget(idx, obj)    #obj
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to