From kde-devel Wed Nov 21 18:27:00 2012 From: Kevin Krammer Date: Wed, 21 Nov 2012 18:27:00 +0000 To: kde-devel Subject: Re: KStandardAction source code Message-Id: <201211211927.09629.krammer () kde ! org> X-MARC-Message: https://marc.info/?l=kde-devel&m=135352247322728 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============5175251603506971168==" --===============5175251603506971168== Content-Type: multipart/signed; boundary="nextPart2322550.zzaofGexFs"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2322550.zzaofGexFs Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Friday, 2012-11-09, Jan Kalcic wrote: > On 11/08/2012 07:04 AM, Kevin Krammer wrote: > > Hi, > >=20 > > On Wednesday, 2012-11-07, Jan Kalcic wrote: > >> Hi, > >>=20 > >> I have a Qt app which I am little-by-little "moving" to KDE, with this= I > >> mean I am switching from Qt classes to KDE ones where possible. > >>=20 > >> With this I am now adding new KStandardAction(s), very quick and easy, > >> but AFAIU these only provides predefined menu items via XMLGUI > >> technology, but not the slot implementation code. So for example, if I > >> want to use the copy KStandardAction, I anyway need to write the source > >> code for the slot this action is connected to. > >=20 > > Yes, because what "copy" means is very much dependent on what I fully=20 > > the application does, i.e. what kind of content your application is > > editing. > >=20 > > A file manager will copy a list of file URLs to the clipboard, a text > > editor would copy some plain text, a web browser might copy plain text > > and/or HTML, an image editor some pixel data. > >=20 > > The classes holding the data will have different API, different variable > > names, etc. > >=20 > > There is just no way to share this in a generic way. >=20 > I understand, it really makes sense to me. >=20 > However my wondering was because of the behavior of "copy" and "paste", > for example, which just copy and paste what selected whatever and > whereever it is, like if it was "over" the applications and shared by > them. Trying to say it with different words, in my app I can easily do > Ctrl+C and Ctrl-C and this simply work. However, if I want the same for > my actions I have to write the whole code while it seems it is already > there somewhere :-) It is more likely that whatever widget you are dealing with has built-in=20 support for clipboard operations. For example QTextEdit does. Cheers, Kevin =2D-=20 Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring --nextPart2322550.zzaofGexFs Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iD8DBQBQrRz0nKMhG6pzZJIRAj5nAJ4pGsCI6g0u0E71oXlXIdN9Y1ZrXQCfRneb vkISocoREZdp24Jb8RckHq8= =MzSV -----END PGP SIGNATURE----- --nextPart2322550.zzaofGexFs-- --===============5175251603506971168== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============5175251603506971168==--