Im working through some cut/copy/paste problems and realized something.
When you pass QMimeData to the QClipboard for the application, the
clipboard takes ownership. Once that is done, you lose that data. So
you cannot do ::mimeData and hold on to that pointer. BECAUSE, once
::setMimeData gets called again, QClipboard does a delete on the
previous mime data. So for now I just disabled undoing the mimeData
contents. If you want Avogadro to maintain a type of clipboard stack
(where you can undo and reset the contents of the clipboard) then you
need to manually copy all the mimedata (ie, for every mimetype we use
check to see if the clipboard has it and save that data individually).
Personally, there are no applications that do this. Try a text editor,
you can undo a ‘cut’ operation but even cut doesn’t pop off the
Just letting everyone know, and more for Geoff as he implemented it so
didn’t want him to wonder why i’m doing that.
Also, i disabled the selection buffer as calling ::setMimeData on the
clipboard and mimedata was causing a segfault. I’m not sure where the
problem is but I need to recompile QT with debugging to figure it out.
I’ll see what I can come up with.