How is plasma active handling copy/paste in QML?

Mark markg85 at gmail.com
Thu Nov 29 14:45:33 UTC 2012


On Thu, Nov 29, 2012 at 3:25 PM, Aaron J. Seigo <aseigo at kde.org> wrote:
> On Thursday, November 29, 2012 15:07:51 Mark wrote:
>> > So how does it work there?
>> > Where is the QML component that can notify me of copy/cut/paste events?
> ..
>> No replies and i can't find anything about cut/copy/paste actions in
>> the plasma-mobile repository. Is there nothing for this?
>
> it's done the same way as in the QWidget world -> capture the keyboard
> shortcut and use QClipboard .. i'm not aware of any QML clipboard bindings
> (perhaps they exist, i'm just not personally aware of any), but they can be
> accessed from C++.
>
> as for file management, the Active Files application has a bit of C++ that
> provides access to KIO's copy and trash methods.
>
> so either there needs to be some C++ in your project, or a QML plugin written
> in C++ the bridges to KIO needs to be written. a Plasma::Service would
> probably do the trick quite nicely as those can be loaded into QML ..
>
> --
> Aaron J. Seigo
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel at kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
>

Marco, Aaron,

Thanks for the information. Could any of you tell me some more about
the Plasma::Service stuff? The tutorial [1] provides only a little bit
of information.
Or would just wrapping QClipboard  (along with some cut/copy/paste
calls) in a QML component be enough?

[1] http://techbase.kde.org/Development/Tutorials/Plasma/Services


More information about the Plasma-devel mailing list