Brother for the first time with QT, now combined with QTreeview and QFileSystemModel made a file browser window, I need to allow the selected directory with the keyboard , and then select the directory path to read it, but I found no node is selected QTreeView signals , similar to the the signal is activated (const QModelIndex &), but this signal need to select the node and then press Enter to launch. Who knows how to get
------ Solution ------------------------------------ --------
void QItemSelectionModel :: currentChanged (const QModelIndex & current, const QModelIndex & previous) [signal]
This signal is emitted whenever the current item changes. The previous model item index is replaced by the current index as the selection's current item.
Note that this signal will not be emitted when the item model is reset.
signal bad use QTreeView-> selectionModel (), instead of QTreeView
------ eference ---------------------- -----------------
upstairs positive solution to this problem has troubled me two days , and was not able to check the information QT seen directly , depressed ah
--- --- eference ---------------------------------------
positive solution to the sub-
没有评论:
发表评论