[Qt] Request to add clipboard operation messages

zeljko zeljko at holobit.net
Thu Oct 13 12:47:36 CEST 2011


On Thursday 13 of October 2011 08:17:27 Luiz Americo Pereira Camara wrote:
> Hi,
> 
> In order to implement LM_CLEAR, LM_CUT, LM_PASTE and LM_COPY under
> LCL/Qt is necessary to notify the widgetset when those actions occurs.

Why ? or better eg: if LCL sent LM_COPY to Qt ws, what happened before 
a) LCL already maded copy ?
b) LCL wants to copy something ?


> 
> I could not find a native way of doing so. AFAIK using QObject::connect
> it should be notified after the method (slot? - i'm c++ noob) is
> executed and is necessary that the message be sent before the Text is
> changed. Also it would be good the possibility to filter the action,
> i.e, if filtered in event::Filter the action should not occur.
> 
> I come with the following idea (i tried to compile under unix but got
> errors while using qmake so could not create a patch)
> 
> -Add constants for custom events (>QEvent::User): QEventClear,
> QEventCut, QEventPaste, QEventCopy
> -Create create descendants to QLineEdit and QTextEdit
> -Override clear, cut, copy, paste methods for these descendants in those
> methods do (in pseudo code):
> 
> if not eventFilter(Self, QEventPaste/Clear/Cut/Copy) then
>    inherited;
> 
> //maybe use QApplication.PostEvent instead of eventFilter?
> 
> -Return an instance of those descendants in QLine/TextEdit_create so the
> overloaded methods are used
> 
> As i said i dont program with c++ even could not build the qt wrapper,
> so maybe you can come with a better schema

I can do that, just answer me on above questions.

zeljko


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/qt/attachments/20111013/04f5633b/attachment-0002.html>


More information about the Qt mailing list