mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 10:38:22 +02:00
(Qt): process Clipboard change event
git-svn-id: trunk@11643 -
This commit is contained in:
parent
af0cbd09af
commit
02fbc366d2
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user