[PyQt] clipboard not work on GNOME/Unity?
pekingmaster at gmail.com
Thu Sep 20 05:36:33 BST 2012
Can anyone help me on this?
On Tue, Sep 11, 2012 at 10:12 AM, zw g <pekingmaster at gmail.com> wrote:
> Anyone? Some suggestion would be fine.
> On Sat, Sep 8, 2012 at 8:17 PM, zw g <pekingmaster at gmail.com> wrote:
>> Dear list,
>> How can i copy files between applications on GNOME/Unity desktop(with
>> Nautilus file manager)?
>> The below code works fine on KDE & Mac OS X(Finder), but not work on
>> GNOME/Unity-based desktop.
>> The section marked with *bold* were the part i used for copy & paster
>> files. (Paste the files i copied from my PyQt app to somewhere on the
>> filesystem, /home/myuser/, etc.)
>> def buildContextMenu(self):
>> self.contextMenu = QMenu(self)
>> copyAction = QAction(self.trUtf8('Copy'), self)
>> self.connect(copyAction, SIGNAL('triggered()'),
>> def copy2clipboard(self):
>> selectedList = self.selectedIndexes()
>> if selectedList:
>> paths = 
>> for i in selectedList:
>> p = unicode(i.model().filePath(i))
>> if p not in paths:
>> urls = [QUrl.fromLocalFile(i) for i in paths]
>> mime_data = QMimeData()
>> clipboard = QApplication.clipboard()
>> Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt