PDA

View Full Version : QTableView,Delegate Cut and paste problem



baray98
27th August 2010, 08:06
I am using a qtableview and added some cut and paste functionality to it. In my cut and paste I took all the selected cells and extract data out from it and format the text with CSV so my user can paste it to some spreadsheet program ( excel). I took all my data from the model (QAbstracItemModel*) which i can get from the view. It worked fine until I inserted the delegate. I implemented some delegates to some column to produced the right format that my user wants.

Now, my cut and paste won't reflect whatever is shown in my table. i.e. if a cell in my view displayed 1.23 and the model data cell is actually 1.230340405 ( my delegate is actually doing the rounding) , then when i do my cut and paste the user will the unformatted value (since i am getting all my data from my model)

How can i overcome this problem? I want to cut and paste whatever my user see in my table view , not the data from the model.

baray98