[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KStandardAction source code
From:       Jan Kalcic <jandot () googlemail ! com>
Date:       2012-11-09 10:07:38
Message-ID: 509CD5EA.9000509 () gmail ! com
[Download RAW message or body]

On 11/08/2012 07:04 AM, Kevin Krammer wrote:
> Hi,
>
> On Wednesday, 2012-11-07, Jan Kalcic wrote:
>> Hi,
>>
>> 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.
>>
>> 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.
> Yes, because what "copy" means is very much dependent on what I fully  the application
> does, i.e. what kind of content your application is editing.
>
> 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.
>
> The classes holding the data will have different API, different variable names,
> etc.
>
> There is just no way to share this in a generic way.

I understand, it really makes sense to me.

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 :-)

>
> Since you are transforming an already existing application, don't you have
> that slot already and only need to replace the UI?
Actually not, I am introducing now these actions having just found 
KStandardAction.

THanks,
Jan

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic