简体   繁体   中英

force QListWidget signal to emit in pyside

How can I force any of the following signals to emit from within a function which is fired from a button push?

def currentItemChanged (current, previous)
def currentRowChanged (currentRow)
def currentTextChanged (currentText)
def itemActivated (item)
def itemChanged (item)
def itemClicked (item)
def itemDoubleClicked (item)
def itemEntered (item)
def itemPressed (item)
def itemSelectionChanged ()

You can emit the signals yourself. Assuming self is an instance of a QListWidget :

self.itemActivated.emit(myItem)
self.currentTextChanged.emit("some new text")
...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM