I added QListWidgetItems to QListWidget

but when i try to reorder i am getting unexpected result even though i an 
giving new value to row to set new row

here is what I have so far

    def changePriority(self,*args):
        crntRow = self.listWidget.currentRow()
        total=self.listWidget.count()
        print "Total no. of items %s, and selected item number is 
%s"%(total,crntRow)
        if args[0]=='up':
           if crntRow > 0 :
              crntItem= self.listWidget.takeItem(crntRow)
              self.listWidget.insertItem(crntRow+1,crntItem)
        if args[0]=='down':
           if crntRow + 1  < total:
              crntItem=self.listWidget.takeItem(crntRow)
              sel.listWidget.insertItem(crntRow-1,crntItem)
           else: print "This is the last item cannot move down further."

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].


Reply via email to