Unsolved How to use the code to set item's state activated ?
-
Hi, Thanks and regards advance!
When i use the
QListWidget
, i saw the document and found the followingQListWidgetItem class
[signal] void QListWidget::itemActivated(QListWidgetItem *item)
This signal is emitted when the item is activated. The item is activated when the user clicks or double clicks on it, depending on the system configuration. It is also activated when the user presses the activation key (on Windows and X11 this is the Return key, on Mac OS X it is Command+O).It says the user can make item to activated by clicks or double clicks ...
Now, I want to use the code to set one item activated. but, I found nothing, there isn't one set_function to set it. like the following functionvoid QListWidget::setCurrentItem(...)
void QListWidget::setCurrentRow(...)How to use code to set item activated ? and what's state of item is Activated?
-
@joeQ http://doc.qt.io/qt-5/qlistwidget.html#setCurrentItem
Sets the current item to item. Unless the selection mode is NoSelection, the item is also selected.
-
@jsulm
Thanks, But it is wrong way! I tried.setCurrentItem
isn't emitted theitemActivated
signal. I want to use the code to set item activated and then emit theitemActivated
signal.And i want to know, is there another way to emit the
itemActivated
signal but users clicks or double clicks... -
Hi,
Like you already saw, the conditions for itemActivated to be generate are explained in the signal's documentation.
Are you trying to trigger the edition of that item ?