def __init__(self, parent=None, value=0): super(TestWidget, self).__init__(parent) pos = QCursor().pos() self.setGeometry(pos.x(), pos.y(), 200, 100) value_list = [0.001, 0.01, 0.1, 1, 10, 100, 1000] pos = QCursor.pos() ladder = installLadderDelegate( self, user_input=QEvent.MouseButtonRelease, value_list=value_list) ladder.setDiscreteDrag(True, alignment=Qt.AlignLeft, depth=10) ladder.setDiscreteDrag(True, alignment=Qt.AlignLeft, depth=10, display_widget=self.parent().parent())
def show(self): QWidget.show(self) p = QCursor().pos() self.move(p.x(), p.y())