From 02fbc366d2c0c3d31a791ecc4e6ca4c2b4608598 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 27 Jul 2007 07:56:08 +0000 Subject: [PATCH] (Qt): process Clipboard change event git-svn-id: trunk@11643 - --- lcl/interfaces/qt/qtobjects.pas | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lcl/interfaces/qt/qtobjects.pas b/lcl/interfaces/qt/qtobjects.pas index dee630f9e1..be87fa1cb9 100644 --- a/lcl/interfaces/qt/qtobjects.pas +++ b/lcl/interfaces/qt/qtobjects.pas @@ -335,6 +335,8 @@ type public constructor Create; destructor Destroy; override; + function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override; + function Clipboard: QClipboardH; inline; function getMimeData(AMode: QClipboardMode): QMimeDataH; @@ -1846,14 +1848,31 @@ begin FClipBoardFormats := TStringList.Create; FClipBoardFormats.Add('foo'); // 0 is reserved TheObject := QApplication_clipBoard; + AttachEvents; end; destructor TQtClipboard.Destroy; begin + DetachEvents; FClipBoardFormats.Free; inherited Destroy; end; +function TQtClipboard.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; +begin + Result := False; + + if QEvent_type(Event) = QEventClipboard then + begin + Result := True; + + QEvent_accept(Event); + + // Clipboard is changed, but we have no ability at moment to pass that info + // to LCL since LCL has no support for that event + end; +end; + function TQtClipboard.Clipboard: QClipboardH; begin Result := QClipboardH(TheObject);