View Full Version : QTreeView and item editing
roxton
24th July 2008, 22:42
I have a QTreeView with an editable QDirModel. How can I detect when user ends an item editing (rename)? (I need to update some stuff after that)
And another question - is there someway to catch the Delete key pressing on QTreeView (without a subclassing)?
aamer4yu
25th July 2008, 05:36
I have a QTreeView with an editable QDirModel. How can I detect when user ends an item editing (rename)? (I need to update some stuff after that)
Am not sure about it,,, but I guess QItemDelegate::setModelData is the function for you :)
And another question - is there someway to catch the Delete key pressing on QTreeView (without a subclassing)?
Yess,,, install a event filter on the QTreeView - Refer QObject::installEventFilter
Hope this helps :)
roxton
25th July 2008, 11:00
Thank you! And about the QItemDelegate::setModelData - I've used a commitData signal from QItemDelegate.
aamer4yu
25th July 2008, 18:56
Ya, commitData was the signal, I remembered somewhat abt it but was not able to locate it :(
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.