On 15.11.06 09:35:22, hok kakada wrote: > I tried to make context menu for QtableWidget in pyqt4, but I still cannot > get > thru. Does anybody have experience with qtableWidget.
sublcass QTableWidget and re-implement contextMenuEvent. You can fetch the item via the itemAt() function using the event's position member. > I'd also like to do something like move item up, move item down. > It'd be easier if pyqt add them as its public functions. Unless Qt implements such functions, PyQt won't do this. The reason is that a) PyQt is more or less generated from the Qt code b) PyQt isn't supposed to add such functionality on top of Qt However there's an easy way to do this, use the setItem function. retrieve the item to move up and the one currently occupying the "new" position, call setItem with proper row/col values on the tablewidget with both items and you're done. Andreas -- You will outgrow your usefulness. _______________________________________________ PyKDE mailing list [email protected] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
